Examples of GssParser


Examples of com.google.common.css.compiler.ast.GssParser

    }

    CssTree tree;

    try {
      tree = new GssParser(sourceCodes).parse();
    } catch (GssParserException e) {
      logger.log(TreeLogger.ERROR, "Unable to parse CSS", e);
      throw new UnableToCompleteException();
    }
View Full Code Here

Examples of com.google.common.css.compiler.ast.GssParser

    if (lenient) {
      // lenient mode: Try to parse the css rule and if an error occurs,
      // print a warning message and don't print the rule.
      try {
        new GssParser(new SourceCode(null, "body{" + cssProperty + "}")).parse();
      } catch (GssParserException e) {
        treeLogger.log(Type.WARN, "The following property is not valid and will be skipped: " +
            cssProperty);
        return false;
      }
View Full Code Here

Examples of com.google.gwt.thirdparty.common.css.compiler.ast.GssParser

    String cssProperty = propertyBuilder.toString();

    // See if we can parse the rule using the GSS parser and thus verify that the
    // rule is indeed correct CSS.
    try {
      new GssParser(new SourceCode(null, "body{" + cssProperty + "}")).parse();
    } catch (GssParserException e) {
      if (lenient) {
        // print a warning message and don't print the rule.
        treeLogger.log(Type.WARN, "The following rule is not valid and will be skipped: " +
            cssProperty);
View Full Code Here

Examples of com.google.gwt.thirdparty.common.css.compiler.ast.GssParser

    }

    CssTree tree;

    try {
      tree = new GssParser(sourceCodes).parse();
    } catch (GssParserException e) {
      logger.log(TreeLogger.ERROR, "Unable to parse CSS", e);
      throw new UnableToCompleteException();
    }
View Full Code Here

Examples of com.google.gwt.thirdparty.common.css.compiler.ast.GssParser

    String gss = IOUtils.toString(stream, "UTF-8");
    Assert.assertEquals(gss, convertedGss);

    // assert the convertedGss is compatible with GSS
    try {
      new GssParser(new SourceCode("[conversion of " + inputCssFile + "]", convertedGss)).parse();
    } catch (GssParserException e) {
      e.printStackTrace();
      fail("The conversion produces invalid GSS code.");
    }
  }
View Full Code Here

Examples of com.google.gwt.thirdparty.common.css.compiler.ast.GssParser

    private static Set<String> getCssClassNames(String fileName, String cssSource,
        Set<JClassType> imports, TreeLogger logger) throws UnableToCompleteException {
      SourceCode sourceCode = new SourceCode(fileName, cssSource);
      CssTree tree;
      try {
        tree = new GssParser(sourceCode).parse();
      } catch (GssParserException e) {
        logger.log(TreeLogger.ERROR, "Unable to parse CSS", e);
        throw new UnableToCompleteException();
      }
      return new ClassNamesCollector().getClassNames(tree, imports);
View Full Code Here

Examples of com.google.gwt.thirdparty.common.css.compiler.ast.GssParser

    return Joiner.on("\n").join(lines);
  }

  private CssTree parse(String source) {
    try {
      return new GssParser(new SourceCode("test", source)).parse();
    } catch (GssParserException e) {
      fail(e.getMessage());
    }
    return null;
  }
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.