diff libinterp/parse-tree/lex.ll @ 18312:7ac2a8b758fc gui-release

maint: Periodic merge of stable to gui-release.
author John W. Eaton <jwe@octave.org>
date Mon, 20 Jan 2014 01:39:38 -0500
parents 043ce3787849 b14cdae65abd
children 9d62b5f041ee 1ecfcfa4858e
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.ll	Sun Jan 19 17:25:35 2014 +0100
+++ b/libinterp/parse-tree/lex.ll	Mon Jan 20 01:39:38 2014 -0500
@@ -277,6 +277,7 @@
 EXPON   ([DdEe][+-]?{D}+)
 NUMBER  (({D}+\.?{D}*{EXPON}?)|(\.{D}+{EXPON}?)|(0[xX][0-9a-fA-F]+))
 
+ANY_EXCEPT_NL [^\r\n]
 ANY_INCLUDING_NL (.|{NL})
 
 %%
@@ -309,8 +310,8 @@
 // If an argument is in construction, it is completed.
 %}
 
-<COMMAND_START>(\.\.\.)[^\r\n]*{NL} {
-    curr_lexer->lexer_debug ("<COMMAND_START>(\\.\\.\\.)[^\\r\\n]*{NL}");
+<COMMAND_START>(\.\.\.){ANY_EXCEPT_NL}*{NL} {
+    curr_lexer->lexer_debug ("<COMMAND_START>(\\.\\.\\.){ANY_EXCEPT_NL}*{NL}");
 
     COMMAND_ARG_FINISH;
 
@@ -324,8 +325,8 @@
 // Commands normally end at the end of a line or a semicolon.
 %}
 
-<COMMAND_START>({CCHAR}[^\r\n]*)?{NL} {
-    curr_lexer->lexer_debug ("<COMMAND_START>({CCHAR}[^\\r\\n])?{NL}");
+<COMMAND_START>({CCHAR}{ANY_EXCEPT_NL}*)?{NL} {
+    curr_lexer->lexer_debug ("<COMMAND_START>({CCHAR}{ANY_EXCEPT_NL}*)?{NL}");
 
     COMMAND_ARG_FINISH;
 
@@ -633,8 +634,8 @@
 // Body of a block comment.
 %}
 
-<BLOCK_COMMENT_START>.*{NL} {
-    curr_lexer->lexer_debug ("<BLOCK_COMMENT_START>.*{NL}");
+<BLOCK_COMMENT_START>{ANY_EXCEPT_NL}*{NL} {
+    curr_lexer->lexer_debug ("<BLOCK_COMMENT_START>{ANY_EXCEPT_NL}*{NL}");
 
     curr_lexer->input_line_number++;
     curr_lexer->current_input_column = 1;
@@ -645,15 +646,15 @@
 // Full-line or end-of-line comment.
 %}
 
-{S}*{CCHAR}.*{NL} {
-    curr_lexer->lexer_debug ("{S}*{CCHAR}.*{NL}");
+{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} {
+    curr_lexer->lexer_debug ("{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}");
 
     curr_lexer->push_start_state (LINE_COMMENT_START);
     yyless (0);
   }
 
-<LINE_COMMENT_START>{S}*{CCHAR}.*{NL} {
-    curr_lexer->lexer_debug ("<LINE_COMMENT_START>{S}*{CCHAR}.*{NL}");
+<LINE_COMMENT_START>{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} {
+    curr_lexer->lexer_debug ("<LINE_COMMENT_START>{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}");
 
     bool full_line_comment = curr_lexer->current_input_column == 1;
     curr_lexer->input_line_number++;
@@ -869,8 +870,8 @@
   }
 
 <DQ_STRING_START>(\.\.\.){S}*{NL} |
-<DQ_STRING_START>(\.\.\.){S}*{CCHAR}.*{NL} {
-    curr_lexer->lexer_debug ("<DQ_STRING_START>(\\.\\.\\.){S}*{NL}|<DQ_STRING_START>(\\.\\.\\.){S}*{CCHAR}.*{NL}");
+<DQ_STRING_START>(\.\.\.){S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>(\\.\\.\\.){S}*{NL}|<DQ_STRING_START>(\\.\\.\\.){S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}");
 
     static const char *msg = "'...' continuations in double-quoted character strings are obsolete and will not be allowed in a future version of Octave; please use '\\' instead";
 
@@ -887,8 +888,8 @@
   }
 
 <DQ_STRING_START>\\{S}+{NL} |
-<DQ_STRING_START>\\{S}*{CCHAR}.*{NL} {
-    curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\{S}+{NL}|<DQ_STRING_START>\\\\{S}*{CCHAR}.*{NL}");
+<DQ_STRING_START>\\{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\{S}+{NL}|<DQ_STRING_START>\\\\{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}");
 
     static const char *msg = "white space and comments after continuation markers in double-quoted character strings are obsolete and will not be allowed in a future version of Octave";
 
@@ -1077,8 +1078,8 @@
 // Continuation lines.  Allow arbitrary text after continuations.
 %}
 
-\.\.\..*{NL} {
-    curr_lexer->lexer_debug ("\\.\\.\\..*{NL}");
+\.\.\.{ANY_EXCEPT_NL}*{NL} {
+    curr_lexer->lexer_debug ("\\.\\.\\.{ANY_EXCEPT_NL}*{NL}");
 
     curr_lexer->handle_continuation ();
   }
@@ -1088,8 +1089,8 @@
 %}
 
 \\{S}*{NL} |
-\\{S}*{CCHAR}.*{NL} {
-    curr_lexer->lexer_debug ("\\\\{S}*{NL}|\\\\{S}*{CCHAR}.*{NL}");
+\\{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} {
+    curr_lexer->lexer_debug ("\\\\{S}*{NL}|\\\\{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}");
 
     static const char *msg = "using continuation marker \\ outside of double quoted strings is deprecated and will be removed in a future version of Octave";