diff --git a/analyzers/test/test.l b/analyzers/test/test.l index 40a5bbe..bb92f84 100644 --- a/analyzers/test/test.l +++ b/analyzers/test/test.l @@ -125,7 +125,7 @@ LETTER_OR_DIGIT [a-zA-Z0-9_] return STRING_LITERAL; } -{LETTER}{LETTER_OR_DIGIT}*(\.{LETTER}{LETTER_OR_DIGIT}*)? { +{LETTER}({LETTER_OR_DIGIT}*\.)*{LETTER_OR_DIGIT}* { yylval.str = strdup(yytext); if (strchr(yytext, '.') != NULL) { return WITH_DOT_IDENTIFIER; diff --git a/analyzers/test/test.y b/analyzers/test/test.y index 2941ff0..cc6ea8a 100644 --- a/analyzers/test/test.y +++ b/analyzers/test/test.y @@ -141,7 +141,7 @@ cicle: { printf("\033[1;34mLOOP: full for loop with init, condition and post\033[0m\n"); } | FOR log_expr loop_block { printf("\033[1;34mLOOP: for loop with condition only\033[0m\n"); } - | FOR identifiers_list SHORT_DECLARATION RANGE IDENTIFIER loop_block + | FOR identifiers_list SHORT_DECLARATION RANGE any_identifier loop_block { printf("\033[1;34mLOOP: range for loop\033[0m\n"); } ; diff --git a/tests/test_funcs.txt b/tests/test_funcs.txt index dc1cd14..c676f61 100644 --- a/tests/test_funcs.txt +++ b/tests/test_funcs.txt @@ -10,6 +10,25 @@ func server(a int) { func iife(work int) { + var err error; + var app models.App; + + log.SetPrefix(fmt.Sprintf("%s | ", app.Cfg.ServerDomain)); + + router := setupRoutes(app); + + if app, err = models.InitApp(); err != nil { + log.Fatal(err); + } + + + // Обработка страничек постов + for key := range app.Posts { + postLink := a(key); + router.Handle(postLink, m(controllers_pages.PostPageHandler(app))); + } + + for i := 1; i < 3; i++ { func(){}(); func(){fmt.Println(123);}();