Examples of RubyModule


Examples of org.cx4a.rsense.ruby.RubyModule

    public static Vertex classVarDeclaration(Graph graph, ClassVarDeclNode node) {
        return classVarDeclaration(graph, node, null);
    }
   
    public static Vertex classVarDeclaration(Graph graph, ClassVarDeclNode node, Vertex src) {
        RubyModule klass = graph.getRuntime().getContext().getFrameModule();
        if (src == null) {
            src = graph.createVertex(node.getValueNode());
        }
        VertexHolder holder = (VertexHolder) klass.getClassVar(node.getName());
        if (holder == null) {
            holder = graph.createFreeVertexHolder();
            klass.setClassVar(node.getName(), holder);
        }
        // Clear older types (performance issue)
        holder.getVertex().getTypeSet().clear();
        graph.addEdgeAndPropagate(src, holder.getVertex());
        return src;
View Full Code Here

Examples of org.jruby.RubyModule

    }
   
    public RubyModule popRubyClass() {
        int index = parentIndex;
        RubyModule[] stack = parentStack;
        RubyModule ret = stack[index];
        stack[index] = null;
        parentIndex = index - 1;
        return ret;
    }
View Full Code Here

Examples of org.jruby.RubyModule

    }
   
    public RubyModule getRubyClass() {
        assert !(parentIndex == -1) : "Trying to get RubyClass from empty stack";
       
        RubyModule parentModule = parentStack[parentIndex];
       
        return parentModule.getNonIncludedClass();
    }
View Full Code Here

Examples of org.jruby.RubyModule

        return parentModule.getNonIncludedClass();
    }
   
    public RubyModule getImmediateBindingRubyClass() {
        int index = parentIndex;
        RubyModule parentModule = null;
        parentModule = parentStack[index];
        return parentModule.getNonIncludedClass();
    }
View Full Code Here

Examples of org.jruby.RubyModule

        return parentModule.getNonIncludedClass();
    }

    public RubyModule getEvalBindingRubyClass() {
        int index = parentIndex;
        RubyModule parentModule = null;
        if(index == 0) {
            parentModule = parentStack[index];
        } else {
            parentModule = parentStack[index-1];
        }
        return parentModule.getNonIncludedClass();
    }
View Full Code Here

Examples of org.jruby.RubyModule

    public boolean getConstantDefined(String internedName) {
        IRubyObject result;
       
        // flipped from while to do to search current class first
        for (StaticScope scope = getCurrentScope().getStaticScope(); scope != null; scope = scope.getPreviousCRefScope()) {
            RubyModule module = scope.getModule();
            if ((result = module.fastFetchConstant(internedName)) != null) {
                if (result != RubyObject.UNDEF) return true;
                return runtime.getLoadService().autoloadFor(module.getName() + "::" + internedName) != null;
            }
        }
       
        return getCurrentScope().getStaticScope().getModule().fastIsConstantDefined(internedName);
    }
View Full Code Here

Examples of org.jruby.RubyModule

    /**
     * Used by the evaluator and the compiler to set a constant by name
     * This is for a null const decl
     */
    public IRubyObject setConstantInCurrent(String internedName, IRubyObject result) {
        RubyModule module;

        if ((module = getCurrentScope().getStaticScope().getModule()) != null) {
            module.fastSetConstant(internedName, result);
            return result;
        }

        // TODO: wire into new exception handling mechanism
        throw runtime.newTypeError("no class/module to define constant");
View Full Code Here

Examples of org.jruby.RubyModule

     */
    public IRubyObject setConstantInModule(String internedName, IRubyObject target, IRubyObject result) {
        if (!(target instanceof RubyModule)) {
            throw runtime.newTypeError(target.toString() + " is not a class/module");
        }
        RubyModule module = (RubyModule)target;
        module.fastSetConstant(internedName, result);
       
        return result;
    }
View Full Code Here

Examples of org.jruby.RubyModule

        popFrame();
    }
   
    public void preMethodFrameAndScope(RubyModule clazz, String name, IRubyObject self, Block block,
            StaticScope staticScope) {
        RubyModule implementationClass = staticScope.getModule();
        // FIXME: This is currently only here because of some problems with IOOutputStream writing to a "bare" runtime without a proper scope
        if (implementationClass == null) {
            implementationClass = clazz;
        }
        pushCallFrame(clazz, name, self, block);
View Full Code Here

Examples of org.jruby.RubyModule

        pushRubyClass(implementationClass);
    }
   
    public void preMethodFrameAndDummyScope(RubyModule clazz, String name, IRubyObject self, Block block,
            StaticScope staticScope) {
        RubyModule implementationClass = staticScope.getModule();
        // FIXME: This is currently only here because of some problems with IOOutputStream writing to a "bare" runtime without a proper scope
        if (implementationClass == null) {
            implementationClass = clazz;
        }
        pushCallFrame(clazz, name, self, block);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.