bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


From: Dmitry Gutov
Subject: bug#15874: 24.3.50; exit! not properly font-locked in ruby-mode
Date: Thu, 05 Dec 2013 01:15:37 +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 ?) ?

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






reply via email to

[Prev in Thread] Current Thread [Next in Thread]