-
Notifications
You must be signed in to change notification settings - Fork 128
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
Using standard PEG syntax? [ was: make a new release? ] #191
Comments
Well timed! We have a new one coming very shortly!
|
BTW, is there a standard PEG syntax?, e.g. parsimonious use But elsewhere, I saw most people are using https://en.wikipedia.org/wiki/Parsing_expression_grammar etc. I think the benefit of using standard syntax is that users can compare different library using the same grammar file, without have to change the syntax for each library. Just wondering if we can add |
Historic note for anyone looking at this in the future: The syntax for Parsimonious uses
Now that some time has passed and a consensus is brewing around using |
oh, one small reason to put it off: see also:
|
Is there some reason it would have to be incompatible? It’s just a different grammar, so there could be one grammar parser for parsimonious classic, and one for exact compatibility with other peg parsers. |
I was unclear. Adding |
Then how about it provides both: = : keep the old AND/OR precedence rule. <- : define the new AND/OR precedence rule. |
The current AND/OR precedence is a bug. If we can resolve that, it should be the only behavior. All of this is the say we should fix it before or alongside adding syntax-compatibility with other PEG libraries It's also been a tricky bug to fix, even when Erik was actively developing this lib. I don't think it is prudent to maintain both behaviors for the sake of backwards compat with pre-1.0 versions of Parsimonious. That said - there's still no clear owner for the issue. If someone is interested, though, it would be a high utility improvement for Parismonious! |
I agree, maybe we need a breaking change version. BTW, I found a working Python PEG parser here: https://github.com/we-like-parsers/pegen/blob/main/data/python.gram It uses ":". |
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 |
@lucaswiman I appreciate the thoughtful comment! Would you mind putting it on #199? I cannot find an original issue for the bug so I've made a new one, and I'd like to keep the discussion in that issue |
The last release is:
https://pypi.org/project/parsimonious/
parsimonious 0.8.1
Released: Jun 20, 2018
That's ~4 years ago, can we make a new release?
Thanks.
The text was updated successfully, but these errors were encountered: