From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.devel Subject: Re: Musings: Supposed places of safety, guaranteed by parse-partial-sexp are not safe. Date: Mon, 5 Dec 2011 11:25:49 +0000 Message-ID: <20111205112549.GA3522@acm.acm> References: <20111203232301.GD4566@acm.acm> <4EDB4E50.1060202@gmx.at> <4EDBA888.2060202@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1323084709 8528 80.91.229.12 (5 Dec 2011 11:31:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 5 Dec 2011 11:31:49 +0000 (UTC) Cc: Stefan Monnier , emacs-devel@gnu.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 05 12:31:45 2011 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RXWls-0007H1-RF for ged-emacs-devel@m.gmane.org; Mon, 05 Dec 2011 12:31:45 +0100 Original-Received: from localhost ([::1]:55276 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXWlr-0007Ir-Pl for ged-emacs-devel@m.gmane.org; Mon, 05 Dec 2011 06:31:43 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:45257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXWlp-0007Il-Bj for emacs-devel@gnu.org; Mon, 05 Dec 2011 06:31:42 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RXWlo-00060V-5R for emacs-devel@gnu.org; Mon, 05 Dec 2011 06:31:41 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:64392 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RXWln-00060D-MX for emacs-devel@gnu.org; Mon, 05 Dec 2011 06:31:40 -0500 Original-Received: (qmail 38616 invoked by uid 3782); 5 Dec 2011 11:31:38 -0000 Original-Received: from acm.muc.de (pD951B511.dip.t-dialin.net [217.81.181.17]) by colin.muc.de (tmda-ofmipd) with ESMTP; Mon, 05 Dec 2011 12:31:35 +0100 Original-Received: (qmail 3635 invoked by uid 1000); 5 Dec 2011 11:25:49 -0000 Content-Disposition: inline In-Reply-To: <4EDBA888.2060202@gmx.at> User-Agent: Mutt/1.5.21 (2010-09-15) X-Delivery-Agent: TMDA/1.1.12 (Macallan) X-Primary-Address: acm@muc.de X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 193.149.48.1 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:146488 Archived-At: Hello, Martin. On Sun, Dec 04, 2011 at 06:06:16PM +0100, martin rudalics wrote: > >> If you change (nth 5 ppss) you would still have to say that (nth 4 ppss) > >> is unreliable in this special case. > > Not if (nth 5 ppss) says that the buffer position is the one *after* the > > "/*" sequence. Of course for "*/" we'd conversely want to use the state > > *before* "*/". > What I meant was that the caller would have to care about (nth 5 ppss) > too, wherever she now looked only at (nth 3 ppss) and (nth 4 ppss). If > we say that a comment is everything in between and including both > delimiters she won't have to care about (nth 5 ppss) in the first place. The parse-partial scanner works strictly left to right. If (nth 5 ppss) records the left hand bit of "/*", we are not yet in a comment. We're probably about to do a division. Similarly, after * of "*/", we're still in the comment, probably just passed a comment prefix. Admittedly CC Mode records the entire comment, including /* and */. > Admittedly, it's not entirely trivial to implement. But the fact that > between "/" and "*" we are not in a comment whilst between "*" and "/" > we are doesn't strike me as very intuitive. I disagree. I think keeping the stricly L to R invariant of the parse is critically important (but don't ask me why :-). > martin -- Alan Mackenzie (Nuremberg, Germany).