()
| 464 | } |
| 465 | |
| 466 | private readUnicodeEscapeSequence(): `u${string}` { |
| 467 | if (this.stream.eof || (this.stream.char as string) !== 'u') { |
| 468 | throw new AiScriptSyntaxError('character "u" expected', this.stream.getPos()); |
| 469 | } |
| 470 | this.stream.next(); |
| 471 | |
| 472 | let code = ''; |
| 473 | for (let i = 0; i < 4; i++) { |
| 474 | if (this.stream.eof || !hexDigit.test(this.stream.char)) { |
| 475 | throw new AiScriptSyntaxError('hexadecimal digit expected', this.stream.getPos()); |
| 476 | } |
| 477 | code += this.stream.char; |
| 478 | this.stream.next(); |
| 479 | } |
| 480 | |
| 481 | return `u${code}`; |
| 482 | } |
| 483 | |
| 484 | private tryReadDigits(hasLeftSpacing: boolean): Token | undefined { |
| 485 | let wholeNumber = ''; |
no test coverage detected