Mercurial > hg > octave-nkf
changeset 16122:6884401b2fbb
move reset_parser lexer helper function to lexical_feedback class
* lex.h, lex.ll (reset_parser): Declare as member function of
lexical_feedback class. Change all uses.
(cleanup_parser): Don't call reset parser.
* parse.h (reset_parser): Delete decl.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Feb 2013 12:43:15 -0500 |
parents | bdf365c5c9bf |
children | a484e39d1f22 |
files | libinterp/interpfcn/input.cc libinterp/interpfcn/toplev.cc libinterp/parse-tree/lex.h libinterp/parse-tree/lex.ll libinterp/parse-tree/oct-parse.yy libinterp/parse-tree/parse.h |
diffstat | 6 files changed, 7 insertions(+), 12 deletions(-) [+] |
line wrap: on
line diff
--- a/libinterp/interpfcn/input.cc +++ b/libinterp/interpfcn/input.cc @@ -686,7 +686,7 @@ { reset_error_handler (); - reset_parser (); + curr_lexer->reset_parser (); // Save current value of global_command. frame.protect_var (global_command);
--- a/libinterp/interpfcn/toplev.cc +++ b/libinterp/interpfcn/toplev.cc @@ -574,7 +574,7 @@ reset_error_handler (); - reset_parser (); + curr_lexer->reset_parser (); if (symbol_table::at_top_level ()) tree_evaluator::reset_debug_state ();
--- a/libinterp/parse-tree/lex.h +++ b/libinterp/parse-tree/lex.h @@ -205,6 +205,8 @@ looking_at_object_index.push_front (false); } + void reset_parser (void); + int octave_read (char *buf, unsigned int max_size); void do_comma_insert_check (void);
--- a/libinterp/parse-tree/lex.ll +++ b/libinterp/parse-tree/lex.ll @@ -976,12 +976,8 @@ %% -// Fix things up for errors or interrupts. The parser is never called -// recursively, so it is always safe to reinitialize its state before -// doing any parsing. - void -reset_parser (void) +lexical_feedback::reset_parser (void) { // Start off on the right foot. BEGIN (INITIAL); @@ -1209,8 +1205,6 @@ void cleanup_parser (void) { - reset_parser (); - clear_all_buffers (); }
--- a/libinterp/parse-tree/oct-parse.yy +++ b/libinterp/parse-tree/oct-parse.yy @@ -3503,7 +3503,7 @@ curr_lexer = new lexical_feedback (); frame.add_fcn (lexical_feedback::cleanup, curr_lexer); - reset_parser (); + curr_lexer->reset_parser (); std::string help_txt = gobble_leading_white_space (ffile, eof); @@ -4344,7 +4344,7 @@ do { - reset_parser (); + curr_lexer->reset_parser (); frame.protect_var (global_command);