File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
src/main/java/org/truffleruby/parser Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -520,6 +520,7 @@ public RubyNode visitInterpolatedStringNode(Nodes.InterpolatedStringNode node) {
520
520
final RubyNode rubyNode = new StringLiteralNode (cachedTString , Encodings .UTF_8 );
521
521
522
522
assignNodePositionInSource (node , rubyNode );
523
+ copyNewlineFlag (s , rubyNode );
523
524
524
525
return rubyNode ;
525
526
}
@@ -548,6 +549,7 @@ public RubyNode visitInterpolatedSymbolNode(Nodes.InterpolatedSymbolNode node) {
548
549
final RubyNode rubyNode = new ObjectLiteralNode (symbol );
549
550
550
551
assignNodePositionInSource (node , rubyNode );
552
+ copyNewlineFlag (s , rubyNode );
551
553
552
554
return rubyNode ;
553
555
}
@@ -946,6 +948,13 @@ private String toString(Nodes.SymbolNode node) {
946
948
947
949
private void assignNodePositionInSource (Nodes .Node yarpNode , RubyNode rubyNode ) {
948
950
rubyNode .unsafeSetSourceSection (yarpNode .startOffset , yarpNode .length );
951
+ copyNewlineFlag (yarpNode , rubyNode );
952
+ }
953
+
954
+ private void copyNewlineFlag (Nodes .Node yarpNode , RubyNode rubyNode ) {
955
+ if (yarpNode .hasNewLineFlag ()) {
956
+ rubyNode .unsafeSetIsNewLine ();
957
+ }
949
958
}
950
959
951
960
}
You can’t perform that action at this time.
0 commit comments