Package com.google.caja.lexer

Examples of com.google.caja.lexer.TokenConsumer.mark()


  @Override
  public void render(RenderContext rc) {
    FunctionConstructor fc = getInitializer();
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    out.consume("function");
    getIdentifier().render(rc);
    out.consume("(");
    boolean seen = false;
    for (FormalParam p : fc.getParams()) {
View Full Code Here


  public String getLabel() { return label; }

  public void render(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    out.consume("break");
    if (null != label && !"".equals(label)) {
      out.consume(label);
    }
  }
View Full Code Here

  @Override
  public Object getValue() { return null; }

  public void render(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    out.consume("debugger");
  }

  public boolean hasHangingConditional() { return false; }
}
View Full Code Here

  @Override
  public Object getValue() { return null; }

  public void render(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    out.consume("var");
    renderShort(rc);
  }

  /**
 
View Full Code Here

   * This is used in multi declarations, such as in
   * {@code for (var a = 0, b = 1, ...)}.
   */
  void renderShort(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    if (identifier.getName() == null) {
      throw new IllegalStateException(
          "null name for declaration at " + getFilePosition());
    }
    identifier.render(rc);
View Full Code Here

    }
    new Renderer(rc, sb, rc.markupRenderMode(), ns)
        .render(node, ns, renderUnsafe);
    TokenConsumer out = rc.getOut();
    FilePosition pos = getFilePositionFor(node);
    out.mark(FilePosition.startOf(pos));
    out.consume(sb.toString());
    out.mark(FilePosition.endOf(pos));
  }

  /**
 
View Full Code Here

        .render(node, ns, renderUnsafe);
    TokenConsumer out = rc.getOut();
    FilePosition pos = getFilePositionFor(node);
    out.mark(FilePosition.startOf(pos));
    out.consume(sb.toString());
    out.mark(FilePosition.endOf(pos));
  }

  /**
   * Returns a rendering of document type.  This is handled explicitly here
   * rather than in {@link Nodes#render(Node, MarkupRenderMode)} to avoid
View Full Code Here

  public Boolean conditionResult() { return true; }

  public void render(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    FilePosition pos = getFilePosition();
    out.mark(pos);
    out.consume("[");
    Expression last = null;
    for (Expression e : children()) {
      if (last != null) {
        out.consume(",");
View Full Code Here

        out.consume("(");
        e.render(rc);
        out.consume(")");
      }
    }
    out.mark(FilePosition.endOfOrNull(pos));
    out.consume("]");
  }

  public String typeOf() { return "object"; }
}
View Full Code Here

  @Override
  public Boolean conditionResult() { return true; }

  public void render(RenderContext rc) {
    TokenConsumer out = rc.getOut();
    out.mark(getFilePosition());
    out.consume("function");
    String name = identifier.getName();
    if (null != name) {
      out.consume(name);
    }
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.