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