Package com.google.caja.lexer

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


  }

  @Override
  public void render(RenderContext r) {
    TokenConsumer tc = r.getOut();
    tc.mark(getFilePosition());
    tc.consume(getValue());
    if (tc instanceof EmbeddedJsExpressionTokenConsumer) {
      ((EmbeddedJsExpressionTokenConsumer) tc).endArrayElement();
    } else {
      // Emit a buster that will cause the CSS parser to error out but not out
View Full Code Here


  }

  @Override
  public void render(RenderContext r) {
    TokenConsumer tc = r.getOut();
    tc.mark(getFilePosition());
    tc.consume("url(");
    if (tc instanceof EmbeddedJsExpressionTokenConsumer) {
      ((EmbeddedJsExpressionTokenConsumer) tc).consume(expr);
    } else {
      // Emit a buster that will cause the CSS parser to error out but not out
View Full Code Here

        out.consume(";");
      }
      decl.render(r);
      last = decl;
    }
    out.mark(FilePosition.endOfOrNull(pos));
    out.consume("}");
  }

  private static void renderCommaGroup(
      List<? extends CssTree> children, RenderContext r) {
View Full Code Here

      return media;
    }

    public void render(RenderContext r) {
      TokenConsumer out = r.getOut();
      out.mark(getFilePosition());
      out.consume("@");
      out.consume("import");
      out.consume(" ");
      getUri().render(r);
View Full Code Here

    @Override
    public String getValue() { return charset; }

    public void render(RenderContext r) {
      TokenConsumer out = r.getOut();
      out.mark(getFilePosition());
      out.consume("@");
      out.consume("charset");
      out.consume(" ");
      renderCssString(charset, r);
      out.consume(";");
View Full Code Here

      return media;
    }

    public void render(RenderContext r) {
      TokenConsumer out = r.getOut();
      out.mark(getFilePosition());
      out.consume("@");
      out.consume("media");
      out.consume(" ");
      List<? extends CssTree> children = children();
      int i = 0;
View Full Code Here

      renderCommaGroup(children.subList(0, i), r);
      out.consume("{");
      for (CssTree ruleset : children.subList(i, children.size())) {
        ruleset.render(r);
      }
      out.mark(FilePosition.endOfOrNull(getFilePosition()));
      out.consume("}");
    }
  }

  /**
 
View Full Code Here

    @Override
    public Name getValue() { return ident; }

    public void render(RenderContext r) {
      TokenConsumer out = r.getOut();
      out.mark(getFilePosition());
      out.consume("@");
      out.consume("page");
      if (null != ident) {
        out.consume(" ");
        renderCssIdent(ident.getCanonicalForm(), r);
View Full Code Here

    public void render(RenderContext r) {
      // Start with a space to make sure that rendering couldn't introduce a
      // comment.  I know of no parse tree that would otherwise do this, but
      // comments could be used to introduce security holes.
      TokenConsumer out = r.getOut();
      out.mark(getFilePosition());
      out.consume(" ");
      out.consume("*");
    }
  }

View Full Code Here

      return children().isEmpty() ? null : (CssLiteral) children().get(1);
    }

    public void render(RenderContext r) {
      TokenConsumer out = r.getOut();
      out.mark(getFilePosition());
      out.consume("[");
      renderCssIdent(ident, r);
      List<? extends CssTree> children = children();
      if (!children.isEmpty()) {
        out.consume(" ");
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.