|
From: | Dmitry Gutov |
Subject: | bug#15874: 24.3.50; exit! not properly font-locked in ruby-mode |
Date: | Thu, 05 Dec 2013 00:33:06 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.1.1 |
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 => 42We don't treat "end" in "begin; foo?end" as a keyword, but ideally, we should.
[Prev in Thread] | Current Thread | [Next in Thread] |