Bug #3764
closed
Ripper incorrectly handle literal keywords (as symbol, eg. :class)
Added by ngtzeyang (TzeYang Ng) about 14 years ago.
Updated over 13 years ago.
Description
=begin
Given the following use case of ripper:
pp Ripper.lex(':class')
I'm gettting:
[[[1, 0], :on_symbeg, ":"], [[1, 1], :on_kw, "class"]]
I'm thinking the output should be:
[[[1, 0], :on_symbeg, ":"], [[1, 1], :on_ident, "class"]]
Seems like a bug ?
=end
=begin
ruby -v
>> ruby 1.9.1p376 (2009-12-07 revision 26041) [x86_64-linux]¶
=end
=begin
No, I don't think that it is a bug.
It doesn't have to be an identifier after colon for a symbol.
":$0", ":VERSION", and ":>" are valid symbols. You might want
to take a look at parse.y in Ruby source code to see what can
be after colon for a symbol.
=end
- Status changed from Open to Rejected
- ruby -v set to 1.9.3
=begin
It can be a trap, but it is spec.
=end
Also available in: Atom
PDF
Like0
Like0Like0Like0