Macroprocessor: mention @#ifdef in error messages
parent
9f161ff339
commit
bbc6cba4a3
|
@ -167,8 +167,8 @@ CONT \\\\
|
||||||
<STMT>ifdef { reading_if_statement = true; return token::IFDEF; }
|
<STMT>ifdef { reading_if_statement = true; return token::IFDEF; }
|
||||||
|
|
||||||
<STMT>if { reading_if_statement = true; return token::IF; }
|
<STMT>if { reading_if_statement = true; return token::IF; }
|
||||||
<STMT>else { driver.error(*yylloc, "@#else is not matched by an @#if statement"); }
|
<STMT>else { driver.error(*yylloc, "@#else is not matched by an @#if/@#ifdef statement"); }
|
||||||
<STMT>endif { driver.error(*yylloc, "@#endif is not matched by an @#if statement"); }
|
<STMT>endif { driver.error(*yylloc, "@#endif is not matched by an @#if/@#ifdef statement"); }
|
||||||
|
|
||||||
<STMT>echo { return token::ECHO_DIR; }
|
<STMT>echo { return token::ECHO_DIR; }
|
||||||
<STMT>error { return token::ERROR; }
|
<STMT>error { return token::ERROR; }
|
||||||
|
@ -225,7 +225,7 @@ CONT \\\\
|
||||||
yylloc->step();
|
yylloc->step();
|
||||||
}
|
}
|
||||||
<THEN_BODY>. { then_body_tmp.append(yytext); yylloc->step(); }
|
<THEN_BODY>. { then_body_tmp.append(yytext); yylloc->step(); }
|
||||||
<THEN_BODY><<EOF>> { driver.error(if_stmt_loc_tmp, "@#if not matched by an @#endif (unexpected end of file)"); }
|
<THEN_BODY><<EOF>> { driver.error(if_stmt_loc_tmp, "@#if/@#ifdef not matched by an @#endif (unexpected end of file)"); }
|
||||||
<THEN_BODY>^{SPC}*@#{SPC}*else{SPC}*(\/\/.*)?{EOL} {
|
<THEN_BODY>^{SPC}*@#{SPC}*else{SPC}*(\/\/.*)?{EOL} {
|
||||||
yylloc->lines(1);
|
yylloc->lines(1);
|
||||||
yylloc->step();
|
yylloc->step();
|
||||||
|
@ -267,7 +267,7 @@ CONT \\\\
|
||||||
yylloc->step();
|
yylloc->step();
|
||||||
}
|
}
|
||||||
<ELSE_BODY>. { else_body_tmp.append(yytext); yylloc->step(); }
|
<ELSE_BODY>. { else_body_tmp.append(yytext); yylloc->step(); }
|
||||||
<ELSE_BODY><<EOF>> { driver.error(if_stmt_loc_tmp, "@#if not matched by an @#endif (unexpected end of file)"); }
|
<ELSE_BODY><<EOF>> { driver.error(if_stmt_loc_tmp, "@#if/@#ifdef not matched by an @#endif (unexpected end of file)"); }
|
||||||
|
|
||||||
<ELSE_BODY>^{SPC}*@#{SPC}*endif{SPC}*(\/\/.*)?{EOL} {
|
<ELSE_BODY>^{SPC}*@#{SPC}*endif{SPC}*(\/\/.*)?{EOL} {
|
||||||
yylloc->lines(1);
|
yylloc->lines(1);
|
||||||
|
|
Loading…
Reference in New Issue