Mercurial > hg > octave-avbm
diff libinterp/parse-tree/lex.ll @ 16325:fc565603ccbb
also accept "." as possibly beginning a command
* lex.ll ("."): If it looks like a command, parse it like one.
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sat, 16 Mar 2013 04:43:30 -0400 (2013-03-16) |
parents | 09f0cb9cac7d |
children | 06aa4c0f2018 |
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.ll +++ b/libinterp/parse-tree/lex.ll @@ -1025,10 +1025,19 @@ "." { curr_lexer->lexer_debug ("."); - curr_lexer->looking_for_object_index = false; - curr_lexer->at_beginning_of_statement = false; - - return curr_lexer->handle_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->looking_for_object_index = false; + curr_lexer->at_beginning_of_statement = false; + + return curr_lexer->handle_token ('.'); + } } %{