Closed thehappycheese closed 2 years ago
Actually now I am reading RuleDecoratorMeta
and I can see how a grammar passed into NodeVisitor.__init__
would just replace anything set up in NodeVisitor.__new__
... I have probably jumped the gun creating a pull request.
It feels like NodeVisitor.__init__
should accept a default grammar and @rule
annotations should extend / overwrite that. But if the logic in __new__
were moved to __init__
then inheritance / mro becomes a problem...
Proposal to allow NodeVisitor to be initialized using a default grammar object. Old behaviour still works.
__init__
toNodeVisitor
which accepts a default grammarFor your consideration / comment. Not sure if I should have raised an issue to discuss first? Many thanks to you and other contributors for great package :)