Package com.bazaarvoice.jless.ast.node

Examples of com.bazaarvoice.jless.ast.node.PlaceholderNode


@Test
public class NodeTest {

    public void testChildIterators() {
        InternalNode p = new PlaceholderNode();
        p.addChild(new SimpleNode("c1"));
        p.addChild(new SimpleNode("c2"));
        p.addChild(new SimpleNode("c3"));
        p.addChild(new SimpleNode("c4"));

        RandomAccessListIterator i1 = p.pushChildIterator();
        i1.next();
        RandomAccessListIterator i2 = p.pushChildIterator();
        i2.next();
        i2.next();
        RandomAccessListIterator i3 = p.pushChildIterator();
        i3.next();
        i3.next();
        i3.next();

        Assert.assertEquals(i1.nextIndex(), 1);
        Assert.assertEquals(i2.nextIndex(), 2);
        Assert.assertEquals(i3.nextIndex(), 3);
       
        p.addChild(2, new SimpleNode("c2a"));

        Assert.assertEquals(i1.nextIndex(), 1);
        Assert.assertEquals(i2.nextIndex(), 3);
        Assert.assertEquals(i3.nextIndex(), 4);
    }
View Full Code Here


                        Sp0(), FirstOf(';', Sequence(Ws0(), Test('}' ))),
                        peek(1).addChild(pop())
                ),
                // Empty rules are ignored
                Sequence(
                        Ident(), push(new PlaceholderNode()), Ws0(),
                        ':', Ws0(),
                        ';'
                )
        );
    }
View Full Code Here

     * scope is cloned and placed onto the stack in place of the mixin reference. Additionally,
     * any arguments are applied to the mixin's scope.
     */
    boolean resolveMixinReference(String name, ArgumentsNode arguments) {
        if (!isParserTranslationEnabled()) {
            return push(new PlaceholderNode(new SimpleNode(name)));
        }

        // Walk down the stack, looking for a scope node that knows about a given rule set
        for (Node node : getContext().getValueStack()) {
            if (!(node instanceof ScopeNode)) {
View Full Code Here

TOP

Related Classes of com.bazaarvoice.jless.ast.node.PlaceholderNode

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.