Package org.jruby.ast

Examples of org.jruby.ast.Match3Node


        context.match2();
    }

    public void compileMatch3(Node node, BodyCompiler context) {
        Match3Node matchNode = (Match3Node) node;

        compile(matchNode.getReceiverNode(), context);
        compile(matchNode.getValueNode(), context);

        context.match3();
    }
View Full Code Here


            inspect(match2Node.getReceiverNode());
            inspect(match2Node.getValueNode());
            setFlag(BACKREF);
            break;
        case MATCH3NODE:
            Match3Node match3Node = (Match3Node)node;
            inspect(match3Node.getReceiverNode());
            inspect(match3Node.getValueNode());
            setFlag(BACKREF);
            break;
        case MODULENODE:
            setFlag(CLASS);
            break;
View Full Code Here

    public Node getMatchNode(Node firstNode, Node secondNode) {
        if (firstNode instanceof DRegexpNode || firstNode instanceof RegexpNode) {
            return new Match2Node(firstNode.getPosition(), firstNode, secondNode);
        } else if (secondNode instanceof DRegexpNode || secondNode instanceof RegexpNode) {
            return new Match3Node(firstNode.getPosition(), secondNode, firstNode);
        }

        return getOperatorCallNode(firstNode, "=~", secondNode);
    }
View Full Code Here

            inspect(match2Node.getReceiverNode());
            inspect(match2Node.getValueNode());
            setFlag(node, BACKREF);
            break;
        case MATCH3NODE:
            Match3Node match3Node = (Match3Node)node;
            inspect(match3Node.getReceiverNode());
            inspect(match3Node.getValueNode());
            setFlag(node, BACKREF);
            break;
        case MODULENODE:
            setFlag(node, CLASS);
            inspect(((ModuleNode)node).getCPath());
View Full Code Here

        // TODO: don't require pop
        if (!expr) context.consumeCurrentValue();
    }

    public void compileMatch3(Node node, BodyCompiler context, boolean expr) {
        Match3Node matchNode = (Match3Node) node;

        compile(matchNode.getReceiverNode(), context,true);
        compile(matchNode.getValueNode(), context,true);

        context.match3();
        // TODO: don't require pop
        if (!expr) context.consumeCurrentValue();
    }
View Full Code Here

                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);
        }

        return getOperatorCallNode(firstNode, "=~", secondNode);
    }
View Full Code Here

    public Node getMatchNode(Node firstNode, Node secondNode) {
        if (firstNode instanceof DRegexpNode || firstNode instanceof RegexpNode) {
            return new Match2Node(firstNode.getPosition(), firstNode, secondNode);
        } else if (secondNode instanceof DRegexpNode || secondNode instanceof RegexpNode) {
            return new Match3Node(firstNode.getPosition(), secondNode, firstNode);
        }

        return getOperatorCallNode(firstNode, "=~", secondNode);
    }
View Full Code Here

                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);
        }

        return getOperatorCallNode(firstNode, "=~", secondNode);
    }
View Full Code Here

TOP

Related Classes of org.jruby.ast.Match3Node

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.