On 3-Sep-2010, Stefan Monnier wrote:
|>> I just implemented the single-quote string support based
|>> on code I previously wrote for perl-mode, where it's used for
|>> string-like thingies that often span multiple lines. I.e. it came "for
|>> free".
In Octave and Matlab, character strings can't span multiple lines.
| BTW, where can I find a definition of the syntax of single-quoted
| strings (i.e. how does Octave distinguish a transpose from a single-quote
| starting a string)?
| The Octave docs I have don't say anything about it, AFAICT.
It's messy.
A single-quote character is recognized as a transpose operator if it
* Follows a ), ], or } character
( .. )' => tranpose expression
[ .. ]' => tranpose matrix expression
{ .. }' => tranpose cell array expression
* Follows a literal double-quoted string, or a literal single-quoted
string if there is a space between the transpose operator and the
final single-quote character that delimits the string. For example
"string"' => transpose the character array 'string'
'string' ' => transpose the character array 'string'
'string'' => unterminated string constant
'a''b' => 1x3 character array containing the characters a'b
* Follows an identifier (variable or function name) unless the
identifier could be a "command". For example
pwd ' => unterminated string constant
(pwd)' => transpose the output from the pwd function
dir 'foo' => list contents of the directory foo
* Follows an expression that references a structure element:
a.b' => return the transpose of a.b
The Octave manual has a more complete description of how
"command-style" parsing works (yes, this is ugly; it was implemented
because it is required for compatibility with Matlab).
Does that help?
jwe