Package com.google.caja.parser.js

Examples of com.google.caja.parser.js.DirectivePrologue


      // significant there.
      for (int i = 1, n = children.size(); i < n; ++i) {
        ParseTreeNode child = children.get(i);
        if (child instanceof DirectivePrologue) {
          if (children.get(0) instanceof DirectivePrologue) {
            DirectivePrologue dp0 = (DirectivePrologue) children.get(0);
            DirectivePrologue dp1 = (DirectivePrologue) child;
            if (!dp1.children().isEmpty()) {
              List<Directive> all = Lists.newArrayList(dp0.children());
              all.addAll(dp1.children());
              children.set(
                  0,
                  new DirectivePrologue(
                      FilePosition.span(
                          dp0.getFilePosition(), dp1.getFilePosition()),
                      all));
            }
            children.remove(i);
          } else {
            for (int j = i; j >= 1; --j) {
View Full Code Here


  protected boolean consumeSpecimens(
      List<ParseTreeNode> specimens, Map<String, ParseTreeNode> bindings) {
    if (specimens.isEmpty()) { return false; }
    ParseTreeNode specimen = specimens.get(0);
    if (!(specimen instanceof DirectivePrologue)) { return false; }
    DirectivePrologue usd = ((DirectivePrologue) specimen);
    if (!usd.getDirectives().containsAll(directives)) { return false; }
    specimens.remove(0);
    return true;
  }
View Full Code Here

      List<ParseTreeNode> substitutes, Map<String, ParseTreeNode> bindings) {
    List<Directive> subsets = new ArrayList<Directive>();
    for (String subsetName : directives) {
      subsets.add(new Directive(FilePosition.UNKNOWN, subsetName));
    }
    substitutes.add(new DirectivePrologue(FilePosition.UNKNOWN, subsets));
    return true;
  }
View Full Code Here

      // significant there.
      for (int i = 1, n = children.size(); i < n; ++i) {
        ParseTreeNode child = children.get(i);
        if (child instanceof DirectivePrologue) {
          if (children.get(0) instanceof DirectivePrologue) {
            DirectivePrologue dp0 = (DirectivePrologue) children.get(0);
            DirectivePrologue dp1 = (DirectivePrologue) child;
            if (!dp1.children().isEmpty()) {
              List<Directive> all = Lists.newArrayList(dp0.children());
              all.addAll(dp1.children());
              children.set(
                  0,
                  new DirectivePrologue(
                      FilePosition.span(
                          dp0.getFilePosition(), dp1.getFilePosition()),
                      all));
            }
            children.remove(i);
          } else {
            for (int j = i; j >= 1; --j) {
View Full Code Here

TOP

Related Classes of com.google.caja.parser.js.DirectivePrologue

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.