MCPcopy
hub / github.com/webpack/webpack / consumeATokenAsNode

Function consumeATokenAsNode

lib/css/syntax.js:2356–2359  ·  view source on GitHub ↗
(ts)

Source from the content-addressed store, hash-verified

2354 * @returns {Token} the consumed token as a leaf node
2355 */
2356const consumeATokenAsNode = (ts) => {
2357 const t = ts.consume();
2358 return /** @type {Token} */ (tokenToNode(t));
2359};
2360
2361/**
2362 * Consume a qualified rule, CSS Syntax Level 3 [§5.4.3](https://drafts.csswg.org/css-syntax/#consume-qualified-rule) — consumes the prelude (each component value via `consumeAComponentValue`) up to its `{` block; EOF, the optional `stopToken`, or a nested top-level `}` is a parse error returning nothing (the block-less prelude is dropped), while a non-nested top-level `}` is consumed as a parse error and the prelude continues. A returned rule always has a block.

Callers 3

consumeAnAtRuleFunction · 0.85
consumeAQualifiedRuleFunction · 0.85

Calls 2

tokenToNodeFunction · 0.85
consumeMethod · 0.80

Tested by

no test coverage detected