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
File "calc.py", line 125, in main
help(parse_tree)
File "/home/damien/.venv/lib/python3.6/site.py", line 505, in __call__
return pydoc.help(*args, **kwds)
File "/usr/lib/python3.6/pydoc.py", line 1864, in __call__
self.help(request)
File "/usr/lib/python3.6/pydoc.py", line 1923, in help
else: doc(request, 'Help on %s:', output=self._output)
File "/usr/lib/python3.6/pydoc.py", line 1650, in doc
pager(render_doc(thing, title, forceload))
File "/usr/lib/python3.6/pydoc.py", line 1625, in render_doc
object, name = resolve(thing, forceload)
File "/usr/lib/python3.6/pydoc.py", line 1617, in resolve
name = getattr(thing, '__name__', None)
File "../arpeggio/__init__.py", line 1170, in __getattr__
result = NonTerminal(rule=rule, nodes=nodes, _filtered=True)
File ".../arpeggio/__init__.py", line 1098, in __init__
super(NonTerminal, self).__init__(rule, position, error)
File ".../arpeggio/__init__.py", line 971, in __init__
assert rule
It's also simply triggered by parse_tree.__name__
Looks like it's because parse_tree. is used to find a child and __name__ is not a child
Adding a simple __name__ method to NonTerminal fix the issue:
Thanks for reporting. Actually, accessing any non-existing attribute on a parse tree node was leading to assertion error. With this fix it will be correctly handled by raising AttributeError.
I'm using the
calc
example:It's also simply triggered by
parse_tree.__name__
Looks like it's because parse_tree. is used to find a child and
__name__
is not a childAdding a simple
__name__
method toNonTerminal
fix the issue:The text was updated successfully, but these errors were encountered: