File tree 2 files changed +23
-1
lines changed
truffle/src/main/java/org/jruby/truffle/nodes/core
2 files changed +23
-1
lines changed Original file line number Diff line number Diff line change @@ -1982,7 +1982,7 @@ public RubyString chr(RubyString string) {
1982
1982
}
1983
1983
}
1984
1984
1985
- static class StringNodesHelper {
1985
+ public static class StringNodesHelper {
1986
1986
1987
1987
@ TruffleBoundary
1988
1988
public static ByteList capitalize (RubyString string ) {
Original file line number Diff line number Diff line change 17
17
import org .jruby .truffle .runtime .core .RubyProc ;
18
18
import org .jruby .truffle .runtime .core .RubyString ;
19
19
import org .jruby .truffle .runtime .core .RubySymbol ;
20
+ import org .jruby .util .ByteList ;
20
21
21
22
@ CoreClass (name = "Symbol" )
22
23
public abstract class SymbolNodes {
@@ -230,4 +231,25 @@ public int size(RubySymbol symbol) {
230
231
231
232
}
232
233
234
+ @ CoreMethod (names = { "swapcase" })
235
+ public abstract static class SwapcaseNode extends CoreMethodNode {
236
+
237
+ public SwapcaseNode (RubyContext context , SourceSection sourceSection ) {
238
+ super (context , sourceSection );
239
+ }
240
+
241
+ public SwapcaseNode (SwapcaseNode prev ) {
242
+ super (prev );
243
+ }
244
+
245
+ @ Specialization
246
+ public RubySymbol swapcase (RubySymbol symbol ) {
247
+ notDesignedForCompilation ();
248
+
249
+ ByteList byteList = StringNodes .StringNodesHelper .swapcase (symbol .toRubyString ());
250
+ return getContext ().newSymbol (byteList );
251
+ }
252
+
253
+ }
254
+
233
255
}
You can’t perform that action at this time.
0 commit comments