File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed
src/main/java/org/truffleruby/parser Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -582,23 +582,20 @@ public RubyNode visitConstantPathOperatorWriteNode(Nodes.ConstantPathOperatorWri
582
582
}
583
583
584
584
public RubyNode visitConstantPathWriteNode (Nodes .ConstantPathWriteNode node ) {
585
- assert node .target instanceof Nodes .ConstantPathNode ;
586
-
587
- final RubyNode rubyNode ;
588
- final RubyNode value = translateNodeOrDeadNode (node .value , "YARPTranslator#visitConstantPathWriteNode" );
589
- final var pathNode = (Nodes .ConstantPathNode ) node .target ;
590
- final String name = toString (pathNode .child );
585
+ final Nodes .ConstantPathNode constantPathNode = node .target ;
591
586
final RubyNode moduleNode ;
592
587
593
- if (pathNode .parent != null ) {
588
+ if (constantPathNode .parent != null ) {
594
589
// FOO::BAR = 1
595
- moduleNode = pathNode .parent .accept (this );
590
+ moduleNode = constantPathNode .parent .accept (this );
596
591
} else {
597
592
// ::FOO = 1
598
593
moduleNode = new ObjectClassLiteralNode ();
599
594
}
600
595
601
- rubyNode = new WriteConstantNode (name , moduleNode , value );
596
+ final String name = toString (constantPathNode .child );
597
+ final RubyNode value = translateNodeOrDeadNode (node .value , "YARPTranslator#visitConstantPathWriteNode" );
598
+ final RubyNode rubyNode = new WriteConstantNode (name , moduleNode , value );
602
599
603
600
assignNodePositionInSource (node , rubyNode );
604
601
return rubyNode ;
You can’t perform that action at this time.
0 commit comments