Mercurial > hg > octave-avbm
diff libinterp/interpfcn/toplev.cc @ 16151:e309eb7940be
parser tweaks
* input.cc (get_debug_input): Create parser outside of loop.
* toplev.cc (main_loop): Likewise.
* oct-parse.yy (parse_fcn_file): Don't reset newly created parser.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Wed, 27 Feb 2013 20:32:42 -0500 |
parents | 49dfba4fd3c5 |
children | c5bfdc4c0963 |
line wrap: on
line diff
--- a/libinterp/interpfcn/toplev.cc +++ b/libinterp/interpfcn/toplev.cc @@ -559,18 +559,20 @@ // The big loop. + unwind_protect frame; + + // octave_parser constructor sets this for us. + frame.protect_var (CURR_LEXER); + + octave_parser *curr_parser = new octave_parser (); + frame.add_fcn (octave_parser::cleanup, curr_parser); + int retval = 0; do { try { - unwind_protect frame; - - // octave_parser constructor sets this for us. - frame.protect_var (CURR_LEXER); - - octave_parser *curr_parser = new octave_parser (); - frame.add_fcn (octave_parser::cleanup, curr_parser); + unwind_protect inner_frame; reset_error_handler (); @@ -583,9 +585,9 @@ // the forced variables will be unmarked in the event of an // interrupt. symbol_table::scope_id scope = symbol_table::top_scope (); - frame.add_fcn (symbol_table::unmark_forced_variables, scope); + inner_frame.add_fcn (symbol_table::unmark_forced_variables, scope); - frame.protect_var (global_command); + inner_frame.protect_var (global_command); global_command = 0;