Mercurial > octave-libgccjit
diff src/parse.y @ 8001:ff9e7873f8ea
improve handling of command-style names in matrix_or_assign_lhs context
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Thu, 31 Jul 2008 13:11:14 -0400 |
parents | 0d607e8dbbfa |
children | a2ab20ba78f7 |
line wrap: on
line diff
--- a/src/parse.y Thu Jul 31 05:53:02 2008 -0400 +++ b/src/parse.y Thu Jul 31 13:11:14 2008 -0400 @@ -579,16 +579,19 @@ { $$ = new tree_constant (octave_value (Matrix ())); lexer_flags.looking_at_matrix_or_assign_lhs = false; + lexer_flags.pending_local_variables.clear (); } | '[' ';' ']' { $$ = new tree_constant (octave_value (Matrix ())); lexer_flags.looking_at_matrix_or_assign_lhs = false; + lexer_flags.pending_local_variables.clear (); } | '[' matrix_rows ']' { $$ = finish_matrix ($2); lexer_flags.looking_at_matrix_or_assign_lhs = false; + lexer_flags.pending_local_variables.clear (); } ; @@ -835,6 +838,13 @@ { $$ = $2; lexer_flags.looking_at_matrix_or_assign_lhs = false; + for (std::set<std::string>::const_iterator p = lexer_flags.pending_local_variables.begin (); + p != lexer_flags.pending_local_variables.end (); + p++) + { + force_local_variable (*p); + } + lexer_flags.pending_local_variables.clear (); } ;