Matlab does not support line continuations in either single-quoted character vectors or double-quoted strings. Is there a reason to enforce this in Octave, or can we diverge?
The current situation is quite mixed.
-
single-quoted strings
No line continuations work.
x = 'abc \
def' # fails
x = 'abc ...
def' # fails
-
double-quoted strings
One line continuation just works, the other works but with a warning.
x = "abc \
def" # works
x = "abc ...
def" # works with warning
warning: '...' continuations in double-quoted character strings are obsolete and will not be allowed in a future version of Octave; please use '\' instead
There seems to be several decisions to be made.
- Do we want to extend line continuations to single-quoted strings as an Octave extension?
- When do we want to deprecate and remove support for ‘…’ as a line continuation in double-quoted strings? There really can’t be many people using this so maybe for the 7.1 release?
- The syntax highlighter in the Octave Editor (Qscintilla) and here on Discourse incorrectly assume that line continuations work in single-quoted strings. If the answer to question #1 is “No”, we need to update the syntax grammar to not highlight the second line as a string, or better would be to highlight as an error.