Skip to content

Commit 4e86fcd

Browse files
committed
[Truffle] Implemented MatchData#to_s.
1 parent 8fbe84a commit 4e86fcd

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

core/src/main/java/org/jruby/truffle/nodes/core/MatchDataNodes.java

+19
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,25 @@ public RubyArray toA(RubyMatchData matchData) {
179179
}
180180
}
181181

182+
@CoreMethod(names = "to_s")
183+
public abstract static class ToSNode extends CoreMethodNode {
184+
185+
public ToSNode(RubyContext context, SourceSection sourceSection) {
186+
super(context, sourceSection);
187+
}
188+
189+
public ToSNode(ToSNode prev) {
190+
super(prev);
191+
}
192+
193+
@Specialization
194+
public RubyString toA(RubyMatchData matchData) {
195+
notDesignedForCompilation();
196+
197+
return matchData.getGlobal();
198+
}
199+
}
200+
182201
@CoreMethod(names = "values_at", argumentsAsArray = true)
183202
public abstract static class ValuesAtNode extends CoreMethodNode {
184203

spec/truffle/tags/core/matchdata/to_s_tags.txt

-1
This file was deleted.

0 commit comments

Comments
 (0)