From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "John W. Eaton" Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] let octave-mode understand single-quoted strings Date: Tue, 5 Oct 2010 04:28:15 -0400 Message-ID: <19626.57759.799627.189216@segfault.lan> References: <4C02D67D.5090302@censorshipresearch.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1286288121 12133 80.91.229.12 (5 Oct 2010 14:15:21 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 5 Oct 2010 14:15:21 +0000 (UTC) Cc: "John W. Eaton" , Kurt Hornik , Jordi GutiƩrrez Hermoso , Daniel Colascione , Emacs development discussions To: Stefan Monnier Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Oct 05 16:15:19 2010 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1P38IX-0002vh-IZ for ged-emacs-devel@m.gmane.org; Tue, 05 Oct 2010 16:15:17 +0200 Original-Received: from localhost ([127.0.0.1]:41736 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P38IW-0000Sz-Sm for ged-emacs-devel@m.gmane.org; Tue, 05 Oct 2010 10:15:16 -0400 Original-Received: from [140.186.70.92] (port=45630 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P33A0-0007TD-PX for emacs-devel@gnu.org; Tue, 05 Oct 2010 04:46:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P32ss-0000Ks-JJ for emacs-devel@gnu.org; Tue, 05 Oct 2010 04:28:27 -0400 Original-Received: from caibbdcaaaaf.dreamhost.com ([208.113.200.5]:58643 helo=spaceymail-a6.g.dreamhost.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P32ss-0000K6-Cm for emacs-devel@gnu.org; Tue, 05 Oct 2010 04:28:26 -0400 Original-Received: from segfault (cpe-24-166-38-4.neo.res.rr.com [24.166.38.4]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by spaceymail-a6.g.dreamhost.com (Postfix) with ESMTP id 05BADCA827; Tue, 5 Oct 2010 01:28:16 -0700 (PDT) In-Reply-To: X-Mailer: VM 8.1.0 under 23.2.1 (x86_64-pc-linux-gnu) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 1) X-Mailman-Approved-At: Tue, 05 Oct 2010 10:11:45 -0400 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:131366 Archived-At: 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. =A0I.e. it ca= me "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-q= uote | 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 ( .. )' =3D> tranpose expression [ .. ]' =3D> tranpose matrix expression { .. }' =3D> 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"' =3D> transpose the character array 'string' 'string' ' =3D> transpose the character array 'string' 'string'' =3D> unterminated string constant 'a''b' =3D> 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 ' =3D> unterminated string constant (pwd)' =3D> transpose the output from the pwd function dir 'foo' =3D> list contents of the directory foo * Follows an expression that references a structure element: a.b' =3D> 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