Closed danini-the-panini closed 4 years ago
I am unable to reproduce:
979 % rake debug R='p `#{foo}`'
s(:call, nil, :p, s(:dxstr, "", s(:evstr, s(:call, nil, :foo))))
980 % rake debug R='x.p `#{foo}`'
s(:call, s(:call, nil, :x), :p, s(:dxstr, "", s(:evstr, s(:call, nil, :foo))))
ruby_parser/lib/ruby_parser_extras.rb:129:in `arg_blk_pass': undefined method `sexp_type' for nil:NilClass (NoMethodError)
That line number is off (should be 128) and implies that node1
being passed in is nil. What version are you using?
| args opt_block_arg
{
result = call_args val
result = self.arg_blk_pass val[0], val[1]
}
This has to be the code in question, and a nil
for val[0]
should be impossible.
ETA: tho not reusing that first result seems like an error...
I just cleaned up call_args
entirely and removed arg_blk_pass
as a result... This will address your problem, but not really, as I don't know how you got INTO this situation given the grammar.
Ah, my bad, I just checked my version now. It was happening on 3.14.0, but after updating to 3.14.1 the problem went away. 🤦♂
No worries! Thanks!
The following ruby strings fail to parse (using the Ruby26Parser):
It produces the following error:
It appears to happen with or without parentheses around the argument.
The following ruby code is parsed without error: