MCPcopy
hub / github.com/webpack/webpack / parseADeclaration

Function parseADeclaration

lib/css/syntax.js:2149–2157  ·  view source on GitHub ↗
(input, pos, comment)

Source from the content-addressed store, hash-verified

2147 * @returns {Declaration | undefined} the parsed declaration, or undefined
2148 */
2149const parseADeclaration = (input, pos, comment) => {
2150 // 1. Normalize input, and set input to the result.
2151 const ts = normalizeIntoTokenStream(input, pos, comment);
2152 useObjectBackend(ts.locConverter);
2153 // 2. Discard whitespace from input.
2154 while (ts.next().type === TT_WHITESPACE) ts.discard();
2155 // 3. Consume a declaration from input. If anything was returned, return it. Otherwise, return a syntax error.
2156 return consumeADeclaration(ts);
2157};
2158
2159/**
2160 * Parse a component value, CSS Syntax Level 3 [§5.3.9](https://drafts.csswg.org/css-syntax/#parse-component-value) — strict entry point that consumes one value and returns `undefined` if non-whitespace input trails (use `consumeAComponentValue` for "one value, ignore the rest").

Callers 1

Calls 5

normalizeIntoTokenStreamFunction · 0.85
useObjectBackendFunction · 0.85
consumeADeclarationFunction · 0.85
discardMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected