Skip to content

Commit

Permalink
[Truffle] Implement part of &&= for constants
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Fish committed Nov 25, 2016
1 parent c26cbd9 commit 6f2e683
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
7 changes: 0 additions & 7 deletions spec/truffle/tags/language/optional_assignments_tags.txt
@@ -1,11 +1,4 @@
fails:Optional variable assignments using compunded constants with ||= assignments
fails:Optional variable assignments using compunded constants with &&= assignments
fails:Optional variable assignments using compunded constants with &&= assignments will fail with non-existant constants
fails:Optional variable assignments using compunded constants with operator assignments
fails:Optional variable assignments using compunded constants with operator assignments will fail with non-existant constants
fails:Optional variable assignments using &&= using a single variable leaves new variable unassigned
fails:Optional variable assignments using &&= using a single variable leaves false
fails:Optional variable assignments using &&= using a single variable leaves nil
fails:Optional variable assignments using &&= using a single variable does not evaluate the right side when not needed
fails:Optional variable assignments using &&= using a single variable does re-assign a variable with a truthy value
fails:Optional variable assignments using &&= using a single variable does re-assign a variable with a truthy value when using an inline rescue
Expand Up @@ -2587,7 +2587,11 @@ public RubyNode visitOpAsgnAndNode(OpAsgnAndParseNode node) {
@Override
public RubyNode visitOpAsgnConstDeclNode(OpAsgnConstDeclParseNode node) {
// TODO (eregon, 7 Nov. 2016): Is there any semantic difference?
return visitOpAsgnOrNode(new OpAsgnOrParseNode(node.getPosition(), node.getFirstNode(), node.getSecondNode()));
if ("&&".equals(node.getOperator())) {
return visitOpAsgnAndNode(new OpAsgnAndParseNode(node.getPosition(), node.getFirstNode(), node.getSecondNode()));
} else {
return visitOpAsgnOrNode(new OpAsgnOrParseNode(node.getPosition(), node.getFirstNode(), node.getSecondNode()));
}
}

@Override
Expand Down

0 comments on commit 6f2e683

Please sign in to comment.