Project

General

Profile

Actions

Bug #3764

closed

Ripper incorrectly handle literal keywords (as symbol, eg. :class)

Added by ngtzeyang (TzeYang Ng) over 14 years ago. Updated over 13 years ago.

Status:
Rejected
Assignee:
-
Target version:
-
ruby -v:
1.9.3
Backport:
[:]

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

Actions #1

Updated by ngtzeyang (TzeYang Ng) over 14 years ago

=begin
ruby -v

>> ruby 1.9.1p376 (2009-12-07 revision 26041) [x86_64-linux]

=end

Actions #2

Updated by eitoball (Eito Katagiri) over 14 years ago

=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

Actions #3

Updated by naruse (Yui NARUSE) over 14 years ago

  • Status changed from Open to Rejected
  • ruby -v set to 1.9.3

=begin
It can be a trap, but it is spec.
=end

Actions

Also available in: Atom PDF

Like0
Like0Like0Like0