diff src/lex.h @ 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 12df7854fa7c
children 2c664266e9d0
line wrap: on
line diff
--- a/src/lex.h
+++ b/src/lex.h
@@ -60,7 +60,8 @@
 
     : bracketflag (0), braceflag (0), looping (0),
       convert_spaces_to_comma (true), at_beginning_of_statement (true),
-      defining_func (0), looking_at_function_handle (false),
+      defining_func (0), looking_at_function_handle (0),
+      looking_at_anon_fcn_args (true),
       looking_at_return_list (false), looking_at_parameter_list (false),
       looking_at_decl_list (false), looking_at_initializer_expression (false),
       looking_at_matrix_or_assign_lhs (false), looking_at_object_index (),
@@ -101,6 +102,9 @@
   // Nonzero means we are parsing a function handle.
   int looking_at_function_handle;
 
+  // TRUE means we are parsing an anonymous function argument list.
+  bool looking_at_anon_fcn_args;
+
   // TRUE means we're parsing the return list for a function.
   bool looking_at_return_list;