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
parents 09f0cb9cac7d
children 06aa4c0f2018
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.ll	Sat Mar 16 09:22:11 2013 +0100
+++ b/libinterp/parse-tree/lex.ll	Sat Mar 16 04:43:30 2013 -0400
@@ -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 ('.');
+      }
   }
 
 %{