MCPcopy
hub / github.com/webpack/webpack / consumeHyphenMinus

Function consumeHyphenMinus

lib/css/syntax.js:693–709  ·  view source on GitHub ↗

* `-` — number / cdc / ident / 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

691 * @returns {MutableToken | undefined} the resulting token, or undefined at EOF
692 */
693function consumeHyphenMinus(input, pos, out) {
694 if (_ifThreeCodePointsWouldStartANumber(input, pos)) {
695 pos--;
696 return consumeANumericToken(input, pos, out);
697 }
698 if (
699 input.charCodeAt(pos) === CC_HYPHEN_MINUS &&
700 input.charCodeAt(pos + 1) === CC_GREATER_THAN_SIGN
701 ) {
702 return fill(out, TT_CDC, pos - 1, pos + 2);
703 }
704 if (_ifThreeCodePointsWouldStartAnIdentSequence(input, pos)) {
705 pos--;
706 return consumeAnIdentLikeToken(input, pos, out);
707 }
708 return fill(out, TT_DELIM, pos - 1, pos);
709}
710
711/**
712 * `.` — number or delim.

Callers 1

consumeATokenFunction · 0.85

Calls 5

consumeANumericTokenFunction · 0.85
fillFunction · 0.85
consumeAnIdentLikeTokenFunction · 0.85

Tested by

no test coverage detected