Skip to content

Commit

Permalink
Cleanups
Browse files Browse the repository at this point in the history
  • Loading branch information
eregon committed Apr 18, 2023
1 parent f18b45f commit a6f87f3
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 6 deletions.
2 changes: 1 addition & 1 deletion src/main/java/org/truffleruby/parser/BodyTranslator.java
Original file line number Diff line number Diff line change
Expand Up @@ -828,7 +828,7 @@ public RubyNode visitCaseInNode(CaseInParseNode node) {
}

PatternMatchingTranslator translator = new PatternMatchingTranslator(language, source, parserContext,
currentNode, node.getCases(), environment, this);
currentNode, environment, this);

// Evaluate the case expression and store it in a local
final int tempSlot = environment.declareLocalTemp("case in value");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@
import org.truffleruby.parser.ast.HashPatternParseNode;
import org.truffleruby.parser.ast.IfParseNode;
import org.truffleruby.parser.ast.LambdaParseNode;
import org.truffleruby.parser.ast.ListParseNode;
import org.truffleruby.parser.ast.LocalAsgnParseNode;
import org.truffleruby.parser.ast.NilParseNode;
import org.truffleruby.parser.ast.ParseNode;
Expand All @@ -55,7 +54,6 @@

public class PatternMatchingTranslator extends BaseTranslator {

final ListParseNode cases;
final TranslatorEnvironment environment;
final BodyTranslator bodyTranslator;

Expand All @@ -66,11 +64,9 @@ public PatternMatchingTranslator(
Source source,
ParserContext parserContext,
Node currentNode,
ListParseNode cases, // cases to check
TranslatorEnvironment environment,
BodyTranslator bodyTranslator) {
super(language, source, parserContext, currentNode, environment);
this.cases = cases;
this.environment = environment;
this.bodyTranslator = bodyTranslator;
}
Expand Down Expand Up @@ -267,7 +263,6 @@ public RubyNode visitFixnumNode(FixnumParseNode node) {
return bodyTranslator.visitFixnumNode(node);
}

// Possible value patterns delegated to BodyTranslator explicitly to prevent errors.
@Override
public RubyNode visitTrueNode(TrueParseNode node) {
return bodyTranslator.visitTrueNode(node);
Expand Down

0 comments on commit a6f87f3

Please sign in to comment.