()
| 586 | } |
| 587 | |
| 588 | private readNumber(): number { |
| 589 | let str = ""; |
| 590 | |
| 591 | while (this.position < this.data.length) { |
| 592 | const ch = this.data[this.position]; |
| 593 | |
| 594 | if (!isDigit(ch) && ch !== 0x2e) { |
| 595 | // not digit or . |
| 596 | break; |
| 597 | } |
| 598 | |
| 599 | str += String.fromCharCode(ch); |
| 600 | |
| 601 | this.position++; |
| 602 | } |
| 603 | |
| 604 | if (str.includes(".")) { |
| 605 | return parseFloat(str); |
| 606 | } |
| 607 | |
| 608 | return parseInt(str, 10); |
| 609 | } |
| 610 | |
| 611 | private readOperator(): Operator { |
| 612 | let op = ""; |
no test coverage detected