-
Notifications
You must be signed in to change notification settings - Fork 170
Reject p(p a, &block => value)
and similar
#3669
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
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
p(p a, x: b => value) | ||
^~ unexpected '=>'; expected a `)` to close the arguments | ||
^ unexpected ')', expecting end-of-input | ||
^ unexpected ')', ignoring it | ||
|
||
p(p a, x: => value) | ||
^~ unexpected '=>'; expected a `)` to close the arguments | ||
^ unexpected ')', expecting end-of-input | ||
^ unexpected ')', ignoring it | ||
|
||
p(p a, &block => value) | ||
^~ unexpected '=>'; expected a `)` to close the arguments | ||
^ unexpected ')', expecting end-of-input | ||
^ unexpected ')', ignoring it | ||
|
||
p(p a, *args => value) | ||
^~ unexpected '=>'; expected a `)` to close the arguments | ||
^ unexpected ')', expecting end-of-input | ||
^ unexpected ')', ignoring it | ||
|
||
p(p a, **kwargs => value) | ||
^~ unexpected '=>'; expected a `)` to close the arguments | ||
^ unexpected ')', expecting end-of-input | ||
^ unexpected ')', ignoring it | ||
|
||
p p 1, &block => 2, &block | ||
^~ unexpected '=>', expecting end-of-input | ||
^~ unexpected '=>', ignoring it | ||
^ unexpected ',', expecting end-of-input | ||
^ unexpected ',', ignoring it | ||
^ unexpected '&', ignoring it | ||
|
||
p p p 1 => 2 => 3 => 4 | ||
^~ unexpected '=>', expecting end-of-input | ||
^~ unexpected '=>', ignoring it | ||
|
||
p[p a, x: b => value] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is code which I assumed would still be accepted with this change (see previous comment). But it is correctly rejected. |
||
^ expected a matching `]` | ||
^ unexpected ']', expecting end-of-input | ||
^ unexpected ']', ignoring it | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -39,3 +39,9 @@ def foo = bar 1 | |
!foo 1 or !bar 2 | ||
|
||
not !foo 1 | ||
|
||
foo(bar baz, key => value) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Probably already tested somewhere 🤷 |
||
|
||
foo(bar baz, KEY => value) | ||
|
||
foo(bar baz, :key => value) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is very similar code here
prism/src/prism.c
Line 18217 in ce4abe1
I tried a few things to find code samples which force me to do the same change there as well but I did not find such code. Left it alone for now