Examples of DynamicScope


Examples of org.jruby.runtime.DynamicScope

    /**
    *  Description of the RubyMethod
    */
    public void initTopLocalVariables() {
        DynamicScope scope = configuration.getScope();
        currentScope = scope.getStaticScope();
       
        result.setScope(scope);
    }
View Full Code Here

Examples of org.jruby.runtime.DynamicScope

            prepareArguments(context, runtime, args);
            getArity().checkArity(runtime, args);

            if (runtime.hasEventHooks()) traceCall(context, runtime, name);

            DynamicScope scope = context.getCurrentScope();
           
            // Why not setArgValues
            scope.setArgValues(args, args.length);

            return YARVMachine.INSTANCE.exec(context, self, iseq.body);
        } catch (JumpException.ReturnJump rj) {
          if (rj.getTarget() == this) return (IRubyObject) rj.getValue();
           
View Full Code Here

Examples of org.jruby.runtime.DynamicScope

    public static IRubyObject convert(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2) {
        return convertCommon(context, recv, a1, a2);
    }
   
    private static IRubyObject convertCommon(ThreadContext context, IRubyObject recv, IRubyObject a1, IRubyObject a2) {
        DynamicScope scope = context.getCurrentScope();
        IRubyObject backref = scope.getBackRef(context.getRuntime());
        if (backref instanceof RubyMatchData) ((RubyMatchData)backref).use();

        if (a1 instanceof RubyString) a1 = str_to_c_strict(context, a1);
        if (a2 instanceof RubyString) a2 = str_to_c_strict(context, a2);

        scope.setBackRef(backref);

        if (a1 instanceof RubyComplex) {
            RubyComplex a1Complex = (RubyComplex)a1;
            if (k_exact_p(a1Complex.image) && f_zero_p(context, a1Complex.image)) {
                a1 = a1Complex.real;
View Full Code Here

Examples of org.jruby.runtime.DynamicScope

        // root our parsing scope with a dummy scope
        StaticScope topStaticScope = new LocalStaticScope(null);
        topStaticScope.setModule(container.getProvider().getRuntime().getObject());

        DynamicScope currentScope = new ManyVarsDynamicScope(topStaticScope, null);
        String[] names4Injection = container.getVarMap().getLocalVarNames();
        if (names4Injection == null || names4Injection.length == 0) {
            scope =
                new ManyVarsDynamicScope(new EvalStaticScope(currentScope.getStaticScope()), currentScope);
        } else {
            scope =
                new ManyVarsDynamicScope(new EvalStaticScope(currentScope.getStaticScope(), names4Injection), currentScope);
        }

        // JRUBY-5501: ensure we've set up a cref for the scope too
        scope.getStaticScope().determineModule();
       
View Full Code Here

Examples of org.jruby.runtime.DynamicScope

    public int getPreCount() {
        return preCount;
    }

    public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject[] args, Block block) {
        DynamicScope scope = context.getCurrentScope();

        // Bind 'normal' parameter values to the local scope for this method.
        if (!hasMasgnArgs) {
            // no arg grouping, just use bulk assignment methods
            if (preCount > 0) scope.setArgValues(args, Math.min(args.length, preCount));
            if (postCount > 0 && args.length > preCount) scope.setEndArgValues(args, postIndex, Math.min(args.length - preCount, postCount));
        } else {
            masgnAwareArgAssign(context, runtime, self, args, block, scope);
        }

        // optArgs and restArgs require more work, so isolate them and ArrayList creation here
View Full Code Here

Examples of org.jruby.runtime.DynamicScope

            }
        }
    }

    public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, Block block) {
        DynamicScope scope = context.getCurrentScope();

        if (isSimple) {
            scope.setArgValues();
        } else {
            prepare(context, runtime, self, IRubyObject.NULL_ARRAY, block);
        }
        if (getBlock() != null) processBlockArg(scope, runtime, block);
    }
View Full Code Here

Examples of org.jruby.runtime.DynamicScope

            prepare(context, runtime, self, IRubyObject.NULL_ARRAY, block);
        }
        if (getBlock() != null) processBlockArg(scope, runtime, block);
    }
    public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, Block block) {
        DynamicScope scope = context.getCurrentScope();

        if (isSimple) {
            scope.setArgValues(arg0);
        } else {
            prepare(context, runtime, self, new IRubyObject[] {arg0}, block);
        }
        if (getBlock() != null) processBlockArg(scope, runtime, block);
    }
View Full Code Here

Examples of org.jruby.runtime.DynamicScope

            prepare(context, runtime, self, new IRubyObject[] {arg0}, block);
        }
        if (getBlock() != null) processBlockArg(scope, runtime, block);
    }
    public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, IRubyObject arg1, Block block) {
        DynamicScope scope = context.getCurrentScope();

        if (isSimple) {
            scope.setArgValues(arg0, arg1);
        } else {
            prepare(context, runtime, self, new IRubyObject[] {arg0, arg1}, block);
        }
        if (getBlock() != null) processBlockArg(scope, runtime, block);
    }
View Full Code Here

Examples of org.jruby.runtime.DynamicScope

            prepare(context, runtime, self, new IRubyObject[] {arg0, arg1}, block);
        }
        if (getBlock() != null) processBlockArg(scope, runtime, block);
    }
    public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, Block block) {
        DynamicScope scope = context.getCurrentScope();

        if (isSimple) {
            scope.setArgValues(arg0, arg1, arg2);
        } else {
            prepare(context, runtime, self, new IRubyObject[] {arg0, arg1, arg2}, block);
        }
        if (getBlock() != null) processBlockArg(scope, runtime, block);
    }
View Full Code Here

Examples of org.jruby.runtime.DynamicScope

            prepare(context, runtime, self, new IRubyObject[] {arg0, arg1, arg2}, block);
        }
        if (getBlock() != null) processBlockArg(scope, runtime, block);
    }
    public void prepare(ThreadContext context, Ruby runtime, IRubyObject self, IRubyObject arg0, IRubyObject arg1, IRubyObject arg2, IRubyObject arg3, Block block) {
        DynamicScope scope = context.getCurrentScope();

        if (isSimple) {
            scope.setArgValues(arg0, arg1, arg2, arg3);
        } else {
            prepare(context, runtime, self, new IRubyObject[] {arg0, arg1, arg2, arg3}, block);
        }
        if (getBlock() != null) processBlockArg(scope, runtime, 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.