Mercurial > hg > octave-nkf
changeset 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 |
parents | c130939b0d1c |
children | c14ce8995a69 |
files | libinterp/parse-tree/lex.ll |
diffstat | 1 files changed, 13 insertions(+), 4 deletions(-) [+] |
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 ('.'); + } } %{