Package org.jruby.runtime.assigner

Examples of org.jruby.runtime.assigner.Pre0Rest0Post0Assigner


        boolean hasBlock = block != null;

        if (varNode == null || varNode instanceof ZeroArgNode) { // No argument blocks
            noargblock = !hasBlock;
            assigner = hasBlock ? new Pre0Rest0Post0BlockAssigner(block) :
                new Pre0Rest0Post0Assigner();
        } else if (varNode instanceof MultipleAsgnNode) {
            MultipleAsgnNode masgn = (MultipleAsgnNode) varNode;
            int preCount = masgn.getPreCount();
            boolean isRest = masgn.getRest() != null;
            Node rest = masgn.getRest();
            ListNode pre = masgn.getPre();
            noargblock = false;

            switch(preCount) {
                case 0// Not sure if this is actually possible, but better safe than sorry
                    if (isRest) {
                        assigner = hasBlock ? new Pre0Rest1Post0BlockAssigner(rest, block) :
                            new Pre0Rest1Post0Assigner(rest);
                    } else if (hasBlock) {
                        assigner = new Pre0Rest0Post0BlockAssigner(block);
                    } else {
                        noargblock = true;
                        assigner = new Pre0Rest0Post0Assigner();
                    }
                    break;
                case 1:
                    if (isRest) {
                        assigner = hasBlock ? new Pre1Rest1Post0BlockAssigner(pre.get(0), rest, block) :
View Full Code Here


        boolean hasBlock = block != null;

        if (varNode == null || varNode instanceof ZeroArgNode) { // No argument blocks
            noargblock = !hasBlock;
            assigner = hasBlock ? new Pre0Rest0Post0BlockAssigner(block) :
                new Pre0Rest0Post0Assigner();
        } else if (varNode instanceof MultipleAsgnNode) {
            MultipleAsgnNode masgn = (MultipleAsgnNode) varNode;
            int preCount = masgn.getPreCount();
            boolean isRest = masgn.getRest() != null;
            Node rest = masgn.getRest();
            ListNode pre = masgn.getPre();
            noargblock = false;

            switch(preCount) {
                case 0// Not sure if this is actually possible, but better safe than sorry
                    if (isRest) {
                        assigner = hasBlock ? new Pre0Rest1Post0BlockAssigner(rest, block) :
                            new Pre0Rest1Post0Assigner(rest);
                    } else if (hasBlock) {
                        assigner = new Pre0Rest0Post0BlockAssigner(block);
                    } else {
                        noargblock = true;
                        assigner = new Pre0Rest0Post0Assigner();
                    }
                    break;
                case 1:
                    if (isRest) {
                        assigner = hasBlock ? new Pre1Rest1Post0BlockAssigner(pre.get(0), rest, block) :
View Full Code Here

TOP

Related Classes of org.jruby.runtime.assigner.Pre0Rest0Post0Assigner

Copyright © 2018 www.massapicom. 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.