Package org.jruby.ast

Examples of org.jruby.ast.Match2CaptureNode


            super.compileMatch2(node, context, expr);
            return;
        }

        // match with capture logic
        final Match2CaptureNode matchNode = (Match2CaptureNode) node;

        compile(matchNode.getReceiverNode(), context,true);
        CompilerCallback value = new CompilerCallback() {
            public void call(BodyCompiler context) {
                compile(matchNode.getValueNode(), context,true);
            }
        };

        context.match2Capture(value, matchNode.getScopeOffsets());
        // TODO: don't require pop
        if (!expr) context.consumeCurrentValue();
    }
View Full Code Here


            return new Match2Node(firstNode.getPosition(), firstNode, secondNode);
        } else if (firstNode instanceof RegexpNode) {
            int[] locals = allocateNamedLocals((RegexpNode) firstNode);

            if (locals.length > 0) {
                return new Match2CaptureNode(firstNode.getPosition(), firstNode, secondNode, locals);
            } else {
                return new Match2Node(firstNode.getPosition(), firstNode, secondNode);
            }
        } else if (secondNode instanceof DRegexpNode || secondNode instanceof RegexpNode) {
            return new Match3Node(firstNode.getPosition(), secondNode, firstNode);
View Full Code Here

            if (locals.size() > 0) {
                int[] primitiveLocals = new int[locals.size()];
                for (int i = 0; i < primitiveLocals.length; i++) {
                    primitiveLocals[i] = locals.get(i);
                }
                return new Match2CaptureNode(firstNode.getPosition(), firstNode, secondNode, primitiveLocals);
            } else {
                return new Match2Node(firstNode.getPosition(), firstNode, secondNode);
            }
        } else if (secondNode instanceof DRegexpNode || secondNode instanceof RegexpNode) {
            return new Match3Node(firstNode.getPosition(), secondNode, firstNode);
View Full Code Here

            super.compileMatch2(node, context, expr);
            return;
        }

        // match with capture logic
        final Match2CaptureNode matchNode = (Match2CaptureNode) node;

        compile(matchNode.getReceiverNode(), context,true);
        CompilerCallback value = new CompilerCallback() {
            public void call(BodyCompiler context) {
                compile(matchNode.getValueNode(), context,true);
            }
        };

        context.match2Capture(value, matchNode.getScopeOffsets(), true);
        // TODO: don't require pop
        if (!expr) context.consumeCurrentValue();
    }
View Full Code Here

TOP

Related Classes of org.jruby.ast.Match2CaptureNode

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.