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

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


    CombinatorType combinator = safeToSelectorCombinator(token);
    if (combinator == null)
      throw new IllegalStateException("Unknown: " + token.getType() + " " + PrintUtils.toName(token.getType()));

    String symbol = extractSymbol(token, combinator);
    return new SelectorCombinator(token, combinator, symbol);
  }
View Full Code Here


  public Selector buildSelector() {
    Iterator<HiddenTokenAwareTree> iterator = token.getChildren().iterator();
    Selector result = new Selector(token, new ArrayList<SelectorPart>());
    while (iterator.hasNext()) {
      SelectorCombinator combinator = null;
      SelectorPart part = null;
      HiddenTokenAwareTree kid = iterator.next();

      if (ConversionUtils.isSelectorCombinator(kid)) {
        combinator = ConversionUtils.createSelectorCombinator(kid);
        kid = iterator.next();
        part = (SelectorPart) parent.switchOn(kid);
        // Ignore descendant combinator before appender. This info is already hidden in appender.isDirectlyBefore.
        if (isDescendant(combinator) && kid.getType() == LessLexer.NESTED_APPENDER)
          combinator = null;
      } else {
        //if it is not a combinator, then it is either nested appender, simple selector or escaped selector  
        part = (SelectorPart) parent.switchOn(kid);
      }

      part.setLeadingCombinator(combinator);
      if (combinator != null)
        part.getUnderlyingStructure().moveHidden(combinator.getUnderlyingStructure(), null);

      addPart(result, part);
    }
    return result;
  }
View Full Code Here

     */
    SelectorPart attachToHead = first.getLastPart();
    directlyJoinParts(attachToHead, secondHead);

    secondParts.remove(0);
    SelectorCombinator leadingCombinator = secondParts.isEmpty() ? null : secondParts.get(0).getLeadingCombinator();
    return indirectJoinNoClone(first, leadingCombinator, secondParts, secondExtends);
  }
View Full Code Here

    // lookFor starts with a combinator - whole selector is to be eaten
    if (hasCombinator) {
      return null;
    }
    // lookFor starts with an element - element and subsequents are to be eaten, combinator is there to stay
    SelectorCombinator combinator = inside.hasLeadingCombinator() ? inside.getLeadingCombinator().clone() : null;
    if (hasElement) {
      SimpleSelector result = createNoElementSelector(inside.getUnderlyingStructure(), combinator);
      return result;

    }
View Full Code Here

TOP

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

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.