updated comment count
This commit is contained in:
11
runner.c
11
runner.c
@ -26,6 +26,17 @@ int main(int argc, char *argv[]) {
|
||||
if (arg == TOK_ARG) {
|
||||
fprintf(output, "%d %d %3d \"%s\"\n", line_number, column_number, token, yytext);
|
||||
}
|
||||
if(token == COMMENT){
|
||||
for (int i = 0; i < yyleng; i++) {
|
||||
if(yytext[i] == '\n'){
|
||||
line_number++;
|
||||
column_number = 0;
|
||||
}
|
||||
column_number++;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
column_number += yyleng;
|
||||
}
|
||||
|
||||
if (yyin != NULL) {
|
||||
|
Reference in New Issue
Block a user