Mercurial > octave
changeset 31472:2ad979f8c265
maint: Remove deprecated line continuation code.
* NEWS.9.md: Announce removal of items deprecated in Octave 7.
* lex.ll: Remove patterns for deprecated line continuations. The function
warn_deprecated_syntax() was left in case the need for it arises again in
the future.
* line-continue.tst: Remove tests for deprecated line continuations.
author | Rik <rik@octave.org> |
---|---|
date | Thu, 17 Nov 2022 14:48:19 -0800 |
parents | da260fea6953 |
children | d6fd7833f861 |
files | etc/NEWS.9.md libinterp/parse-tree/lex.ll test/line-continue.tst |
diffstat | 3 files changed, 12 insertions(+), 61 deletions(-) [+] |
line wrap: on
line diff
--- a/etc/NEWS.9.md Thu Nov 17 14:12:57 2022 -0800 +++ b/etc/NEWS.9.md Thu Nov 17 14:48:19 2022 -0800 @@ -54,6 +54,18 @@ .** | .^ .**= | .^= +- Interpreter + + * The use of `'...'` for line continuations *inside* double-quoted + strings has been removed. Use `'\'` for line continuations inside strings + instead. + + * The use of `'\'` as a line continuation *outside* of double-quoted + strings has been removed. Use `'...'` for line continuations instead. + + * Support for trailing whitespace after a `'\'` line continuation has been + removed. Delete unnecessary trailing whitespace. + - For plot functions, the use of numbers to select line colors in shorthand formats was an undocumented feature was removed from Octave 9.
--- a/libinterp/parse-tree/lex.ll Thu Nov 17 14:12:57 2022 -0800 +++ b/libinterp/parse-tree/lex.ll Thu Nov 17 14:48:19 2022 -0800 @@ -1066,28 +1066,6 @@ curr_lexer->m_string_text += '\v'; } -<DQ_STRING_START>(\.\.\.){S}*{NL} { - curr_lexer->lexer_debug ("<DQ_STRING_START>(\\.\\.\\.){S}*{NL}"); - - /* FIXME: Remove support for '...' continuation in Octave 9 */ - static const char *msg = "'...' continuations in double-quoted character strings were deprecated in version 7 and will not be allowed in a future version of Octave; please use '\\' instead"; - - curr_lexer->warn_deprecated_syntax (msg); - - HANDLE_STRING_CONTINUATION; - } - -<DQ_STRING_START>\\{S}+{NL} { - curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\{S}+{NL}"); - - /* FIXME: Remove support for WS after line continuation in Octave 9 */ - static const char *msg = "whitespace after continuation markers in double-quoted character strings were deprecated in version 7 and will not be allowed in a future version of Octave"; - - curr_lexer->warn_deprecated_syntax (msg); - - HANDLE_STRING_CONTINUATION; - } - <DQ_STRING_START>\\{NL} { curr_lexer->lexer_debug ("<DQ_STRING_START>\\\\{NL}"); @@ -1280,17 +1258,6 @@ // Deprecated C preprocessor style continuation markers. %} -\\{S}*{NL} | -\\{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL} { - curr_lexer->lexer_debug ("\\\\{S}*{NL}|\\\\{S}*{CCHAR}{ANY_EXCEPT_NL}*{NL}"); - - /* FIXME: Remove support for '\\' line continuation in Octave 9 */ - static const char *msg = "using continuation marker \\ outside of double quoted strings was deprecated in version 7 and will be removed from a future version of Octave, use ... instead"; - - curr_lexer->warn_deprecated_syntax (msg); - - curr_lexer->handle_continuation (); - } %{ // End of file.
--- a/test/line-continue.tst Thu Nov 17 14:12:57 2022 -0800 +++ b/test/line-continue.tst Thu Nov 17 14:48:19 2022 -0800 @@ -33,34 +33,6 @@ %! b]; %! assert (y, x); -## FIXME: Next 3 tests use '\' continuation outside of a double-quoted string -## This behavior is deprecated and will be removed at some point. -## When it does these -%!test -%! x = [1;2]; -%! y = [a... # comments here ok -%! ;\ -%! -%! b]; -%! assert (y, x); - -%!assert (1 + ... -%! 2 - \# comments here ok -%! 3 / ... # comments here ok -%! -1,6); - -%!function y = f (a,... -%! b, ... -%! c, ... % comments ok -%! x, # continuation characters not required in parens -%! y, \# but they should work too. -%! z) -%! -%! y = 1; -%!endfunction -%! -%!assert (f (), 1) - ## String continuation using '\' %!assert (["abc\ %! def"], "abc def")