comparison libinterp/parse-tree/lex.ll @ 17247:e993fa124b46

Deprecate \ as continuation marker outside of double-quoted character strings. * lex.ll: Issue deprecated-syntax warning about \ used as a continuation marker outside of double-quoted character strings. * NEWS: Note that \ is deprecated as a continuation marker outside of double-quoted character strings.
author John W. Eaton <jwe@octave.org>
date Wed, 14 Aug 2013 12:33:15 -0400
parents 8be8a65d3ca8
children 6470a113eae2
comparison
equal deleted inserted replaced
17246:8be8a65d3ca8 17247:e993fa124b46
958 958
959 curr_lexer->mark_previous_token_trailing_space (); 959 curr_lexer->mark_previous_token_trailing_space ();
960 } 960 }
961 961
962 %{ 962 %{
963 // Continuation lines. Allow comments after continuations. 963 // Continuation lines. Allow arbitrary text after continuations.
964 %} 964 %}
965 965
966 \.\.\..*{NL} {
967 curr_lexer->lexer_debug ("\\.\\.\\..*{NL}");
968
969 curr_lexer->handle_continuation ();
970 }
971
972 %{
973 // Deprecated C preprocessor style continuation markers.
974 %}
975
966 \\{S}*{NL} | 976 \\{S}*{NL} |
967 \\{S}*{CCHAR}.*{NL} | 977 \\{S}*{CCHAR}.*{NL} {
968 \.\.\..*{NL} { 978 curr_lexer->lexer_debug ("\\\\{S}*{NL}|\\\\{S}*{CCHAR}.*{NL}");
969 curr_lexer->lexer_debug ("\\.\\.\\..*{NL}|\\\\{S}*{NL}|\\\\{S}*{CCHAR}.*{NL}"); 979
970 980 static const char *msg = "using continuation marker \\ outside of double quoted strings is deprecated and will be removed in a future version of Octave";
971 curr_lexer->handle_continuation (); 981
982 std::string nm = curr_lexer->fcn_file_full_name;
983
984 if (nm.empty ())
985 warning_with_id ("Octave:deprecated-syntax", "%s", msg);
986 else
987 warning_with_id ("Octave:deprecated-syntax",
988 "%s; near line %d of file '%s'", msg,
989 curr_lexer->input_line_number, nm.c_str ());
972 } 990 }
973 991
974 %{ 992 %{
975 // End of file. 993 // End of file.
976 %} 994 %}