Examples of AEscapeCommand


Examples of com.google.clearsilver.jsilver.syntax.node.AEscapeCommand

      AFunctionExpression functionExpression = (AFunctionExpression) expression;
      String name = escapeNameOf(functionExpression);
      if (escaperNames.contains(name)) {
        LinkedList<PExpression> args = functionExpression.getArgs();
        if (args.size() == 1) {
          return new AEscapeCommand(position, quotedStringExpressionOf(name),
              optimizedVarCommandOf(position, args.getFirst()));
        }
      }
    }
    return varCommand;
View Full Code Here

Examples of com.google.clearsilver.jsilver.syntax.node.AEscapeCommand

  /**
   * Returns a new command containing the contents of the given multiple command but with with
   * multiple successive (matching) escape commands folded into one.
   */
  private static PCommand optimizeEscapeSequences(AMultipleCommand multiCommand) {
    AEscapeCommand lastEscapeCommand = null;
    LinkedList<PCommand> commands = new LinkedList<PCommand>();
    for (PCommand command : multiCommand.getCommand()) {
      AEscapeCommand escapeCommand = asSimpleEscapeCommand(command);
      if (isSameEscaper(escapeCommand, lastEscapeCommand)) {
        addToContents(contentsOf(lastEscapeCommand), escapeCommand.getCommand());
      } else {
        // Add the original command and set the escaper (possibly null)
        commands.add(command);
        lastEscapeCommand = escapeCommand;
      }
View Full Code Here

Examples of com.google.clearsilver.jsilver.syntax.node.AEscapeCommand

   */
  private static AEscapeCommand asSimpleEscapeCommand(PCommand command) {
    if (!(command instanceof AEscapeCommand)) {
      return null;
    }
    AEscapeCommand escapeCommand = (AEscapeCommand) command;
    if (!(escapeCommand.getExpression() instanceof AStringExpression)) {
      return null;
    }
    return escapeCommand;
  }
View Full Code Here

Examples of com.google.clearsilver.jsilver.syntax.node.AEscapeCommand

  private void handleExplicitEscapeMode(Start start) {
    AStringExpression escapeExpr =
        new AStringExpression(new TString("\"" + escapeMode.getEscapeCommand() + "\""));

    PCommand node = start.getPCommand();
    AEscapeCommand escape =
        new AEscapeCommand(new ACsOpenPosition(new TCsOpen("<?cs ", 0, 0)), escapeExpr,
            (PCommand) node.clone());

    node.replaceBy(escape);
  }
View Full Code Here

Examples of com.google.clearsilver.jsilver.syntax.node.AEscapeCommand

    if (skipAutoEscape) {
      return;
    }

    AStringExpression escapeExpr = new AStringExpression(new TString("\"" + getEscaping() + "\""));
    AEscapeCommand escape = new AEscapeCommand(position, escapeExpr, (PCommand) node.clone());

    node.replaceBy(escape);
    // Now that we have determined the correct escaping for this variable,
    // let parser know that there was some text that it has not seen. The
    // parser may choose to update its state based on this.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.