MCPcopy
hub / github.com/webpack/webpack / consumeCommercialAt

Function consumeCommercialAt

lib/css/syntax.js:914–929  ·  view source on GitHub ↗

* `@` — at-keyword or delim. * @param {string} input input * @param {number} pos position just past `@` * @param {MutableToken} out token to populate * @returns {MutableToken | undefined} the resulting token, or undefined at EOF

(input, pos, out)

Source from the content-addressed store, hash-verified

912 * @returns {MutableToken | undefined} the resulting token, or undefined at EOF
913 */
914function consumeCommercialAt(input, pos, out) {
915 const start = pos - 1;
916 if (
917 _ifThreeCodePointsWouldStartAnIdentSequence(
918 input,
919 pos,
920 input.charCodeAt(pos),
921 input.charCodeAt(pos + 1),
922 input.charCodeAt(pos + 2)
923 )
924 ) {
925 pos = _consumeAnIdentSequence(input, pos);
926 return fill(out, TT_AT_KEYWORD, start, pos);
927 }
928 return fill(out, TT_DELIM, start, pos);
929}
930
931/**
932 * `\` — escape starts an ident-like token, otherwise it's a delim.

Callers 1

consumeATokenFunction · 0.85

Calls 3

_consumeAnIdentSequenceFunction · 0.85
fillFunction · 0.85

Tested by

no test coverage detected