Package com.google.template.soy.exprtree.OperatorNodes

Examples of com.google.template.soy.exprtree.OperatorNodes.NegativeOpNode



  public void testParseOperators() throws Exception {

    ExprRootNode<?> expr = (new ExpressionParser("-11")).parseExpression();
    NegativeOpNode negOp = (NegativeOpNode) expr.getChild(0);
    assertEquals(11, ((IntegerNode) negOp.getChild(0)).getValue());

    expr = (new ExpressionParser("not false")).parseExpression();
    NotOpNode notOp = (NotOpNode) expr.getChild(0);
    assertEquals(false, ((BooleanNode) notOp.getChild(0)).getValue());
View Full Code Here


    MinusOpNode n1 = new MinusOpNode();
    MinusOpNode n2 = new MinusOpNode();
    n0.addChild(n1);
    n0.addChild(n2);
    // Children of n1.
    NegativeOpNode n3 = new NegativeOpNode();
    n1.addChild(x);
    n1.addChild(n3);
    // Child of n3.
    n3.addChild(x);
    // Children of n2.
    NegativeOpNode n4 = new NegativeOpNode();
    n2.addChild(n4);
    n2.addChild(x);
    // Child of n4.
    MinusOpNode n5 = new MinusOpNode();
    n4.addChild(n5);
    // Children of n5.
    n5.addChild(x);
    n5.addChild(x);

    assertEquals("$x - -$x - (-($x - $x) - $x)", n0.toSourceString());
View Full Code Here

TOP

Related Classes of com.google.template.soy.exprtree.OperatorNodes.NegativeOpNode

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.