Exemplo n.º 1
0
  private Selector replaceLeadingAppendersByEmptiness(Selector selector) {
    while (!selector.isEmpty() && selector.getHead().isAppender()) {
      selector.getHead().setParent(null);
      selector.removeHead();
    }

    if (selector.isEmpty()) {
      SimpleSelector empty = createEmptySimpleSelector(selector);
      selector.addPart(empty);
    }
    return selector;
  }
Exemplo n.º 2
0
  private Selector chopOffHead(Selector selector) {
    if (!selector.isCombined()) return null;

    selector.removeHead();
    return selector;
  }