return result;
}
private ResultNode parseStar(ParserInputCursor in, CSSRule rule, ConsumeWS consumeWS) {
ResultNode result = new ResultNode(NodeType.STAR);
result.status = State.FORWARD;
result.remainingInput = in.copy();
Queue<ResultNode> last = new LinkedList<>();
last.addAll(result.findLast());
boolean first = true;
while (!last.isEmpty()) {
ResultNode cur = last.poll();
if (cur.isValid()) {
ResultNode n = parse(cur.remainingInput.copy(), rule, consumeWS);
last.addAll(n.findLast());
if (first) {
cur.next.add(n);
ResultNode skipStarNode = new ResultNode(NodeType.STAR);
skipStarNode.status = State.SKIP;
skipStarNode.remainingInput = cur.remainingInput.copy();
cur.next.add(skipStarNode);
first = false;
}
else {
ResultNode starNode = new ResultNode(NodeType.STAR);
starNode.status = State.FORWARD;
starNode.remainingInput = cur.remainingInput.copy();
starNode.next.add(n);
cur.next.add(starNode);
ResultNode skipStarNode = new ResultNode(NodeType.STAR);
skipStarNode.status = State.SKIP;
skipStarNode.remainingInput = cur.remainingInput.copy();
starNode.next.add(skipStarNode);
}