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

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


   
    warn(call, problemsHandler);
   
    EmbeddedScript parameterAsStr = (EmbeddedScript) parameter;
    String value = name+parameterAsStr.getValue()+"`";
    return new CssString(call.getUnderlyingStructure(), value, "");
  }
View Full Code Here


    return false;
  }

  private boolean equalString(CssString pattern, Expression expression) {
    if (expression instanceof CssString) {
      CssString string = (CssString) expression;
      //ignore quote type when comparing strings
      return equals(pattern.getValue(), string.getValue());
    }

    return false;
  }
View Full Code Here

  @Override
  protected Expression evaluate(List<Expression> splitParameters, ProblemsHandler problemsHandler, FunctionExpression functionCall, HiddenTokenAwareTree token) {
    String mimetype = null;
    String filename = null;
    if (splitParameters.size() == 1) {
      CssString filenameArg = (CssString) splitParameters.get(0);
      filename = filenameArg.getValue();
    } else {
      CssString mimetypeArg = (CssString) splitParameters.get(0);
      mimetype = mimetypeArg.getValue();

      CssString filenameArg = (CssString) splitParameters.get(1);
      filename = filenameArg.getValue();
    }

    String[] filenameParts = filename.split("#", 2);
    filename = filenameParts[0];
    String fragments = filenameParts.length > 1 ? "#" + filenameParts[1] : "";
View Full Code Here

  private Expression toDataUri(HiddenTokenAwareTree token, String mimetype, String data, String fragments) {
    StringBuilder value = new StringBuilder("data:");
    value.append(mimetype).append(",").append(data).append(fragments);

    CssString parameter = new CssString(token, value.toString(), "\"");
    return new FunctionExpression(token, "url", parameter);
  }
View Full Code Here

    StringBuilder value = new StringBuilder("data:image/svg+xml");
    if (useBase64)
      value.append(";base64");
    value.append(",").append(data);

    CssString parameter = new CssString(token, value.toString(), "\'");
    return new FunctionExpression(token, "url", parameter);
  }
View Full Code Here

class Color extends CatchAllMultiParameterFunction {

  @Override
  protected Expression evaluate(List<Expression> splitParameters, ProblemsHandler problemsHandler, FunctionExpression functionCall, HiddenTokenAwareTree token) {
    CssString string = (CssString) splitParameters.get(0);
    String text = string.getValue();

    //this does a bit more then less.js: it is able to parse named colors
    ColorExpression parsedColor = ConversionUtils.parseColor(token, text);
    if (parsedColor == null) {
      FaultyExpression faultyExpression = new FaultyExpression(token);
View Full Code Here

    };
  }

  public Expression evaluate(CssString input) {
    String value = stringInterpolator.replaceIn(input.getValue(), this, input.getUnderlyingStructure());
    return new CssString(input.getUnderlyingStructure(), value, input.getQuoteType());
  }
View Full Code Here

    return input.getName().equals("worksWithMultiple");
  }

  @Override
  public Expression evaluate(FunctionExpression input, List<Expression> parameters, Expression evaluatedParameter, LessProblems problems) {
    return new CssString(input.getUnderlyingStructure(), "tr", "\"");
  }
View Full Code Here

   
    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.CssString

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.