# HG changeset patch # User John W. Eaton # Date 1363727182 14400 # Node ID 06aa4c0f2018ee747d915c5c9ba475ab9713b911 # Parent 100a7bd2590e0a429f4381a285ff5f0bf17a8272 handle foo @... as command syntax * lex.ll ("@"): Check for possible command. diff --git a/libinterp/parse-tree/lex.ll b/libinterp/parse-tree/lex.ll --- a/libinterp/parse-tree/lex.ll +++ b/libinterp/parse-tree/lex.ll @@ -706,15 +706,24 @@ } "@" { - curr_lexer->lexer_debug ("@"); - - curr_lexer->current_input_column++; - - curr_lexer->looking_at_function_handle++; - curr_lexer->looking_for_object_index = false; - curr_lexer->at_beginning_of_statement = false; - - return curr_lexer->count_token ('@'); + if (curr_lexer->previous_token_may_be_command () + && curr_lexer->space_follows_previous_token ()) + { + yyless (0); + curr_lexer->push_start_state (COMMAND_START); + } + else + { + curr_lexer->lexer_debug ("@"); + + curr_lexer->current_input_column++; + + curr_lexer->looking_at_function_handle++; + curr_lexer->looking_for_object_index = false; + curr_lexer->at_beginning_of_statement = false; + + return curr_lexer->count_token ('@'); + } } %{