Package com.google.template.soy.exprtree.Operator

Examples of com.google.template.soy.exprtree.Operator.Operand


    List<SyntaxElement> syntax = operator.getSyntax();
    for (int i = 0, n = syntax.size(); i < n; ++i) {
      SyntaxElement syntaxEl = syntax.get(i);

      if (syntaxEl instanceof Operand) {
        Operand operand = (Operand) syntaxEl;
        // If left (right) associative, first (last) operand doesn't need protection if it's an
        // operator of equal precedence to this one. (Note: Actually, the middle operand of our only
        // ternary operator doesn't need protection either, but we do it anyway for readability.)
        if (i == (isLeftAssociative ? 0 : n-1)) {
          sourceSb.append(getOperandProtectedForLowerPrec(operand.getIndex()));
        } else {
          sourceSb.append(getOperandProtectedForLowerOrEqualPrec(operand.getIndex()));
        }

      } else if (syntaxEl instanceof Token) {
        sourceSb.append(((Token) syntaxEl).getValue());
View Full Code Here

TOP

Related Classes of com.google.template.soy.exprtree.Operator.Operand

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.