You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Initially opened as #304. Adding a new issue b/c it seems to have a bug in its implementation:
# Latest Parser (as of 26 Sept)
$ ruby-parse -v
ruby-parse based on parser version 2.3.1.4
This bit works fine:
# Ruby has no issue
$ ruby -e 'begin; rescue; else; p 1; end'
1
# Parser makes it a second child of `rescue`
$ ruby-parse -e 'def a; rescue; else; p 1; end; a'
warning: parser/current is loading parser/ruby22, which recognizes
warning: 2.2.5-compliant syntax, but you are running 2.2.2.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
(kwbegin
(rescue nil
(resbody nil nil nil)
(send nil :p
(int 1))))
This one has a bug, compound_stmt is nil (I'd look into it, but there's a television on and two dogs running around, so it's difficult to concentrate)
# Ruby dislikes it, but still runs it
$ ruby -e 'begin; else; p 1; end'
-e:1: warning: else without rescue is useless
1
# Parser explodes with a NoMethodError
$ ruby-parse -e 'begin; else; p 1; end'
warning: parser/current is loading parser/ruby22, which recognizes
warning: 2.2.5-compliant syntax, but you are running 2.2.2.
warning: please see https://github.com/whitequark/parser#compatibility-with-ruby-mri.
Failed on: (fragment:0)
/Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/builders/default.rb:987:in `begin_body': undefined method `type'for nil:NilClass (NoMethodError) from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/ruby22.rb:3387:in `_reduce_9' from /Users/josh/.rubies/ruby-2.2.2/lib/ruby/2.2.0/racc/parser.rb:258:in `_racc_do_parse_c'
from /Users/josh/.rubies/ruby-2.2.2/lib/ruby/2.2.0/racc/parser.rb:258:in `do_parse' from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/base.rb:162:in `parse' from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/runner/ruby_parse.rb:132:in `process' from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/runner.rb:207:in `process_buffer'
from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/runner.rb:181:in `block in process_fragments' from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/runner.rb:173:in `each' from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/runner.rb:173:in `each_with_index' from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/runner.rb:173:in `process_fragments'
from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/runner.rb:163:in `block in process_all_input' from /Users/josh/.rubies/ruby-2.2.2/lib/ruby/2.2.0/benchmark.rb:288:in `measure' from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/runner.rb:162:in `process_all_input' from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/runner/ruby_parse.rb:128:in `process_all_input'
from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/runner.rb:33:in `execute' from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/lib/parser/runner.rb:11:in `go' from /Users/josh/.gem/ruby/2.2.2/gems/parser-2.3.1.4/bin/ruby-parse:6:in `<top (required)>' from /Users/josh/.gem/ruby/2.2.2/bin/ruby-parse:23:in `load'
from /Users/josh/.gem/ruby/2.2.2/bin/ruby-parse:23:in `<main>'
The text was updated successfully, but these errors were encountered:
Initially opened as #304. Adding a new issue b/c it seems to have a bug in its implementation:
# Latest Parser (as of 26 Sept) $ ruby-parse -v ruby-parse based on parser version 2.3.1.4
This bit works fine:
This one has a bug, compound_stmt is
nil
(I'd look into it, but there's a television on and two dogs running around, so it's difficult to concentrate)The text was updated successfully, but these errors were encountered: