diff --git a/src/parser.ts b/src/parser.ts index 2d8c718..51d7765 100644 --- a/src/parser.ts +++ b/src/parser.ts @@ -141,7 +141,7 @@ export class Parser { const startToken = this.peek(); const statements: Stmt[] = []; while (!this.isAtEnd()) { - if (this.match(TokenType.NEWLINE)) { + if (this.match(TokenType.NEWLINE) || this.match(TokenType.DEDENT)) { continue; } statements.push(this.stmt()); diff --git a/src/tokenizer.ts b/src/tokenizer.ts index 624d4b9..3d69cfb 100644 --- a/src/tokenizer.ts +++ b/src/tokenizer.ts @@ -265,12 +265,19 @@ export class Tokenizer { while (this.isDigit(this.peek())) { this.advance(); } + + if (this.peek() !== '.' && this.peek() !== 'e') { + this.addToken(TokenType.BIGINT); + return; + } + if (this.peek() === '.') { this.advance(); while (this.isDigit(this.peek())) { this.advance(); } } + if (this.peek() === 'e') { this.advance(); if (this.peek() === '-') {