public static IRubyObject getBackref(Ruby runtime, ThreadContext context) { IRubyObject backref = context.getBackRef(); if (backref instanceof RubyMatchData) ((RubyMatchData)backref).use(); return backref; }
public static IRubyObject backref(ThreadContext context) { IRubyObject backref = context.getBackRef(); if(backref instanceof RubyMatchData) { ((RubyMatchData)backref).use(); } return backref; }
public static IRubyObject getBackRef(ThreadContext context) { IRubyObject backref = context.getBackRef(); if (backref instanceof RubyMatchData) ((RubyMatchData) backref).use(); return backref; }
@JIT @Interp public static IRubyObject isDefinedBackref(ThreadContext context, IRubyObject definedMessage) { return RubyMatchData.class.isInstance(context.getBackRef()) ? definedMessage : context.nil; }
@Override public IRubyObject get() { return RubyRegexp.match_post(runtime.getCurrentContext().getBackRef()); } }
@Override public RubyString definition(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock) { IRubyObject backref = context.getBackRef(); if (backref instanceof RubyMatchData) { return runtime.getDefinedMessage(runtime.is1_9() ? DefinedMessage.GLOBAL_VARIABLE : definedMessage); } return null; } }
@Override public RubyString definition(Ruby runtime, ThreadContext context, IRubyObject self, Block aBlock) { IRubyObject backref = context.getBackRef(); if (backref instanceof RubyMatchData) { return runtime.getDefinedMessage(runtime.is1_9() ? DefinedMessage.GLOBAL_VARIABLE : definedMessage); } return null; } }
@Override public IRubyObject get() { return RubyRegexp.match_pre(runtime.getCurrentContext().getBackRef()); } }
@Override public IRubyObject get() { return RubyRegexp.last_match(runtime.getCurrentContext().getBackRef()); } }
@Override public IRubyObject get() { return RubyRegexp.match_last(runtime.getCurrentContext().getBackRef()); } }
@Override public IRubyObject get() { return RubyRegexp.last_match(runtime.getCurrentContext().getBackRef()); } }
/** rb_reg_s_last_match / match_getter * */ @JRubyMethod(name = "last_match", meta = true, reads = BACKREF) public static IRubyObject last_match_s(ThreadContext context, IRubyObject recv) { IRubyObject match = context.getBackRef(); if (match instanceof RubyMatchData) ((RubyMatchData)match).use(); return match; }
private IRubyObject subpat(ThreadContext context, RubyRegexp regex) { int result = regex.search(context, this, 0, false); if (result >= 0) { return RubyRegexp.nth_match(0, context.getBackRef()); } return context.nil; }
@Override public IRubyObject get() { return RubyRegexp.last_match(runtime.getCurrentContext().getBackRef()); } }
@Override public IRubyObject get() { return RubyRegexp.match_post(runtime.getCurrentContext().getBackRef()); } }
@Override public IRubyObject get() { return RubyRegexp.match_last(runtime.getCurrentContext().getBackRef()); } }
private IRubyObject subpat(ThreadContext context, RubyRegexp regex, IRubyObject backref) { int result = regex.search(context, this, 0, false); if (result >= 0) { RubyMatchData match = (RubyMatchData)context.getBackRef(); return RubyRegexp.nth_match(match.backrefNumber(context.runtime, backref), match); } return context.nil; }
public static IRubyObject setCapturedVar(ThreadContext context, IRubyObject matchRes, String id) { if (matchRes.isNil()) return context.nil; IRubyObject backref = context.getBackRef(); return RubyRegexp.nth_match(((RubyMatchData) backref).getNameToBackrefNumber(id), backref); }
@JIT @Interp public static IRubyObject isDefinedNthRef(ThreadContext context, int matchNumber, IRubyObject definedMessage) { IRubyObject backref = context.getBackRef(); if (backref instanceof RubyMatchData) { if (!((RubyMatchData) backref).group(matchNumber).isNil()) { return definedMessage; } } return context.nil; }
/** rb_reg_s_last_match * */ @JRubyMethod(name = "last_match", meta = true, reads = BACKREF) public static IRubyObject last_match_s(ThreadContext context, IRubyObject recv, IRubyObject nth) { IRubyObject match = context.getBackRef(); if (match.isNil()) return match; return nth_match(((RubyMatchData)match).backrefNumber(context.runtime, nth), match); }