diff src/oct-parse.yy @ 13237:1bfca2bbea8b

fix parsing of anonymous functions inside cell array lists. * lex.h (lexer_flags::looking_at_anon_fcn_args): New data member. (lexer_flags::lexer_flags): Initialize it. Initialize looking_at_function_handle to 0, not false. * lex.ll (lexer_flags::init): Reset looking_at_anon_fcn_args to 0. * oct-parse.yy (param_list_beg): Set lexer_flags.looking_at_anon_fcn_args to true if lexer_flags.looking_at_function_handle is non-zero. (")"): Set lexer_flags.looking_at_anon_fcn_args to false. * test_parser.m: New tests.
author John W. Eaton <jwe@octave.org>
date Tue, 27 Sep 2011 03:22:48 -0400
parents 34a49d076155
children 2a8dcb5b3a00
line wrap: on
line diff
--- a/src/oct-parse.yy	Tue Sep 27 02:06:41 2011 -0400
+++ b/src/oct-parse.yy	Tue Sep 27 03:22:48 2011 -0400
@@ -735,7 +735,10 @@
                 ;
 
 anon_fcn_handle : '@' param_list statement
-                  { $$ = make_anon_fcn_handle ($2, $3); }
+                  {
+                    lexer_flags.quote_is_transpose = false;
+                    $$ = make_anon_fcn_handle ($2, $3);
+                  }
                 ;
 
 primary_expr    : identifier
@@ -1230,6 +1233,7 @@
                         symtab_context.push (symbol_table::current_scope ());
                         symbol_table::set_scope (symbol_table::alloc_scope ());
                         lexer_flags.looking_at_function_handle--;
+                        lexer_flags.looking_at_anon_fcn_args = true;
                       }
                   }
                 ;