GNU bug report logs - #20026
[PATCH] 24.4; regexp parse miss in ruby-mode

Previous Next

Package: emacs;

Reported by: Nobuyoshi Nakada <nobu <at> ruby-lang.org>

Date: Sat, 7 Mar 2015 01:39:02 UTC

Severity: normal

Tags: patch

Fixed in versions 25.1, 24.5

Done: Dmitry Gutov <dgutov <at> yandex.ru>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 20026 in the body.
You can then email your comments to 20026 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#20026; Package emacs. (Sat, 07 Mar 2015 01:39:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Nobuyoshi Nakada <nobu <at> ruby-lang.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 07 Mar 2015 01:39:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Nobuyoshi Nakada <nobu <at> ruby-lang.org>
To: bug-gnu-emacs <at> gnu.org
Subject: [PATCH] 24.4; regexp parse miss in ruby-mode
Date: Sat, 07 Mar 2015 10:35:36 +0900
ruby-mode misses a regexp just after an open brace ('{') or a vertical
bar ('|').  As the result, `forward-sexp` and regexp highlighting do not
work expectedly (or as a ruby interpreter interprets).

ex.

  tap { /'/ }

This "/'/" should be parsed as an regexp matches a single quote, but the
first operator is parsed as a division operator and the succeeding
single quote is parsed as a beginning of a string.

Same for `{|x| /'/}`.


--- lisp/progmodes/ruby-mode.el	2014-07-06 05:02:55.000000000 +0900
+++ lisp/progmodes/ruby-mode.el	2015-03-06 21:09:46.000000000 +0900
@@ -1777,7 +1777,7 @@
   (defvar ruby-syntax-before-regexp-re
     (concat
      ;; Special tokens that can't be followed by a division operator.
-     "\\(^\\|[[=(,~;<>]"
+     "\\(^\\|[[{|=(,~;<>]"
      ;; Distinguish ternary operator tokens.
      ;; FIXME: They don't really have to be separated with spaces.
      "\\|[?:] "


In GNU Emacs 24.4.1 (x86_64-apple-darwin14.0.0, NS apple-appkit-1343.16)
 of 2014-12-24 on tenten-slave.macports.org
Windowing system distributor `Apple', version 10.3.1344
Configured using:
 `configure --prefix=/opt/local --with-ns --without-x --without-dbus
 CC=/usr/bin/clang 'CFLAGS=-pipe -Os -arch x86_64'
 'LDFLAGS=-L/opt/local/lib -Wl,-headerpad_max_install_names -arch
 x86_64' CPPFLAGS=-I/opt/local/include'

Important settings:
  locale-coding-system: utf-8-hfs

Major mode: Ruby




Reply sent to Dmitry Gutov <dgutov <at> yandex.ru>:
You have taken responsibility. (Sun, 08 Mar 2015 19:01:03 GMT) Full text and rfc822 format available.

Notification sent to Nobuyoshi Nakada <nobu <at> ruby-lang.org>:
bug acknowledged by developer. (Sun, 08 Mar 2015 19:01:03 GMT) Full text and rfc822 format available.

Message #10 received at 20026-done <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Nobuyoshi Nakada <nobu <at> ruby-lang.org>, 20026-done <at> debbugs.gnu.org
Subject: Re: bug#20026: [PATCH] 24.4; regexp parse miss in ruby-mode
Date: Sun, 08 Mar 2015 21:00:22 +0200
Version: 25.1

On 03/07/2015 03:35 AM, Nobuyoshi Nakada wrote:
> ruby-mode misses a regexp just after an open brace ('{') or a vertical
> bar ('|').  As the result, `forward-sexp` and regexp highlighting do not
> work expectedly (or as a ruby interpreter interprets).

Pushed to master. Thanks.




bug marked as fixed in version 24.5, send any further explanations to 20026 <at> debbugs.gnu.org and Nobuyoshi Nakada <nobu <at> ruby-lang.org> Request was from Dmitry Gutov <dgutov <at> yandex.ru> to control <at> debbugs.gnu.org. (Fri, 20 Mar 2015 04:15:04 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#20026; Package emacs. (Fri, 20 Mar 2015 04:19:02 GMT) Full text and rfc822 format available.

Message #15 received at 20026 <at> debbugs.gnu.org (full text, mbox):

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: 19285 <at> debbugs.gnu.org, 17733 <at> debbugs.gnu.org,
 20026 <at> debbugs.gnu.org
Subject: Backported
Date: Fri, 20 Mar 2015 06:18:24 +0200
Also backported to emacs-24 (upcoming 24.5).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Fri, 17 Apr 2015 11:24:04 GMT) Full text and rfc822 format available.

This bug report was last modified 10 years and 70 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.