glcpp: Return NEWLINE token for newlines inside multi-line comments.
This is necessary for the main compiler to get correct line numbers.
This commit is contained in:
@@ -82,9 +82,9 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
|
|||||||
/* Multi-line comments */
|
/* Multi-line comments */
|
||||||
"/*" { yy_push_state(COMMENT, yyscanner); }
|
"/*" { yy_push_state(COMMENT, yyscanner); }
|
||||||
<COMMENT>[^*\n]*
|
<COMMENT>[^*\n]*
|
||||||
<COMMENT>[^*\n]*\n { yylineno++; yycolumn = 0; }
|
<COMMENT>[^*\n]*\n { yylineno++; yycolumn = 0; return NEWLINE; }
|
||||||
<COMMENT>"*"+[^*/\n]*
|
<COMMENT>"*"+[^*/\n]*
|
||||||
<COMMENT>"*"+[^*/\n]*\n { yylineno++; yycolumn = 0; }
|
<COMMENT>"*"+[^*/\n]*\n { yylineno++; yycolumn = 0; return NEWLINE; }
|
||||||
<COMMENT>"*"+"/" {
|
<COMMENT>"*"+"/" {
|
||||||
yy_pop_state(yyscanner);
|
yy_pop_state(yyscanner);
|
||||||
if (yyextra->space_tokens)
|
if (yyextra->space_tokens)
|
||||||
|
Reference in New Issue
Block a user