mbutterick / brag

Racket DSL for generating parsers from BNF grammars [moved to https://git.matthewbutterick.com/mbutterick/brag]
https://git.matthewbutterick.com/mbutterick/brag
MIT License
61 stars 12 forks source link

support string range operator #12

Closed mbutterick closed 5 years ago

mbutterick commented 6 years ago

Expands to choice pattern, so "0".."3" is the same as ("0" | "1" | "2" | "3")

mbutterick commented 6 years ago

I suppose this is a special case of #11 also.

mbutterick commented 6 years ago

Though it could also be implemented as shorthand for a choice pattern.

mbutterick commented 5 years ago

As a matter of syntax expansion, this could be done. But it’s too hard to figure out how it should work in cases other than digits. Even alphabets are complex. Too much mischief.