Package com.google.caja.parser

Examples of com.google.caja.parser.MutableParseTreeNode$Mutation


      public boolean visit(AncestorChain<?> ancestors) {
        ParseTreeNode node = ancestors.node;
        if (node instanceof CssTree.SuffixedSelectorPart) {
          CssTree.SuffixedSelectorPart ssp
              = (CssTree.SuffixedSelectorPart) node;
          MutableParseTreeNode parent = ancestors.parent.cast(
              MutableParseTreeNode.class)
              .node;
          CssTree replacement;
          if (gadgetNameSuffix == null) {
            replacement = new SuffixedClassOrIdLiteral(
                ssp.getFilePosition(),
                ssp.typePrefix() + ssp.suffixedIdentifier(""));
          } else {
            String ident = ssp.suffixedIdentifier(gadgetNameSuffix);
            replacement = ".".equals(ssp.typePrefix())
                ? new CssTree.ClassLiteral(ssp.getFilePosition(), "." + ident)
                : new CssTree.IdLiteral(ssp.getFilePosition(), "#" + ident);
          }
          parent.replaceChild(replacement, ssp);
          return false;
        } else if (node instanceof CssTree.IdLiteral) {
          // An un-suffixed ID literal has snuck in since CssRewriter.
          throw new AssertionError();
        } else {
View Full Code Here

TOP

Related Classes of com.google.caja.parser.MutableParseTreeNode$Mutation

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.