Mercurial > hg > octave-nkf
diff libinterp/parse-tree/oct-parse.in.yy @ 16277:8cb65fd72164
eliminate obsolete concepts of "pending local" and "forced" variables
* symtab.h, lexh, lex.ll, oct-parse.in.yy, toplev.cc, input.cc:
Delete unused functions and data for handling pending local and forced
variables in the parser and lexer.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Mon, 11 Mar 2013 15:01:32 -0400 |
parents | c5e5f6ccac5d |
children | ea78011f66bf 8c17cd370477 |
line wrap: on
line diff
--- a/libinterp/parse-tree/oct-parse.in.yy +++ b/libinterp/parse-tree/oct-parse.in.yy @@ -427,25 +427,13 @@ ; matrix : '[' ']' - { - $$ = new tree_constant (octave_null_matrix::instance); - curr_lexer->pending_local_variables.clear (); - } + { $$ = new tree_constant (octave_null_matrix::instance); } | '[' ';' ']' - { - $$ = new tree_constant (octave_null_matrix::instance); - curr_lexer->pending_local_variables.clear (); - } + { $$ = new tree_constant (octave_null_matrix::instance); } | '[' ',' ']' - { - $$ = new tree_constant (octave_null_matrix::instance); - curr_lexer->pending_local_variables.clear (); - } + { $$ = new tree_constant (octave_null_matrix::instance); } | '[' matrix_rows ']' - { - $$ = curr_parser.finish_matrix ($2); - curr_lexer->pending_local_variables.clear (); - } + { $$ = curr_parser.finish_matrix ($2); } ; matrix_rows : matrix_rows1 @@ -672,14 +660,10 @@ $$ = curr_parser.validate_matrix_for_assignment ($1); if ($$) - { - curr_lexer->looking_at_matrix_or_assign_lhs = false; - curr_lexer->pending_local_variables.clear (); - } + { curr_lexer->looking_at_matrix_or_assign_lhs = false; } else { - // validate_matrix_for_assignment deleted $1 - // for us. + // validate_matrix_for_assignment deleted $1. ABORT_PARSE; } } @@ -2581,11 +2565,6 @@ script->stash_fcn_file_time (now); primary_fcn_ptr = script; - - // Unmark any symbols that may have been tagged as local variables - // while parsing (for example, by force_local_variable in lex.l). - - symbol_table::unmark_forced_variables (); } // Begin defining a function. @@ -2786,12 +2765,6 @@ retval = new tree_function_def (fcn); } - - // Unmark any symbols that may have been tagged as local - // variables while parsing (for example, by force_local_variable - // in lex.l). - - symbol_table::unmark_forced_variables (fcn->scope ()); } return retval; @@ -3237,12 +3210,6 @@ curr_parser.autoloading = autoload; curr_parser.fcn_file_from_relative_lookup = relative_lookup; - // Do this with an unwind-protect cleanup function so that - // 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); - curr_parser.curr_lexer->force_script = force_script; curr_parser.curr_lexer->prep_for_file (); curr_parser.curr_lexer->parsing_class_method = ! dispatch_type.empty (); @@ -3939,12 +3906,6 @@ { curr_parser.reset (); - // Do this with an unwind-protect cleanup function so that 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); - parse_status = curr_parser.run (); // Unmark forced variables.