(input, pos)
| 505 | * @returns {number} position just past the number |
| 506 | */ |
| 507 | const _consumeANumber = (input, pos) => { |
| 508 | let cc = input.charCodeAt(pos); |
| 509 | if (cc === CC_HYPHEN_MINUS || cc === CC_PLUS_SIGN) { |
| 510 | pos++; |
| 511 | } |
| 512 | while (_isDigit(input.charCodeAt(pos))) pos++; |
| 513 | if ( |
| 514 | input.charCodeAt(pos) === CC_FULL_STOP && |
| 515 | _isDigit(input.charCodeAt(pos + 1)) |
| 516 | ) { |
| 517 | pos++; |
| 518 | while (_isDigit(input.charCodeAt(pos))) pos++; |
| 519 | } |
| 520 | cc = input.charCodeAt(pos); |
| 521 | if ( |
| 522 | (cc === CC_LOWER_E || cc === CC_UPPER_E) && |
| 523 | (((input.charCodeAt(pos + 1) === CC_HYPHEN_MINUS || |
| 524 | input.charCodeAt(pos + 1) === CC_PLUS_SIGN) && |
| 525 | _isDigit(input.charCodeAt(pos + 2))) || |
| 526 | _isDigit(input.charCodeAt(pos + 1))) |
| 527 | ) { |
| 528 | pos++; |
| 529 | cc = input.charCodeAt(pos); |
| 530 | if (cc === CC_PLUS_SIGN || cc === CC_HYPHEN_MINUS) { |
| 531 | pos++; |
| 532 | } |
| 533 | while (_isDigit(input.charCodeAt(pos))) pos++; |
| 534 | } |
| 535 | return pos; |
| 536 | }; |
| 537 | |
| 538 | /** |
| 539 | * Spec recovery: when the tokenizer realises it's mid-bad-url, consume |
no test coverage detected