From: Nobuyoshi Nakada <nobu@ruby-lang.org>
To: 20026@debbugs.gnu.org
Subject: bug#20026: [PATCH] 24.4; regexp parse miss in ruby-mode
Date: Sat, 07 Mar 2015 10:35:36 +0900 [thread overview]
Message-ID: <54FA55E8.9090609@ruby-lang.org> (raw)
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
next reply other threads:[~2015-03-07 1:35 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-07 1:35 Nobuyoshi Nakada [this message]
2015-03-08 19:00 ` bug#20026: [PATCH] 24.4; regexp parse miss in ruby-mode Dmitry Gutov
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=54FA55E8.9090609@ruby-lang.org \
--to=nobu@ruby-lang.org \
--cc=20026@debbugs.gnu.org \
/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.