changeset 17246:8be8a65d3ca8

Ignore anything after the continuation marker '...' (bug #38653) * lex.ll: Ignore any text following '...' line continuation marker. * line-continue.tst: New test.
author Stefan Mahr <dac922@gmx.de>
date Mon, 12 Aug 2013 17:36:54 +0200
parents 7babcdb9bc13
children e993fa124b46
files libinterp/parse-tree/lex.ll test/line-continue.tst
diffstat 2 files changed, 9 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.ll	Mon Aug 12 17:36:54 2013 +0200
+++ b/libinterp/parse-tree/lex.ll	Mon Aug 12 17:36:54 2013 +0200
@@ -250,7 +250,6 @@
 D       [0-9]
 S       [ \t]
 NL      ((\n)|(\r)|(\r\n))
-CONT    ((\.\.\.)|(\\))
 Im      [iIjJ]
 CCHAR   [#%]
 IDENT   ([_$a-zA-Z][_$a-zA-Z0-9]*)
@@ -964,9 +963,10 @@
 // Continuation lines.  Allow comments after continuations.
 %}
 
-{CONT}{S}*{NL} |
-{CONT}{S}*{CCHAR}.*{NL} {
-    curr_lexer->lexer_debug ("{CONT}{S}*{NL}|{CONT}{S}*{CCHAR}.*{NL}");
+\\{S}*{NL} |
+\\{S}*{CCHAR}.*{NL} |
+\.\.\..*{NL} {
+    curr_lexer->lexer_debug ("\\.\\.\\..*{NL}|\\\\{S}*{NL}|\\\\{S}*{CCHAR}.*{NL}");
 
     curr_lexer->handle_continuation ();
   }
--- a/test/line-continue.tst	Mon Aug 12 17:36:54 2013 +0200
+++ b/test/line-continue.tst	Mon Aug 12 17:36:54 2013 +0200
@@ -77,3 +77,8 @@
 %! y = [1,2];
 %! assert  (y, x);
 
+%!test
+%! x = [ 1 , ...anything after the ... is ignored
+%! 2];
+%! y = [1,2];
+%! assert  (y, x);