-
Notifications
You must be signed in to change notification settings - Fork 130
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AND/OR precedence is reversed compared to the original paper #199
Comments
(Copied from #191)
Totally disagree with this. Unless the upgrade path is extremely easy and foolproof (like a function that converts an old grammar string to an equivalent new one), this would be breaking backwards compatibility for pretty questionable reasons: complying with some other parsers used by other people who aren't already using the library. As a user of (and contributor to) parsimonious, with many functional grammar files, what other libraries are doing isn't very relevant unless it give some genuine functionality improvements. "pre-1.0" is sort of weak, since it is used in a lot of production systems. The docs are pretty explicit. The README says:
The comments on the grammar definition in the code says this: parsimonious/parsimonious/grammar.py Lines 216 to 219 in b6a6f54
It does seem like supporting both syntaxes shouldn't be that bad. Ideally the changes would just be to the grammar, though it looks like master...lower-precedence-ors required some changes to the visitor as well. Maybe a transducer from the old syntax to the new syntax would be possible, or at least an interesting exercise.
Now that python 2 support has been dropped 🙌 , I'm personally more interested in working on allowing parsing of |
Cool, thanks! |
"I don't plan on making any backward-incompatible changes to the rule syntax in the future, so you can write grammars with confidence" was added to the README in version 0.2, 12 years ago. Then he promptly shipped two breaking version (0.5, 0.6). It's sometimes necessary. |
Rather than freeze out progress for time measured in years, why not have a state flag for new versus old. Default to 0, 0 meaning what it always meant, and 1 meaning, the new stuff, then in 100 years, one can flip it to 1, and break, or let users do version: 1, or some other way to select which one. feature-5: 1, for a specific feature. version: for the whole ball of wax. This let's you api update, if you need to, syntax changes, semantic changes, hide new additions, in short, anything. Longer term, yes, supporting a standard spelling that everyone agrees on, would be nice. |
Parsimonious reverses the precedence of AND/OR compared to the original paper and other PEG libs
#191 (comment)
The text was updated successfully, but these errors were encountered: