Skip to content

Commit c7d57c5

Browse files
committed
chilled strings hooked up
1 parent 75fbe91 commit c7d57c5

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/main/java/org/jruby/prism/builder/IRBuilderPrism.java

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,13 @@
2424
import org.jruby.ir.Tuple;
2525
import org.jruby.ir.builder.IRBuilder;
2626
import org.jruby.ir.builder.LazyMethodDefinition;
27+
import org.jruby.ir.builder.StringStyle;
2728
import org.jruby.ir.instructions.*;
2829
import org.jruby.ir.instructions.defined.GetErrorInfoInstr;
2930
import org.jruby.ir.instructions.defined.RestoreErrorInfoInstr;
3031
import org.jruby.ir.operands.Array;
3132
import org.jruby.ir.operands.Bignum;
33+
import org.jruby.ir.operands.ChilledString;
3234
import org.jruby.ir.operands.Complex;
3335
import org.jruby.ir.operands.CurrentScope;
3436
import org.jruby.ir.operands.Fixnum;
@@ -1435,7 +1437,7 @@ private RegexpOptions calculateRegexpOptions(short flags) {
14351437
}
14361438

14371439
private Operand buildInterpolatedString(Variable result, InterpolatedStringNode node) {
1438-
return buildDStr(result, node.parts, getEncoding(), false, getLine(node));
1440+
return buildDStr(result, node.parts, getEncoding(), StringStyle.Chilled, getLine(node));
14391441
}
14401442

14411443
private Operand buildInterpolatedSymbol(Variable result, InterpolatedSymbolNode node) {
@@ -1954,11 +1956,10 @@ private Operand buildSplat(Operand value) {
19541956
}
19551957

19561958
private Operand buildString(StringNode node) {
1957-
if (node.isFrozen()) {
1958-
return new FrozenString(bytelistFrom(node), CR_UNKNOWN, scope.getFile(), getLine(node));
1959-
} else {
1960-
return copy(temp(), new MutableString(bytelistFrom(node), CR_UNKNOWN, scope.getFile(), getLine(node)));
1961-
}
1959+
if (node.isMutable()) return copy(temp(), new MutableString(bytelistFrom(node), CR_UNKNOWN, scope.getFile(), getLine(node)));
1960+
if (node.isFrozen()) return new FrozenString(bytelistFrom(node), CR_UNKNOWN, scope.getFile(), getLine(node));
1961+
1962+
return new ChilledString(bytelistFrom(node), CR_UNKNOWN, scope.getFile(), getLine(node));
19621963
}
19631964

19641965
private Operand buildFrozenString(StringNode node) {

0 commit comments

Comments
 (0)