-
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
Make sure operator precedence is right #43
Comments
In my PEG implementation I just used Ford's grammar, and am very happy about it. I found it very easy to bootstrap the grammar too. Ford's grammar defines character ranges, which for me eliminated any need to have embedded regular expressions. |
Yes, I want to deprecate regexes and build them myself out of Ford-style syntax. Regexes were just a way to get to a working product faster. |
I'm probably going to keep the = signs, though; they're easier to type and, I think, easier to read for Python people. I did a survey of PEG libs before I designed Parsimonious's syntax, and none of them could agree on anything (Pijnu uses |
Well, there is a chance to interoperate with my halst/peg.rb library :-). Also, I usually follow this rule: if I don't know any better—just pick something existing. That's how docopt became. |
I'd consider supporting |
If you can make Parsimonious' syntax a strict superset of Fords'—that would make me really happy. |
It would be great if you could lower the precedence of the '/' operator. This
Note the grammar without parenthesis is not accepted by parsimonious. |
Working on this right now. :-) |
Ended up hitting a mysterious non-parsing grammar while writing the first test case and then spending the rest of the day working on a graphical grammer debugger. But I guess that's good, too. :-) |
I just ran into the whole "a = b c / d" thing. Anything that can be done about it? |
I keep coming back to it but haven't had any luck yet; it basically amounts to rewriting the grammar grammar. Someday I intend to get it right, but I can't give an estimate of when. Help is welcome, of course. |
In the meantime, you can certainly work around it with parentheses. |
Here, I've pushed the branch with my work so far: https://github.com/erikrose/parsimonious/tree/lower-precedence-ors. I don't promise it makes sense, but, if anyone wants to tinker with it, you're welcome. As the 2nd-last commit message says, see |
IIRC, the original paper had
/
as extremely low precedence. Make sure we got it all right.The text was updated successfully, but these errors were encountered: