changeset 16129:053b0364b507

localize use of yy_fatal_error with lexical_feedback member function * lex.h, lex.ll (lexical_feedback::fatal_error): New function. (YY_FATAL_ERROR): Use it.
author John W. Eaton <jwe@octave.org>
date Tue, 26 Feb 2013 16:03:00 -0500
parents 210039e91ad6
children 421dea028bbf
files libinterp/parse-tree/lex.h libinterp/parse-tree/lex.ll
diffstat 2 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.h
+++ b/libinterp/parse-tree/lex.h
@@ -291,6 +291,8 @@
 
   void display_token (int tok);
 
+  void fatal_error (const char *msg);
+
   void lexer_debug (const char *pattern, const char *text);
 
   // TRUE means that we should convert spaces to a comma inside a
--- a/libinterp/parse-tree/lex.ll
+++ b/libinterp/parse-tree/lex.ll
@@ -113,13 +113,7 @@
 #undef YY_FATAL_ERROR
 #endif
 #define YY_FATAL_ERROR(msg) \
-  do \
-    { \
-      error (msg); \
-      OCTAVE_QUIT; \
-      yy_fatal_error (msg); \
-    } \
-  while (0)
+  curr_lexer->fatal_error (msg)
 
 #define DISPLAY_TOK_AND_RETURN(tok) \
   do \
@@ -3709,6 +3703,16 @@
 }
 
 void
+lexical_feedback::fatal_error (const char *msg)
+{
+  error (msg);
+
+  OCTAVE_QUIT;
+
+  yy_fatal_error (msg);
+}
+
+void
 lexical_feedback::lexer_debug (const char *pattern, const char *text)
 {
   std::cerr << std::endl;