-
Notifications
You must be signed in to change notification settings - Fork 35
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
Fix snug x<y
#830
Fix snug x<y
#830
Conversation
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.
Looks good!
I don't understand the Coveralls error... It's says a line in e.g. xnor=
is now uncovered, but it should be in tests. Unless it's a xnor=b
that's uncovered; could add a test.
WAssignmentOp | ||
__ AssignmentOp | ||
_ OperatorAssignmentOp | ||
_? OperatorAssignmentOp |
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.
I think this change allows something like x[1]xor= true
or x[1]min= x[0]
which doesn't look great... but I guess it's OK, looking at the new test case. Certainly can't mean anything else.
@@ -2991,23 +2990,23 @@ AssignmentOp | |||
# This is separate from AssignmentOp because it only works in certain contexts | |||
# (in particular, not at the beginning of a line). | |||
OperatorAssignmentOp | |||
Xor "=" &Whitespace _? -> | |||
Xor "=" _? -> |
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.
This allows x xor=y
which... is probably fine, just pointing it out.
# (e.g. whitespace) after "<". This does forbid 1<2 or x<y. | ||
/<(?!\p{ID_Start}|[_$])/ -> | ||
return "<" | ||
"<" |
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.
Kind of surprised this works! But must be an old way of avoiding ambiguity.
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.
It originally caused some trouble with class X extends A<B>
but switching to enforcing ExtendsTarget
as a LeftHandSideExpression
fixes it by requiring parens around expressions.
--- | ||
x<y | ||
""" | ||
|
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.
Perhaps should also add x<y>z
from #824?
Oops, already merged — I'll add it.
No description provided.