Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jruby.ir.instructions.defined;
 
public class BackrefIsMatchDataInstr extends DefinedInstr {
    public BackrefIsMatchDataInstr(Variable result) {
        super(.result);
    }
    @Override
    public Instr cloneForInlining(InlinerInfo ii) {
        return new BackrefIsMatchDataInstr(ii.getRenamedVariable());
    }
    @Override
    public Object interpret(ThreadContext contextDynamicScope currDynScopeIRubyObject selfObject[] tempBlock block) {
        // SSS: FIXME: Or use this directly? "context.getCurrentScope().getBackRef(rt)" What is the diff??
        IRubyObject backref = Helpers.getBackref(context.runtimecontext);
        return context.runtime.newBoolean(RubyMatchData.class.isInstance(backref));
    }
    @Override
    public void visit(IRVisitor visitor) {
        visitor.BackrefIsMatchDataInstr(this);
    }
New to GrepCode? Check out our FAQ X