()
| 482 | return token; |
| 483 | } |
| 484 | #consumeNumber() { |
| 485 | var token = this.#makeToken("NUMBER"); |
| 486 | var value = this.#consumeChar(); |
| 487 | while (this.#isNumeric(this.#currentChar())) { |
| 488 | value += this.#consumeChar(); |
| 489 | } |
| 490 | if (this.#currentChar() === "." && this.#isNumeric(this.#nextChar())) { |
| 491 | value += this.#consumeChar(); |
| 492 | } |
| 493 | while (this.#isNumeric(this.#currentChar())) { |
| 494 | value += this.#consumeChar(); |
| 495 | } |
| 496 | if (this.#currentChar() === "e" || this.#currentChar() === "E") { |
| 497 | if (this.#isNumeric(this.#nextChar())) { |
| 498 | value += this.#consumeChar(); |
| 499 | } else if (this.#nextChar() === "-") { |
| 500 | value += this.#consumeChar(); |
| 501 | value += this.#consumeChar(); |
| 502 | } |
| 503 | } |
| 504 | while (this.#isNumeric(this.#currentChar())) { |
| 505 | value += this.#consumeChar(); |
| 506 | } |
| 507 | token.value = value; |
| 508 | token.end = this.#position; |
| 509 | return token; |
| 510 | } |
| 511 | #consumeOp() { |
| 512 | var token = this.#makeOpToken(); |
| 513 | var value = this.#consumeChar(); |
no test coverage detected