I extended Parslet with a fixed width constraint so you can write:

    rule(:something) { (str('a').repeat >> str('b').repeat).fixed(3) }

which will match

    aaa, aab, abb, or  bbb

I'd love some pointers/feedback on the code.

https://gist.github.com/NigelThorne/8950566 (feel free to fork and improve
it)

or

http://stackoverflow.com/questions/5540297/how-to-define-a-fixed-width-constraint-in-parslet/21719510#21719510


Cheers
Nigel
---
"Man, I'm going to have so many chickens when this lot hatch!"

Reply via email to