Project

General

Profile

Actions

Bug #631

closed

ripper does not follow change of parse.y

Added by kbk (Koichi Kimura) about 16 years ago. Updated over 13 years ago.

Status:
Closed
Assignee:
-
Target version:
ruby -v:
Backport:
[ruby-dev:36702]

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| xx}.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){xx}.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 1 (0 open1 closed)

Related to Ruby master - Bug #1912: ripper cannot parse test/ruby/test_object.rbClosedaamine (Minero Aoki)08/09/2009Actions
Actions #1

Updated by matz (Yukihiro Matsumoto) about 16 years ago

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

=begin
Applied in changeset r19908.
=end

Actions

Also available in: Atom PDF

Like0
Like0