Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 package org.jruby.parser;
 
 import org.jruby.Ruby;

Allocate IR-friendly static scopes (it is also a marker for constructing IR-friendly dynamic scopes.
 
 public class IRStaticScopeFactory extends StaticScopeFactory {
    public IRStaticScopeFactory(Ruby runtime) {
        super(runtime);
    }
    @Override
    public StaticScope newBlockScope(StaticScope parent) {
        return new IRStaticScope(parenttruefalse);
    }
    @Override
    public StaticScope newBlockScope(StaticScope parentString[] names) {
        return new IRStaticScope(parentnamestruefalse);
    }
    @Override
    public StaticScope newEvalScope(StaticScope parent) {
        return new IRStaticScope(parenttruetrue);
    }
    @Override
    public StaticScope newEvalScope(StaticScope parentString[] names) {
        return new IRStaticScope(parentnamestruetrue);
    }
    @Override
    public StaticScope newLocalScope(StaticScope parent) {
        return new IRStaticScope(parentfalsefalse);
    }
    @Override
    public StaticScope newLocalScope(StaticScope parentString[] names) {
        return new IRStaticScope(parentnamesfalsefalse);
    }
    
    // We only call these from inside IR impl (IR is all or nothing)
    public static StaticScope newIRBlockScope(StaticScope parent) {
        return new IRStaticScope(parenttruefalse);
    }
    
    // We only call these from inside IR impl (IR is all or nothing)    
    public static StaticScope newIRLocalScope(StaticScope parent) {
        return new IRStaticScope(parentfalsefalse);
    }
    
    // We only call these from inside IR impl (IR is all or nothing)    
    public static StaticScope newIREvalScope(StaticScope parent) {
        return new IRStaticScope(parenttruetrue);
    }
    
New to GrepCode? Check out our FAQ X