# HG changeset patch # User Stefan Mahr # Date 1376321814 -7200 # Node ID 8be8a65d3ca897e9efbb18834b6e3b4f348c01de # Parent 7babcdb9bc131835e9d61800bab93ca8252bde38 Ignore anything after the continuation marker '...' (bug #38653) * lex.ll: Ignore any text following '...' line continuation marker. * line-continue.tst: New test. diff -r 7babcdb9bc13 -r 8be8a65d3ca8 libinterp/parse-tree/lex.ll --- 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 (); } diff -r 7babcdb9bc13 -r 8be8a65d3ca8 test/line-continue.tst --- 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);