-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Closed
Labels
Description
Feature or enhancement
Proposal:
It seems like PEG parser produces more than one artificial rule for the same grammar rule.
For example, on each gather rule (','.NAME+) in Grammar/python.gram a function '_gather_N_rule' will be generated.
But only one implementation of such function makes sense, others are just redundant.
Some simple changes in Tools/peg_generator/pegen/c_generator.py file should be made.
We can save artificial rules in cache by Node string representation as a key instead of Node object itself.
Total count of artificial rules can be lowered from 283 to 170 with this change, size of parser.c file can be lowered from 1.5 megabytes to 1.3 megabytes without any cost.
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response