GNU bug report logs - #15874
24.3.50; exit! not properly font-locked in ruby-mode

Previous Next

Package: emacs;

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


View this message in rfc822 format

From: Dmitry Gutov <dgutov <at> yandex.ru>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 15874 <at> debbugs.gnu.org, Bozhidar Batsov <bozhidar <at> batsov.com>
Subject: bug#15874: 24.3.50; exit! not properly font-locked in ruby-mode
Date: Thu, 05 Dec 2013 00:33:06 +0200
On 04.12.2013 21:20, Stefan Monnier wrote:
>> I'm not sure we want to move `!' to the symbol syntax class.
>
> How is the Ruby lexing done w.r.t identifiers and ! (and ?) ?

There's no special handling: ? is considered a part of whatever token 
it's adjacent to (even when the token follows it, ex. "?wut"), and ! is 
considered a separate token.

The former is usually harmless, as far as indentation and syntax 
highlighting are concerned (*), but not considering ! a part of 
preceding token makes us mishandle the (rare, to be sure) method names 
like "else!" and "end!".

(*) Counterexample:

irb(main):013:0> def foo?
irb(main):014:1> 42
irb(main):015:1> end
=> nil
irb(main):016:0> begin; foo?end
=> 42

We don't treat "end" in "begin; foo?end" as a keyword, but ideally, we 
should.




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.