GNU bug report logs -
#15874
24.3.50; exit! not properly font-locked in ruby-mode
Previous Next
Reported by: Bozhidar Batsov <bozhidar <at> batsov.com>
Date: Tue, 12 Nov 2013 12:40:01 UTC
Severity: minor
Found in version 24.3.50
Fixed in version 24.4
Done: Dmitry Gutov <dgutov <at> yandex.ru>
Bug is archived. No further changes may be made.
Full log
Message #23 received at 15874 <at> debbugs.gnu.org (full text, mbox):
On 05.12.2013 04:50, Stefan Monnier wrote:
> Maybe a good way to handle them is via syntax-propertize,
Huh yes, that's an approach I haven't considered. But it seems more
performance-intensive than the other options, at least as long as Emacs
regexps don't support lookbehind.
If we could match "non-symbols", then the font-lock part of the problem
would be solved, and appending "?" or "!" in the forward-token and
backward-token functions would take negligible amount of time.
Say, why don't we have a "non-symbol" matcher? I would think that in
many cases the regexp engine performs unnecessary work when it sees
"\\_<" or "\\_>" because we often know in advance that the character
we've already matched, or will have to match next, is a symbol
constituent. But the engine has to check.
Most uses of `(regexp-opt '("boats" "boats" "boats") 'symbols)' would
fall under this scenario.
> then, especially
> if we can come up with a good regexp that distinguishes "method name"
> from "local variable name"?
Not really. References to local variables, unlike instance and global
ones, are indistinguishable from method calls if we judge only by name.
We could backtrack until the beginning of block or method, look for
assignments, etc, but that's a lot of work for marginal gain: we can
just assume that each such reference is a method calls, because
otherwise it would be syntax error.
This bug report was last modified 11 years and 165 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.