()
| 735 | } |
| 736 | |
| 737 | private scanNumber() { |
| 738 | const start = this.#offset; |
| 739 | |
| 740 | const main = this.scanDigits(); |
| 741 | let decimal: string | undefined; |
| 742 | let scientific: string | undefined; |
| 743 | |
| 744 | if (this.#ch === CharacterCodes.dot) { |
| 745 | this.advance(); |
| 746 | decimal = this.scanDigits(); |
| 747 | } |
| 748 | |
| 749 | if (this.#ch === CharacterCodes.E || this.#ch === CharacterCodes.e) { |
| 750 | this.assert(isDigit(this.#chNext), 'ParseError: Digit expected (0-9)'); |
| 751 | this.advance(); |
| 752 | scientific = this.scanDigits(); |
| 753 | } |
| 754 | |
| 755 | this.text = scientific ? |
| 756 | decimal ? |
| 757 | `${main}.${decimal}e${scientific}` : |
| 758 | `${main}e${scientific}` : |
| 759 | decimal ? |
| 760 | `${main}.${decimal}` : |
| 761 | main; |
| 762 | |
| 763 | // update the position |
| 764 | this.#column += this.#offset - start; |
| 765 | return this.kind = Kind.NumericLiteral; |
| 766 | } |
| 767 | |
| 768 | private scanHexNumber() { |
| 769 | this.assert(isHexDigit(this.#chNextNext), 'ParseError: Hex Digit expected (0-F,0-f)'); |
no test coverage detected