188
188
import org .truffleruby .parser .ast .EvStrParseNode ;
189
189
import org .truffleruby .parser .ast .FCallParseNode ;
190
190
import org .truffleruby .parser .ast .FalseParseNode ;
191
- import org .truffleruby .parser .ast .FindPatternParseNode ;
192
191
import org .truffleruby .parser .ast .FixnumParseNode ;
193
192
import org .truffleruby .parser .ast .FlipParseNode ;
194
193
import org .truffleruby .parser .ast .FloatParseNode ;
195
194
import org .truffleruby .parser .ast .ForParseNode ;
196
195
import org .truffleruby .parser .ast .GlobalAsgnParseNode ;
197
196
import org .truffleruby .parser .ast .GlobalVarParseNode ;
198
197
import org .truffleruby .parser .ast .HashParseNode ;
199
- import org .truffleruby .parser .ast .HashPatternParseNode ;
200
198
import org .truffleruby .parser .ast .IArgumentNode ;
201
199
import org .truffleruby .parser .ast .IfParseNode ;
202
200
import org .truffleruby .parser .ast .InParseNode ;
@@ -843,11 +841,9 @@ public RubyNode visitCaseInNode(CaseInParseNode node) {
843
841
currentNode , node .getCases (), environment , this );
844
842
845
843
// Evaluate the case expression and store it in a local
846
-
847
- final RubyNode caseExprValue = node .getCaseNode ().accept (this );
848
844
final int tempSlot = environment .declareLocalTemp ("case in value" );
849
845
final ReadLocalNode readTemp = environment .readNode (tempSlot , sourceSection );
850
- final RubyNode assignTemp = readTemp .makeWriteNode (caseExprValue );
846
+ final RubyNode assignTemp = readTemp .makeWriteNode (node . getCaseNode (). accept ( this ) );
851
847
852
848
/* Build an if expression from the ins and else. Work backwards because the first if contains all the others in
853
849
* its else clause. */
@@ -856,7 +852,7 @@ public RubyNode visitCaseInNode(CaseInParseNode node) {
856
852
if (node .getElseNode () == null ) {
857
853
elseNode = NoMatchingPatternNodeGen .create (readTemp );
858
854
} else {
859
- elseNode = translateNodeOrNil ( sourceSection , node .getElseNode ());
855
+ elseNode = node .getElseNode (). accept ( this );
860
856
}
861
857
862
858
for (int n = node .getCases ().size () - 1 ; n >= 0 ; n --) {
@@ -1492,11 +1488,6 @@ public RubyNode visitFalseNode(FalseParseNode node) {
1492
1488
return addNewlineIfNeeded (node , ret );
1493
1489
}
1494
1490
1495
- @ Override
1496
- public RubyNode visitFindPatternNode (FindPatternParseNode node ) {
1497
- throw CompilerDirectives .shouldNotReachHere ("TODO" );
1498
- }
1499
-
1500
1491
@ Override
1501
1492
public RubyNode visitFixnumNode (FixnumParseNode node ) {
1502
1493
final SourceIndexLength sourceSection = node .getPosition ();
@@ -1812,11 +1803,6 @@ public RubyNode visitHashNode(HashParseNode node) {
1812
1803
return addNewlineIfNeeded (node , ret );
1813
1804
}
1814
1805
1815
- @ Override
1816
- public RubyNode visitHashPatternNode (HashPatternParseNode node ) {
1817
- throw CompilerDirectives .shouldNotReachHere ("TODO" );
1818
- }
1819
-
1820
1806
@ Override
1821
1807
public RubyNode visitIfNode (IfParseNode node ) {
1822
1808
final SourceIndexLength sourceSection = node .getPosition ();
0 commit comments