Mercurial > hg > octave-avbm
comparison libinterp/parse-tree/oct-parse.yy @ 16115:4f6c37cfbdce
cleanup lexical_feedback objects
* lex.h (lexical_feedback::cleanup): New static member function.
* oct-parse.yy (eval_string, parse_fcn_file): Put new clenup function
on unwind-protect stack to delete lexer object.
* input.cc (get_debug_input): Likewise.
* toplev.cc (main_loop): Likewise.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Feb 2013 10:58:33 -0500 |
parents | 7c5e5e97a3bc |
children | 6884401b2fbb |
comparison
equal
deleted
inserted
replaced
16114:73a21ade0b6b | 16115:4f6c37cfbdce |
---|---|
3498 if (ffile) | 3498 if (ffile) |
3499 { | 3499 { |
3500 bool eof; | 3500 bool eof; |
3501 | 3501 |
3502 frame.protect_var (curr_lexer); | 3502 frame.protect_var (curr_lexer); |
3503 | |
3504 curr_lexer = new lexical_feedback (); | 3503 curr_lexer = new lexical_feedback (); |
3504 frame.add_fcn (lexical_feedback::cleanup, curr_lexer); | |
3505 | 3505 |
3506 reset_parser (); | 3506 reset_parser (); |
3507 | 3507 |
3508 std::string help_txt = gobble_leading_white_space (ffile, eof); | 3508 std::string help_txt = gobble_leading_white_space (ffile, eof); |
3509 | 3509 |
4304 octave_value_list retval; | 4304 octave_value_list retval; |
4305 | 4305 |
4306 unwind_protect frame; | 4306 unwind_protect frame; |
4307 | 4307 |
4308 frame.protect_var (curr_lexer); | 4308 frame.protect_var (curr_lexer); |
4309 curr_lexer = new lexical_feedback (); | |
4310 frame.add_fcn (lexical_feedback::cleanup, curr_lexer); | |
4309 | 4311 |
4310 frame.protect_var (get_input_from_eval_string); | 4312 frame.protect_var (get_input_from_eval_string); |
4311 frame.protect_var (line_editing); | 4313 frame.protect_var (line_editing); |
4312 frame.protect_var (current_eval_string); | 4314 frame.protect_var (current_eval_string); |
4313 frame.protect_var (current_function_depth); | 4315 frame.protect_var (current_function_depth); |
4316 frame.protect_var (parsing_subfunctions); | 4318 frame.protect_var (parsing_subfunctions); |
4317 frame.protect_var (endfunction_found); | 4319 frame.protect_var (endfunction_found); |
4318 frame.protect_var (reading_fcn_file); | 4320 frame.protect_var (reading_fcn_file); |
4319 frame.protect_var (reading_script_file); | 4321 frame.protect_var (reading_script_file); |
4320 frame.protect_var (reading_classdef_file); | 4322 frame.protect_var (reading_classdef_file); |
4321 | |
4322 curr_lexer = new lexical_feedback (); | |
4323 | 4323 |
4324 get_input_from_eval_string = true; | 4324 get_input_from_eval_string = true; |
4325 line_editing = false; | 4325 line_editing = false; |
4326 current_function_depth = 0; | 4326 current_function_depth = 0; |
4327 function_scopes.clear (); | 4327 function_scopes.clear (); |