From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs Subject: bug#5757: String literal parse problem in ruby-mode Date: Mon, 04 Apr 2011 09:53:45 -0400 Message-ID: References: <4FF8F6BA-1095-429E-A08E-42EC0CFE4B43@northwestern.edu> <139083.40321.qm@web28507.mail.ukl.yahoo.com> <87k4fcma4c.fsf_-_@stupidchicken.com> 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 1301926059 9039 80.91.229.12 (4 Apr 2011 14:07:39 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 4 Apr 2011 14:07:39 +0000 (UTC) Cc: =?UTF-8?Q?P=C3=A5l?= de Vibe , Nobuyoshi Nakada , 5757@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Apr 04 16:07:35 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1Q6kRK-0003cT-FD for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Apr 2011 16:07:34 +0200 Original-Received: from localhost ([127.0.0.1]:43409 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6kRI-0008Cp-O3 for geb-bug-gnu-emacs@m.gmane.org; Mon, 04 Apr 2011 10:07:32 -0400 Original-Received: from [140.186.70.92] (port=48114 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Q6kR4-0008Ax-14 for bug-gnu-emacs@gnu.org; Mon, 04 Apr 2011 10:07:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Q6kR1-00051p-OV for bug-gnu-emacs@gnu.org; Mon, 04 Apr 2011 10:07:17 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:59790) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Q6kR1-00051g-Ma for bug-gnu-emacs@gnu.org; Mon, 04 Apr 2011 10:07:15 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1Q6kED-00029T-OU; Mon, 04 Apr 2011 09:54:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 04 Apr 2011 13:54:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 5757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 5757-submit@debbugs.gnu.org id=B5757.13019252348258 (code B ref 5757); Mon, 04 Apr 2011 13:54:01 +0000 Original-Received: (at 5757) by debbugs.gnu.org; 4 Apr 2011 13:53:54 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6kE6-000299-Bh for submit@debbugs.gnu.org; Mon, 04 Apr 2011 09:53:54 -0400 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.181] helo=ironport2-out.pppoe.ca) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Q6kE3-00028s-Op for 5757@debbugs.gnu.org; Mon, 04 Apr 2011 09:53:52 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAB/NmU1Ld/Y6/2dsb2JhbAClXniIebcGhWsElC+CEA X-IronPort-AV: E=Sophos;i="4.63,297,1299474000"; d="scan'208";a="103071395" Original-Received: from 75-119-246-58.dsl.teksavvy.com (HELO pastel.home) ([75.119.246.58]) by ironport2-out.pppoe.ca with ESMTP/TLS/ADH-AES256-SHA; 04 Apr 2011 09:53:46 -0400 Original-Received: by pastel.home (Postfix, from userid 20848) id A553658DF1; Mon, 4 Apr 2011 09:53:45 -0400 (EDT) In-Reply-To: <87k4fcma4c.fsf_-_@stupidchicken.com> (Chong Yidong's message of "Sat, 02 Apr 2011 20:50:11 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Mon, 04 Apr 2011 09:54:01 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:45617 Archived-At: > Could you help review P=E5l de Vibe's proposed fix to the following > problem in Emacs ruby-mode? Thanks. His proposed fix is not correct: in ruby (like in Elisp) ? is used for chars (including ?' and ?") and $' and $" are also special vars, so his fix just disables the special treatment of ?. For Emacs-24, we use a different chunk of code which doesn't suffer from this problem (mostly calling syntax-ppss to determine if we're inside a string). Stefan > P=E5l de Vibe writes: >>> ruby-mode will misunderstand a ruby double-quoted string literal which >>> contains a single quote and ends with a question mark. It thinks that >>> the string literal is unterminated, which contaminates the syntax >>> highlighting for the remainder of the buffer. >>>=20 >>> Example ruby code which will demonstrate the problem: >>>=20 >>> ["Is 'this' a string?"], [:something, :else] >>>=20 >>> If there's anything between the question mark and the terminating >>> double-quote, the string will be correctly interpreted. >>=20 >> Line 1185: >> ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[?$]\\([#\"'`]\\)" 3 (1 . nil)) >>=20 >> A workaround (with, to me, uknown consequences) is to remove the >> question mark from the line, like this: >>=20 >> ("\\(^\\|[^\\\\]\\)\\(\\\\\\\\\\)*[$]\\([#\"'`]\\)" 3 (1 . nil))