File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
src/main/java/org/truffleruby/core/rope Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 14
14
import org .truffleruby .builtins .CoreMethod ;
15
15
import org .truffleruby .builtins .CoreMethodArrayArgumentsNode ;
16
16
import org .truffleruby .builtins .CoreModule ;
17
+ import org .truffleruby .cext .CExtNodes ;
17
18
import org .truffleruby .core .rope .ConcatRope .ConcatState ;
18
19
import org .truffleruby .core .string .RubyString ;
19
20
import org .truffleruby .core .string .StringNodes ;
@@ -164,6 +165,18 @@ protected RubyString flattenRope(Object string,
164
165
165
166
}
166
167
168
+ @ CoreMethod (names = "convert_to_native" , onSingleton = true , required = 1 )
169
+ public abstract static class NativeRopeNode extends CoreMethodArrayArgumentsNode {
170
+
171
+ @ Specialization
172
+ protected RubyString nativeRope (RubyString string ,
173
+ @ Cached CExtNodes .StringToNativeNode toNativeNode ) {
174
+ toNativeNode .executeToNative (string );
175
+ return string ;
176
+ }
177
+
178
+ }
179
+
167
180
/* Truffle.create_simple_string creates a string 'test' without any part of the string escaping. Useful for testing
168
181
* compilation of String because most other ways to construct a string can currently escape. */
169
182
You can’t perform that action at this time.
0 commit comments