(input, pos)
| 469 | * @returns {number} position just past the last ident-sequence code point |
| 470 | */ |
| 471 | const _consumeAnIdentSequence = (input, pos) => { |
| 472 | // Hot loop (every ident, at-keyword, hash, function name, unit). Both checks |
| 473 | // are inlined from `_isIdentCodePoint` / `_ifTwoCodePointsAreValidEscape`: the |
| 474 | // ASCII ident test is a single table load, and the escape test reads the |
| 475 | // following code point only when `cc` is a `\` (rare) instead of eagerly. |
| 476 | for (;;) { |
| 477 | const cc = input.charCodeAt(pos); |
| 478 | pos++; |
| 479 | if (cc < 128 ? _identCharTable[cc] === 1 : _isIdentStartCodePointCC(cc)) { |
| 480 | continue; |
| 481 | } |
| 482 | if (cc === CC_REVERSE_SOLIDUS && !_isNewline(input.charCodeAt(pos))) { |
| 483 | pos = _consumeAnEscapedCodePoint(input, pos); |
| 484 | continue; |
| 485 | } |
| 486 | return pos - 1; |
| 487 | } |
| 488 | }; |
| 489 | |
| 490 | /** |
| 491 | * @param {number} cc char code |
no test coverage detected