Actions
Backport #2233
closed[PATCH] Ripper parsing Proc call as: f.() or f::() crashes
Status:
Closed
Assignee:
Description
=begin
Ripper seems to crash (with YARV and C stack trace) when trying to parse the two Proc call conveniences added to Ruby 1.9.x where the 'call' keyword is eliminated.
Ripper.sexp("f.()")
Ripper.sexp("f::()")
The problem seems to be that Ripper is inserting 'call' in the parse stream but was using rb_intern instead of ripper_intern. The included patch calls the ripper_intern and fixes the crash.
With the patch:
Ripper.sexp("f.()")
=> [:program, [[:method_add_arg, [:call, [:paren, [:var_ref, [:ident, "f", [1, 0]]]], :".", :call], [:arg_paren, nil]]]]
Ripper.sexp("f::()")
=> [:program, [[:method_add_arg, [:call, [:paren, [:var_ref, [:ident, "f", [1, 0]]]], :"::", :call], [:arg_paren, nil]]]]
=end
Files
Actions
Like0
Like0Like0Like0Like0