changeset 18428:4d2e15abe5e7 stable

Disallow comments after continuation in double-quoted strings (bug #41415). * lex.ll (<DQ_STRING_START>(\.\.\.){S}*{NL}, <DQ_STRING_START>\\{S}+{NL}): Allow only whitespace to follow continuation markers.
author Stefan Mahr <dac922@gmx.de>
date Sat, 01 Feb 2014 00:16:17 +0100
parents 93c019f00e59
children 90568d7fe382
files libinterp/parse-tree/lex.ll
diffstat 1 files changed, 4 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/parse-tree/lex.ll	Mon Feb 03 11:45:03 2014 -0500
+++ b/libinterp/parse-tree/lex.ll	Sat Feb 01 00:16:17 2014 +0100
@@ -770,9 +770,8 @@
     curr_lexer->string_text += '\v';
   }
 
-<DQ_STRING_START>(\.\.\.){S}*{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}");
+<DQ_STRING_START>(\.\.\.){S}*{NL} {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>(\\.\\.\\.){S}*{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";
 
@@ -788,9 +787,8 @@
     HANDLE_STRING_CONTINUATION;
   }
 
-<DQ_STRING_START>\\{S}+{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}");
+<DQ_STRING_START>\\{S}+{NL} {
+    curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\{S}+{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";