comparison libinterp/parse-tree/lex.ll @ 18492:e4c319ed2414 stable

Fix regression, allow space-separated cell array of function handles (bug #41569) * lex.ll ("@"): Unput comma before function handle when after whitespace in an array context. * parser.tst: New test case.
author Mike Miller <mtmiller@ieee.org>
date Thu, 20 Feb 2014 09:24:59 -0500
parents 4d2e15abe5e7
children 3cac3d7f003f 04b4fb217b1a
comparison
equal deleted inserted replaced
18491:477b5916cafe 18492:e4c319ed2414
1097 } 1097 }
1098 } 1098 }
1099 } 1099 }
1100 1100
1101 "@" { 1101 "@" {
1102 curr_lexer->lexer_debug ("@");
1103
1102 if (curr_lexer->previous_token_may_be_command () 1104 if (curr_lexer->previous_token_may_be_command ()
1103 && curr_lexer->space_follows_previous_token ()) 1105 && curr_lexer->space_follows_previous_token ())
1104 { 1106 {
1105 yyless (0); 1107 yyless (0);
1106 curr_lexer->push_start_state (COMMAND_START); 1108 curr_lexer->push_start_state (COMMAND_START);
1107 } 1109 }
1108 else 1110 else
1109 { 1111 {
1110 curr_lexer->lexer_debug ("@"); 1112 int tok = curr_lexer->previous_token_value ();
1111 1113
1112 curr_lexer->current_input_column++; 1114 if (curr_lexer->whitespace_is_significant ()
1113 1115 && curr_lexer->space_follows_previous_token ()
1114 curr_lexer->looking_at_function_handle++; 1116 && ! (tok == '[' || tok == '{'
1115 curr_lexer->looking_for_object_index = false; 1117 || curr_lexer->previous_token_is_binop ()))
1116 curr_lexer->at_beginning_of_statement = false; 1118 {
1117 1119 yyless (0);
1118 return curr_lexer->count_token ('@'); 1120 unput (',');
1121 }
1122 else
1123 {
1124 curr_lexer->current_input_column++;
1125
1126 curr_lexer->looking_at_function_handle++;
1127 curr_lexer->looking_for_object_index = false;
1128 curr_lexer->at_beginning_of_statement = false;
1129
1130 return curr_lexer->count_token ('@');
1131 }
1119 } 1132 }
1120 } 1133 }
1121 1134
1122 %{ 1135 %{
1123 // A new line character. New line characters inside matrix constants 1136 // A new line character. New line characters inside matrix constants