Commit bbc6cba4 authored by Sébastien Villemot's avatar Sébastien Villemot
Browse files

Macroprocessor: mention @#ifdef in error messages

parent 9f161ff3
......@@ -167,8 +167,8 @@ CONT \\\\
<STMT>ifdef { reading_if_statement = true; return token::IFDEF; }
<STMT>if { reading_if_statement = true; return token::IF; }
<STMT>else { driver.error(*yylloc, "@#else is not matched by an @#if statement"); }
<STMT>endif { driver.error(*yylloc, "@#endif 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/@#ifdef statement"); }
<STMT>echo { return token::ECHO_DIR; }
<STMT>error { return token::ERROR; }
......@@ -225,7 +225,7 @@ CONT \\\\
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} {
yylloc->lines(1);
yylloc->step();
......@@ -267,7 +267,7 @@ CONT \\\\
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} {
yylloc->lines(1);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment