From 46cc740de8c58093ad3fd11396d1b9a545cb0c8c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?S=C3=A9bastien=20Villemot?= <sebastien.villemot@ens.fr>
Date: Wed, 13 Jun 2012 18:34:20 +0200
Subject: [PATCH] Macroprocessor: mention @#ifdef in error messages (cherry
 picked from commit bbc6cba4a354982510f44fa42418961c5c8ed7d0)

---
 preprocessor/macro/MacroFlex.ll | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/preprocessor/macro/MacroFlex.ll b/preprocessor/macro/MacroFlex.ll
index 1369b5ebe..590f60ac4 100644
--- a/preprocessor/macro/MacroFlex.ll
+++ b/preprocessor/macro/MacroFlex.ll
@@ -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);
-- 
GitLab