MCPcopy
hub / github.com/webpack/webpack / consumeTheRemnantsOfABadDeclaration

Function consumeTheRemnantsOfABadDeclaration

lib/css/syntax.js:2578–2599  ·  view source on GitHub ↗
(ts, nested)

Source from the content-addressed store, hash-verified

2576 * @returns {void}
2577 */
2578const 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).

Callers 2

consumeAQualifiedRuleFunction · 0.85
consumeADeclarationFunction · 0.85

Calls 3

consumeAComponentValueFunction · 0.85
discardMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected