-
-
Notifications
You must be signed in to change notification settings - Fork 925
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
[Truffle] Fix optional assignment specs #4355
Conversation
…nts with ||= assignments.
…nts with &&= assignments.
…nts with operator assignments.
return visitOpAsgnAndNode(node, node.getFirstNode().accept(this), node.getSecondNode().accept(this)); | ||
} | ||
|
||
private RubyNode visitOpAsgnAndNode(ParseNode node, RubyNode lhs, RubyNode rhs) { |
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 it's clearer to give it another name like translateOpAsgnAndNode
.
|
||
default: { | ||
final RubySourceSection sourceSection = translate(node.getPosition()); | ||
final RubyCallNodeParameters callParameters = new RubyCallNodeParameters(context, sourceSection.toSourceSection(source), lhs, node.getOperator(), null, new RubyNode[] { rhs }, false, true, false, false, false); |
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 a slightly shorter version if the last 3 boolean are false for RubyCallNodeParameters.
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.
Thanks. I missed that.
This fixes all the remaining optional variable assignment specs. I think what I did makes sense, but I'd appreciate at least another pair of eyes looking over the changes.
@jruby/truffle