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
I have a web app using my Flooph gem, which is a class inheriting from Parslet::Parser. When I get certain web app errors, it tries to inspect my class, resulting in a new error (that masks my web app's error). Here's a simple repro:
phrogz$ ruby -e "require 'flooph'; p Flooph.new"
Traceback (most recent call last):
4: from -e:1:in `<main>'
3: from -e:1:in `p'
2: from /Users/phrogz/.rvm/gems/ruby-2.5.1/gems/parslet-1.8.2/lib/parslet/atoms/base.rb:148:in `inspect'
1: from /Users/phrogz/.rvm/gems/ruby-2.5.1/gems/parslet-1.8.2/lib/parslet/atoms/base.rb:140:in `to_s'
/Users/phrogz/.rvm/gems/ruby-2.5.1/gems/parslet-1.8.2/lib/parslet/parser.rb:66:in `to_s_inner': undefined local variable or method `root' for #<Flooph:0x00007fd635845770> (NameError)
This happens because my class does not define a root rule before it gets inspected.
The text was updated successfully, but these errors were encountered:
Since I've just patched my gem to avoid this bug, the simpler repro is: ruby -e "require 'parslet'; p Parslet::Parser.new"
…but it will happen when trying to inspect any parser that doesn't have a root rule.
I have a web app using my Flooph gem, which is a class inheriting from
Parslet::Parser
. When I get certain web app errors, it tries toinspect
my class, resulting in a new error (that masks my web app's error). Here's a simple repro:This happens because my class does not define a
root
rule before it gets inspected.The text was updated successfully, but these errors were encountered: