* `-` — 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)
| 691 | * @returns {MutableToken | undefined} the resulting token, or undefined at EOF |
| 692 | */ |
| 693 | function 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. |
no test coverage detected