-
Notifications
You must be signed in to change notification settings - Fork 8
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
Handle asymmetric precedence #53
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You are an f'ing genius, @vickenty! |
The test with c::d() failed because we didn't account for the non-q-like function names being the entire subroutine name (like "c()") or having a package separator (like "c::d()"). This is now fixed! \o/
While fixing up tests, I found that we don't tell the difference between Ident used for classes and ones used for subroutine names. They're mostly similar, but the following is different: 1. Foo::->bar() # method call, works 2. Foo->bar() # same, ambiguous to perl, but not to guacamole 3. Foo::bar() # Function call, Foo class, bar function name 4. Foo::bar::() # Error! But because we use Ident for all of these, #1 and #4 are getting confused. We can fix it. It's not a top priority.
I pushed a few fixes for tests and some rules. Added a few more. Here's the current state:
All of our relevant tests pass! |
"It's just a string that some underlying C libraries numify to a value representing infinity." -- Ikegami @ PerlMonks
(The failing tests above were moved to TODO after I created tickets for each. They're not urgent.) |
@vickenty, should we merge? I want to move forward with additional fixes. |
This fixes precedence issues for assignment named operators, to correctly parse code like this: `($a = goto $b = $c)` `($a + goto $d + $e)`
Give separate names to arguments of all named operators, so future fixes to precedence can be done without updating all definitions
Include marpa's progress if we failed to parse something
xsawyerx
approved these changes
May 27, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Parse code like this:
(sort $a, $b + sort $c, $d)
($a, $b = open $b, $c = $d)
LHS of expressions can not contain named operators (in this case they
bind to the rightmost parameter), but RHS can.
Fixes #48
Fixes #52