Package com.github.sommeri.less4j.core.parser

Examples of com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree


  private String name;
  private SelectorOperator operator;
  private Expression value;

  public SelectorAttribute(HiddenTokenAwareTree token, String name) {
    this(token, name, new SelectorOperator(new HiddenTokenAwareTree(token.getSource()), SelectorOperator.Operator.NONE), null);
  }
View Full Code Here


    FixedNamePart fixedName = new FixedNamePart(parent, printer.toString());
    return fixedName;
  }

  private SimpleSelector interpolateEscapedSelector(EscapedSelector input, ExpressionEvaluator expressionEvaluator) {
    HiddenTokenAwareTree underlying = input.getUnderlyingStructure();
    String value = stringInterpolator.replaceIn(input.getValue(), expressionEvaluator, input.getUnderlyingStructure());
    InterpolableName interpolableName = new InterpolableName(underlying, new FixedNamePart(underlying, value));
    return new SimpleSelector(input.getUnderlyingStructure(), input.getLeadingCombinator(), interpolableName, false);
  }
View Full Code Here

      return new FaultyExpression(call.getUnderlyingStructure());
    }
  }

  private Expression buildResult(Expression targetExpression, String replaced) {
    HiddenTokenAwareTree token = targetExpression.getUnderlyingStructure();
    switch (targetExpression.getType()) {
    case IDENTIFIER_EXPRESSION:
      return new IdentifierExpression(token, replaced);

    case STRING_EXPRESSION:
View Full Code Here

      problemsHandler.errorFileCanNotBeRead(node, filename);
      return null;
    }

    if (node.isInline()) {
      HiddenTokenAwareTree underlyingStructure = node.getUnderlyingStructure();
      StyleSheet result = new StyleSheet(underlyingStructure);
      InlineContent content = new InlineContent(underlyingStructure, importedContent);
      result.addMember(content);
      result.configureParentToAllChilds();
     
View Full Code Here

    // parse imported file
    StyleSheet importedAst = parseContent(node, content, source);

    // add media queries if needed
    if (node.hasMediums()) {
      HiddenTokenAwareTree underlyingStructure = node.getUnderlyingStructure();
      StyleSheet result = new StyleSheet(underlyingStructure);
      Media media = new Media(underlyingStructure);
      result.addMember(media);
      media.setParent(result);
      media.setMediums(node.getMediums());
View Full Code Here

    if (splitParameters.get(0).getType() != ASTCssNodeType.COLOR_EXPRESSION) {
      UnknownFunction unknownFunction = new UnknownFunction();
      return unknownFunction.evaluate(splitParameters, problemsHandler, call, evaluatedParameter);
    }

    HiddenTokenAwareTree token = call.getUnderlyingStructure();

    ColorExpression color = (ColorExpression) splitParameters.get(0);
    ColorExpression dark = (ColorExpression) (splitParameters.size() > 1 ? splitParameters.get(1) : new ColorExpression(token, 0, 0, 0));
    ColorExpression light = (ColorExpression) (splitParameters.size() > 2 ? splitParameters.get(2) : new ColorExpression(token, 255, 255, 255));
    NumberExpression threshold = (NumberExpression) (splitParameters.size() > 3 ? splitParameters.get(3) : new NumberExpression(token, 43.0, "%", null, Dimension.PERCENTAGE));
View Full Code Here

      problemsHandler.wrongArgumentTypeToFunction(iParameter, getName(), iParameter.getType(), ASTCssNodeType.NUMBER);
      return new FaultyExpression(iParameter);
    }

    NumberExpression parameter = (NumberExpression) iParameter;
    HiddenTokenAwareTree parentToken = parameter.getUnderlyingStructure();
    Double oValue = parameter.getValueAsDouble();
    String suffix = parameter.getSuffix();
    Dimension dimension = parameter.getDimension();
   
    if (oValue.isInfinite() || oValue.isNaN())
View Full Code Here

  }

  public SimpleSelector[] splitOn(SimpleSelector lookFor, SimpleSelector inside) {
    if (hasNoElement(lookFor)) {
      List<ElementSubsequent> subsequents = inside.getSubsequent();
      HiddenTokenAwareTree underlying = inside.getUnderlyingStructure();

      List<MatchMarker<ElementSubsequent>> matches = listsComparator.findMatches(lookFor.getSubsequent(), subsequents, elementSubsequentComparator);
      List<SimpleSelector> result = new ArrayList<SimpleSelector>();
      result.add(inside);
      for (MatchMarker<ElementSubsequent> current : matches)
View Full Code Here

TOP

Related Classes of com.github.sommeri.less4j.core.parser.HiddenTokenAwareTree

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.