kjosib / booze-tools

Booze Tools will become the complete programming-language development workbench, all written in Python 3.9 (for now).
MIT License
14 stars 1 forks source link

Abbrevatory device for self-recursion in grammar rules #21

Closed kjosib closed 5 years ago

kjosib commented 5 years ago

Meaningful identifiers are all the rage these days, but who needs or wants to see the word expression repeated six dozen times?

We can already abbreviate the head of a production rule by starting a line with | (after optional whitespace) so why not a simple, consistent way to refer back to that same head with some simple meta-syntactic element?

I propose the underline _ as standing in for "it", the way it does in perl.