From: "John W. Eaton" <jwe@octave.org>
To: Stefan Monnier <monnier@IRO.UMontreal.CA>
Cc: "John W. Eaton" <jwe@octave.org>,
Kurt Hornik <Kurt.Hornik@wu-wien.ac.at>,
Jordi Gutiérrez Hermoso <jordigh@gmail.com>,
Daniel Colascione <daniel@censorshipresearch.org>,
Emacs development discussions <emacs-devel@gnu.org>
Subject: Re: [PATCH] let octave-mode understand single-quoted strings
Date: Tue, 5 Oct 2010 04:28:15 -0400 [thread overview]
Message-ID: <19626.57759.799627.189216@segfault.lan> (raw)
In-Reply-To: <jwv62yn3zh9.fsf-monnier+emacs@gnu.org>
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
next prev parent reply other threads:[~2010-10-05 8:28 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-30 21:19 [PATCH] let octave-mode understand single-quoted strings Daniel Colascione
2010-08-31 12:32 ` Stefan Monnier
2010-08-31 21:15 ` Jordi Gutiérrez Hermoso
2010-09-01 6:46 ` Stefan Monnier
2010-09-02 14:07 ` Jordi Gutiérrez Hermoso
2010-09-02 16:24 ` Stefan Monnier
2010-09-02 23:46 ` Jordi Gutiérrez Hermoso
2010-09-03 10:48 ` Stefan Monnier
2010-10-05 8:28 ` John W. Eaton [this message]
2010-10-05 23:57 ` Eric M. Ludlam
2010-10-07 8:41 ` Stefan Monnier
2011-10-04 15:13 ` Jordi Gutiérrez Hermoso
2011-10-04 17:40 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=19626.57759.799627.189216@segfault.lan \
--to=jwe@octave.org \
--cc=Kurt.Hornik@wu-wien.ac.at \
--cc=daniel@censorshipresearch.org \
--cc=emacs-devel@gnu.org \
--cc=jordigh@gmail.com \
--cc=monnier@IRO.UMontreal.CA \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.