Package com.github.sommeri.less4j.core.ast

Examples of com.github.sommeri.less4j.core.ast.FunctionExpression


    if (urlExpression.getType() != ASTCssNodeType.FUNCTION)
      return toJavaFileSeparator(contentToString(urlExpression));

    //this is the only place in the compiler that can interpret the url function
    FunctionExpression function = (FunctionExpression) urlExpression;
    if (!"url".equals(function.getName().toLowerCase()))
      return null;

    List<Expression> parameters = expressionEvaluator.evaluate(function.getParameter()).splitByComma();
    if (parameters.isEmpty())
      return null;
   
    return toJavaFileSeparator(contentToString(parameters.get(0)));
  }
View Full Code Here


  public static boolean isQuotelessUrlFunction(ASTCssNode kid) {
    if (kid.getType() != ASTCssNodeType.FUNCTION)
      return false;

    FunctionExpression function = (FunctionExpression) kid;
    String name = function.getName();
    if (!"url".equals(name == null ? null : name.toLowerCase()))
      return false;
   
    Expression parameter = function.getParameter().splitByComma().get(0);
    if (parameter.getType()!=ASTCssNodeType.STRING_EXPRESSION)
      return false;
   
    CssString stringParameter = (CssString)parameter;
    return "".equals(stringParameter.getQuoteType());
View Full Code Here

TOP

Related Classes of com.github.sommeri.less4j.core.ast.FunctionExpression

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.