added code to print out positions of incorrect tokens

This commit is contained in:
Partho Bhattacharya
2025-02-21 15:25:21 -05:00
parent 0a806fd5ba
commit eb3452fec9
2 changed files with 6 additions and 1 deletions

View File

@ -81,6 +81,8 @@ SCHAR \\n|\\t|\\\"|[^\"\n\\]
{ID} {if(DEBUG) {printf( "ID: %s (%d)\n", yytext, ID);} else {return ID;}}
\n {line_number++; column_number = 1;}
. {column_number++;}
\t {column_number++;}
" " {column_number++;}
. {column_number++; return 1999;}
%%