[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bpfk] Fighting copy-pasting in PEG



I notice that a lot of combinations are "hardcoded" in PEG.
E.g. a lot of constructs are followed by "free*" several times in the grammar where the first part of the construct remains the same.

Here is an experimental grammar:
https://raw.githubusercontent.com/Ilmen-vodhr/ilmentufa/master/camxes-exp.js.peg

And here are the stats:
http://pastebin.com/raw.php?i=ADTJ0KdT

Here, "KE_clause free*" is used 11 times in PEG and even when "free*" doesn't follow KE_clause it could.
Why not move "free*" into KE_clause itself ? This would make the grammar easier.

"free*" is used ~200 times in the grammar. I'm sure this number can be lowered significantly.

Anyone is interested in joining such constructs into new variables?

--
You received this message because you are subscribed to the Google Groups "BPFK" group.
To unsubscribe from this group and stop receiving emails from it, send an email to bpfk-list+unsubscribe@googlegroups.com.
To post to this group, send email to bpfk-list@googlegroups.com.
Visit this group at http://groups.google.com/group/bpfk-list.
For more options, visit https://groups.google.com/d/optout.