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

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


    } else if (token.getChildren().size() == 3) {
      directlyBefore = false;
      directlyAfter = false;
    }

    return new NestedSelectorAppender(token, directlyBefore, directlyAfter, null);
  }
View Full Code Here


    first.configureParentToAllChilds();
  }

  private Collection<Selector> replaceFirstAppender(Selector selector, List<Selector> previousSelectors) {
    if (selector.getHead().isAppender()) {
      NestedSelectorAppender appender = (NestedSelectorAppender) selector.getHead();
      return joinAll(previousSelectors, chopOffHead(selector), appender.getLeadingCombinator(), appender.isDirectlyBefore());
    }

    // appender somewhere in the middle
    NestedSelectorAppender appender = selector.findFirstAppender();
    if (appender == null)
      throw new BugHappened("This is very weird error and should not happen.", selector);

    Selector afterAppender = splitOn(selector, appender);
    List<Selector> partialResults = joinAll(selector, previousSelectors, appender.getLeadingCombinator(), appender.isDirectlyAfter());
    return joinAll(partialResults, afterAppender, null, appender.isDirectlyBefore());
  }
View Full Code Here

  private void checkTopLevelNested(RuleSet node) {
    if (node.getParent().getType() != ASTCssNodeType.STYLE_SHEET)
      return;

    for (Selector selector : node.getSelectors()) {
      NestedSelectorAppender appender = selector.findFirstAppender();
      if (appender != null) {
        problemsHandler.nestedAppenderOnTopLevel(appender);
        manipulator.removeFromClosestBody(node);
        return;
      }
View Full Code Here

TOP

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

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.