groupString = getContext().getCoreLibrary().getNilObject();
}
values[n] = groupString;
final FrameSlot slot = frame.getFrameDescriptor().findFrameSlot("$" + n);
if (slot != null) {
frame.setObject(slot, groupString);
}
}
if (values.length > 0) {
final FrameSlot slot = frame.getFrameDescriptor().findFrameSlot("$+");
int nonNil = values.length - 1;
while (values[nonNil] == getContext().getCoreLibrary().getNilObject()) {
nonNil--;
}
if (slot != null) {
frame.setObject(slot, values[nonNil]);
}
}
final RubyMatchData matchObject = new RubyMatchData(context.getCoreLibrary().getMatchDataClass(), values);
final FrameSlot slot = frame.getFrameDescriptor().findFrameSlot("$~");
if (slot != null) {
frame.setObject(slot, matchObject);
}
return matcher.getBegin();
} else {
final FrameSlot slot = frame.getFrameDescriptor().findFrameSlot("$~");
if (slot != null) {
frame.setObject(slot, getContext().getCoreLibrary().getNilObject());
}