Open pwuertz opened 6 years ago
Thanks for your good questions!
When I first made the decisions about Parsimonious’s grammar, there was no consensus among libraries, so I made it look as natural to Python programmers as possible. I wouldn’t at all mind if things that could work either way, like = and <-, both Just Worked. I’m less excited about introducing modes that people have to care about, but I could be persuaded if no other alternative could be found.
As for the character class issue, Parsimonious doesn’t yet support proper PEG char classes as might be embedded into the middle of a rule: just regexes. My intent was always to support the PEG char class syntax and have that compile down into regexes.
Patches for either would be welcomed.
Btw, the other big difference from stock PEGs is that my sequences and alternations have their precedences switched. I have a ticket open about that, but it’s proven shockingly hard to get the tests passing after changing it. I can dig up my branch if you’re interested.
parsimonious differs from the original PEG syntax (as defined in http://www.brynosaurus.com/pub/lang/peg.pdf) in some aspects.
Differences I noticed so far:
=
instead of<-
for assignment[a b]
asa
orb
, but PEG interprets it asa
or space orb
.Are those differences intentional? Would an optional "vanilla" parsing mode be of interest? The reason I'm asking is because I'd like to share PEG files (core syntax only) between two applications using different parsing libraries.