Examples of DAsgnNode


Examples of org.jruby.ast.DAsgnNode

                context.pushString("expression");
        }
    }

    public void compileDAsgn(Node node, BodyCompiler context) {
        final DAsgnNode dasgnNode = (DAsgnNode) node;

        CompilerCallback value = new CompilerCallback() {
            public void call(BodyCompiler context) {
                compile(dasgnNode.getValueNode(), context);
            }
        };
       
        context.getVariableCompiler().assignLocalVariable(dasgnNode.getIndex(), dasgnNode.getDepth(), value);
    }
View Full Code Here

Examples of org.jruby.ast.DAsgnNode

       
        context.getVariableCompiler().assignLocalVariable(dasgnNode.getIndex(), dasgnNode.getDepth(), value);
    }

    public void compileDAsgnAssignment(Node node, BodyCompiler context) {
        DAsgnNode dasgnNode = (DAsgnNode) node;

        context.getVariableCompiler().assignLocalVariable(dasgnNode.getIndex(), dasgnNode.getDepth());
    }
View Full Code Here

Examples of org.jruby.ast.DAsgnNode

       
        if (slot >= 0) {
            // mark as captured if from containing scope
            if (depth > 0) capture(slot);
       
            return new DAsgnNode(position, name, ((depth << 16) | slot), value);
        }

        return enclosingScope.assign(position, name, value, topScope, depth + 1);
    }
View Full Code Here

Examples of org.jruby.ast.DAsgnNode

    public AssignableNode addAssign(ISourcePosition position, String name, Node value) {
        int slot = addVariable(name);
       
        // No bit math to store level since we know level is zero for this case
        return new DAsgnNode(position, name, slot, value);
    }
View Full Code Here

Examples of org.jruby.ast.DAsgnNode

        switch (node.getNodeType()) {
            case ATTRASSIGNNODE:
                compileAttrAssignAssignment(node, context, expr);
                break;
            case DASGNNODE:
                DAsgnNode dasgnNode = (DAsgnNode)node;
                context.getVariableCompiler().assignLocalVariable(dasgnNode.getIndex(), dasgnNode.getDepth(), expr);
                break;
            case CLASSVARASGNNODE:
                compileClassVarAsgnAssignment(node, context, expr);
                break;
            case CLASSVARDECLNODE:
View Full Code Here

Examples of org.jruby.ast.DAsgnNode

                    }
                });
    }

    public void compileDAsgn(Node node, BodyCompiler context, boolean expr) {
        final DAsgnNode dasgnNode = (DAsgnNode) node;

        CompilerCallback value = new CompilerCallback() {
            public void call(BodyCompiler context) {
                compile(dasgnNode.getValueNode(), context, true);
            }
        };
       
        context.getVariableCompiler().assignLocalVariable(dasgnNode.getIndex(), dasgnNode.getDepth(), value, expr);
    }
View Full Code Here

Examples of org.jruby.ast.DAsgnNode

       
        context.getVariableCompiler().assignLocalVariable(dasgnNode.getIndex(), dasgnNode.getDepth(), value, expr);
    }

    public void compileDAsgnAssignment(Node node, BodyCompiler context, boolean expr) {
        DAsgnNode dasgnNode = (DAsgnNode) node;

        context.getVariableCompiler().assignLocalVariable(dasgnNode.getIndex(), dasgnNode.getDepth(), expr);
    }
View Full Code Here

Examples of org.jruby.ast.DAsgnNode

                break;
            case CONSTDECLNODE:
                buildConstDeclAssignment((ConstDeclNode) node, s, v);
                break;
            case DASGNNODE: {
                DAsgnNode variable = (DAsgnNode) node;
                int depth = variable.getDepth();
                // SSS FIXME: Isn't it sufficient to use "getLocalVariable(variable.getName())"?
                s.addInstr(new CopyInstr(getScopeNDown(s, depth).getLocalVariable(variable.getName()), v));
                break;
            }
            case GLOBALASGNNODE:
                s.addInstr(new PutGlobalVarInstr(((GlobalAsgnNode)node).getName(), v));
                break;
View Full Code Here

Examples of org.jruby.ast.DAsgnNode

// Ruby 1.8 is the buggy semantics if I understand correctly.
//
// The semantics of how this shadows other variables outside the block needs
// to be figured out during live var analysis.
            case DASGNNODE: {
                DAsgnNode dynamicAsgn = (DAsgnNode) node;
                // SSS FIXME: Isn't it sufficient to use "getLocalVariable(variable.getName())"?
                v = getScopeNDown(s, dynamicAsgn.getDepth()).getLocalVariable(dynamicAsgn.getName());
                s.addInstr(new ReceiveClosureArgInstr(v, argIndex, isSplat));
                break;
            }
            // SSS FIXME: What is the difference between ClassVarAsgnNode & ClassVarDeclNode
            case CLASSVARASGNNODE:
View Full Code Here

Examples of org.jruby.ast.DAsgnNode

       
        if (slot >= 0) {
            // mark as captured if from containing scope
            if (depth > 0) capture(slot);
       
            return new DAsgnNode(position, name, ((depth << 16) | slot), value);
        }

        return enclosingScope.assign(position, name, value, topScope, depth + 1);
    }
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.