aNNiMON/Own-Programming-Language-Tutorial

[REPL]

nagayev opened this issue · 2 comments

Why syntax
print((1) is correct?

The problem is not with REPL, but with this:

if (match(TokenType.LPAREN)) {
Expression result = expression();
match(TokenType.RPAREN);
return result;
}

Closing parentheses are optional now. println (((((((((((((((((((((1 is also valid 😆

I think, it's time to add strict check for that. Thanks for pointing me out on this issue.

@aNNiMON okey, it's cool