(ts, nested)
| 2576 | * @returns {void} |
| 2577 | */ |
| 2578 | const consumeTheRemnantsOfABadDeclaration = (ts, nested) => { |
| 2579 | // Process input: |
| 2580 | for (;;) { |
| 2581 | const t = ts.next(); |
| 2582 | // <eof-token> / <semicolon-token> |
| 2583 | // Discard a token from input, and return. |
| 2584 | if (t.type === TT_EOF || t.type === TT_SEMICOLON) { |
| 2585 | ts.discard(); |
| 2586 | return; |
| 2587 | } |
| 2588 | // <}-token> |
| 2589 | // If nested is true, return. Otherwise, discard a token. |
| 2590 | if (t.type === TT_RIGHT_CURLY_BRACKET) { |
| 2591 | if (nested) return; |
| 2592 | ts.discard(); |
| 2593 | continue; |
| 2594 | } |
| 2595 | // anything else |
| 2596 | // Consume a component value from input, and do nothing. |
| 2597 | consumeAComponentValue(ts); |
| 2598 | } |
| 2599 | }; |
| 2600 | |
| 2601 | /** |
| 2602 | * Consume a declaration, CSS Syntax Level 3 [§5.4.6](https://drafts.csswg.org/css-syntax/#consume-declaration). |
no test coverage detected