-
-
Notifications
You must be signed in to change notification settings - Fork 48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rule names can collide with Tatsu internals and raise SemanticError #141
Comments
I've kept looking at this and I think the problem is a naming collision. My https://github.com/neogeny/TatSu/blob/master/tatsu/objectmodel.py#L145 The solution is to either consider As a workaround, switching from |
Ah! Collisions! I need to think about how to get rid of those in the next version of TatSu. Most of the collisions come from trying to make |
Hello @EGrunzke ! Do we still need to do something about this issue? |
I am still able to reproduce using the grammar from the original post. I used Tatsu 5.6.1 This isn't much of a blocker, as a simple rename of the rule solves the problem. But it does still exist! |
Summary
The generated ModelBuilderSemantics class raises a
tatsu.exceptions.SemanticError: Could not call constructor for Sequence: 'closure' object is not callable
Context
Some cases work:
tatsu.compile(grammar).parse("(test)")
BugParser().parse("(test)")
But
BugParser().parse("(test)", semantics=BugModelBuilderSemantics())
failsThe grammar
Reproduction
Reproduction
Generate the parser and model:
python -m tatsu bug.peg -o bug_parser.py -G bug_model.py
Run
GitHub repo with full code
Full reproduction code is available:
https://github.com/EGrunzke/tatsu-sematic-error-closure-not-callable
The text was updated successfully, but these errors were encountered: