small fixes

deepseek
serr 2025-04-22 12:15:00 +03:00
parent 7a923d1706
commit 80a50c7a28
1 changed files with 2 additions and 2 deletions

View File

@ -7,7 +7,7 @@ extern int CURRENT_LINE_NUMBER;
extern char *yytext;
void yyerror(const char *s) {
fprintf(stderr, "\033[91mError at line %i\033[0m", yylineno);
fprintf(stderr, "\033[91mError at line %i\033[0m", CURRENT_LINE_NUMBER);
exit(1);
}
extern int yylex();
@ -36,7 +36,7 @@ content:
%%
int main(int argc, char **argv) {
yylineno = 1;
CURRENT_LINE_NUMBER = 1;
if (argc > 1) {
FILE *f = fopen(argv[1], "r");