Nested expression matching
Closed this issue · 1 comments
wess commented
One awesome thing would be ability to nest pattern matches/calls within your grammar, like a PEG, Antlr, or even a Flex/Bison:
Example:
statement = [a-zA-Z0-9]+
statements = statement + statements
It might do this, just didn't see anything in the docs about it.
ps. awesome work on regex support!
SwiftStudies commented
Yes this is fully supported (nerdy term for it is left hand recursion). STLR equivalent is:
statement = /[a-zA-Z0-9]+ /
statements = statement statements
Although this could be done more efficiently as just
statement = /[a-zA-Z0-0]+ /
statements = statement+