(node: SelectorAstNode)
| 181 | } |
| 182 | |
| 183 | function append(node: SelectorAstNode) { |
| 184 | let existing = target[target.length - 1] |
| 185 | |
| 186 | if (existing?.kind === 'compound') { |
| 187 | existing.nodes.push(node) |
| 188 | } else if (existing && existing.kind !== 'list' && existing.kind !== 'combinator') { |
| 189 | target[target.length - 1] = compound([existing, node]) |
| 190 | } else { |
| 191 | target.push(node) |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | for (let i = 0; i < input.length; i++) { |
| 196 | let currentChar = input.charCodeAt(i) |