diff --git a/analyzers/test/test.l b/analyzers/test/test.l index 41876a5..3cb7338 100644 --- a/analyzers/test/test.l +++ b/analyzers/test/test.l @@ -3,14 +3,14 @@ #include #include -int yylineno; +int CURRENT_LINE_NUMBER; %} %% "{" { return LBRACE; } "}" { return RBRACE; } -\n { yylineno++; } +\n { CURRENT_LINE_NUMBER++; } [^{}]+ { yylval.str = strdup(yytext); return TEXT; diff --git a/analyzers/test/test.y b/analyzers/test/test.y index 7252c08..4e8e422 100644 --- a/analyzers/test/test.y +++ b/analyzers/test/test.y @@ -3,7 +3,7 @@ #include #include -extern int yylineno; +extern int CURRENT_LINE_NUMBER; extern char *yytext; void yyerror(const char *s) { @@ -28,8 +28,10 @@ block: ; content: - | content TEXT { printf("TOKEN ('%s')\n", $2); free($2); } - | content block {} + | content TEXT { + printf("TOKEN ('%s')\n", $2); + free($2); } + | content block ; %%