From 3c31489253536c839a52cf5cefabfb9f2196abeb Mon Sep 17 00:00:00 2001 From: serr Date: Tue, 20 May 2025 18:47:16 +0300 Subject: [PATCH] =?UTF-8?q?with=20dot=20identifier=20=D0=BC=D0=BE=D0=B6?= =?UTF-8?q?=D0=B5=D1=82=20=D0=B1=D1=8B=D1=82=D1=8C=20=D1=81=D0=BE=20=D0=BC?= =?UTF-8?q?=D0=BD=D0=BE=D0=B3=D0=B8=D0=BC=D0=B8=20=D1=82=D0=BE=D1=87=D0=BA?= =?UTF-8?q?=D0=B0=D0=BC=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- analyzers/test/test.l | 2 +- analyzers/test/test.y | 2 +- tests/test_funcs.txt | 19 +++++++++++++++++++ 3 files changed, 21 insertions(+), 2 deletions(-) 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);}();