Subject: bug#15874: 24.3.50; exit! not properly font-locked in ruby-mode

From: Dmitry Gutov <[email-masked]>
Date: Thu, 05 Dec 2013 01:15:37 +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 ?) ?

To answer your actual question: Ruby considers ! and ? parts of 
identifiers only in method names, and only when the name ends with one 
such a character.

The names of local variables, as well as instance and global ones, can't 
use ? and !. We may want to handle this eventually:

irb(main):001:0> @abc?1:2
=> 2

irb(main):002:0> abc = 1
=> 1
irb(main):003:0> abc?2:3
SyntaxError: (irb):3: syntax error, unexpected ':', expecting $end