Bug #631

ripper does not follow change of parse.y

Added by Koichi Kimura over 6 years ago. Updated almost 4 years ago.

[ruby-dev:36702]
Status:Closed
Priority:Normal
Assignee:-
ruby -v: Backport:

Description

=begin
-> を使ったステートメントを ripper が正しく解析できません。

irb(main):001:0> RUBY_RELEASE_DATE
=> "2008-10-10"
irb(main):002:0> require 'ripper'
=> true
irb(main):004:0> Ripper.lex("lambda{|x| x*x}.call(3)")
=> [[[1, 0], :on_ident, "lambda"], [[1, 6], :on_lbrace, "{"], [[1, 7], :on_op, "
|"], [[1, 8], :on_ident, "x"], [[1, 9], :on_op, "|"], [[1, 10], :on_sp, " "], [[
1, 11], :on_ident, "x"], [[1, 12], :on_op, ""], [[1, 13], :on_ident, "x"], [[1,
14], :on_rbrace, "}"], [[1, 15], :on_period, "."], [[1, 16], :on_ident, "call"]
, [[1, 20], :on_lparen, "("], [[1, 21], :on_int, "3"], [[1, 22], :on_rparen, ")"
]]
irb(main):005:0> Ripper.lex("->(x){x*x}.call(3)")
=> [[[1, 0], :on_tlambda, "->"], [[1, 2], :on_lparen, "("], [[1, 3], :on_ident,
"x"], [[1, 4], :on_rparen, ")"], [[1, 5], :on_lbrace, "{"], [[1, 6], :on_ident,
"x"], [[1, 7], :on_op, "
"], [[1, 8], :on_ident, "x"], [[1, 9], :on_rbrace, "}"]
]

-> を使ったほうは無名ブロックの閉じブレースで解析が止まってます。

parse.y に手を入れる必要があるのでは?
primary → tLAMBDA lambda のあたりとか。
=end


Related issues

Related to Ruby trunk - Bug #1912: ripper cannot parse test/ruby/test_object.rb Closed 08/09/2009

History

#1 Updated by Yukihiro Matsumoto over 6 years ago

  • Status changed from Open to Closed
  • % Done changed from 0 to 100

=begin
Applied in changeset r19908.
=end

Also available in: Atom PDF