Mercurial > octave-nkf
comparison libinterp/parse-tree/lex.ll @ 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 | f59459404f55 |
children | 888cd8f62c67 e4c319ed2414 |
comparison
equal
deleted
inserted
replaced
18427:93c019f00e59 | 18428:4d2e15abe5e7 |
---|---|
768 | 768 |
769 curr_lexer->current_input_column += yyleng; | 769 curr_lexer->current_input_column += yyleng; |
770 curr_lexer->string_text += '\v'; | 770 curr_lexer->string_text += '\v'; |
771 } | 771 } |
772 | 772 |
773 <DQ_STRING_START>(\.\.\.){S}*{NL} | | 773 <DQ_STRING_START>(\.\.\.){S}*{NL} { |
774 <DQ_STRING_START>(\.\.\.){S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} { | 774 curr_lexer->lexer_debug ("<DQ_STRING_START>(\\.\\.\\.){S}*{NL}"); |
775 curr_lexer->lexer_debug ("<DQ_STRING_START>(\\.\\.\\.){S}*{NL}|<DQ_STRING_START>(\\.\\.\\.){S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}"); | |
776 | 775 |
777 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"; | 776 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"; |
778 | 777 |
779 std::string nm = curr_lexer->fcn_file_full_name; | 778 std::string nm = curr_lexer->fcn_file_full_name; |
780 | 779 |
786 curr_lexer->input_line_number, nm.c_str ()); | 785 curr_lexer->input_line_number, nm.c_str ()); |
787 | 786 |
788 HANDLE_STRING_CONTINUATION; | 787 HANDLE_STRING_CONTINUATION; |
789 } | 788 } |
790 | 789 |
791 <DQ_STRING_START>\\{S}+{NL} | | 790 <DQ_STRING_START>\\{S}+{NL} { |
792 <DQ_STRING_START>\\{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} { | 791 curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\{S}+{NL}"); |
793 curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\{S}+{NL}|<DQ_STRING_START>\\\\{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}"); | |
794 | 792 |
795 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"; | 793 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"; |
796 | 794 |
797 std::string nm = curr_lexer->fcn_file_full_name; | 795 std::string nm = curr_lexer->fcn_file_full_name; |
798 | 796 |