# HG changeset patch # User John W. Eaton # Date 1361912580 18000 # Node ID 053b0364b5070abd6942abd5a36a3b21d26f5988 # Parent 210039e91ad6d0a4b8c6004348307b906d0cca3c 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. diff -r 210039e91ad6 -r 053b0364b507 libinterp/parse-tree/lex.h --- a/libinterp/parse-tree/lex.h Tue Feb 26 15:39:56 2013 -0500 +++ b/libinterp/parse-tree/lex.h Tue Feb 26 16:03:00 2013 -0500 @@ -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 diff -r 210039e91ad6 -r 053b0364b507 libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll Tue Feb 26 15:39:56 2013 -0500 +++ b/libinterp/parse-tree/lex.ll Tue Feb 26 16:03:00 2013 -0500 @@ -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;