Open ghost opened 3 years ago
Chrome's REPL also seems to work this way. It also doesn't work in old versions of Deno before type stripping:
Deno 1.7.5
exit using ctrl+d or close()
> 1 %
Uncaught SyntaxError: Unexpected end of input
We might be able to solve this by looking for a trailing operator at the end of the line and if that's the case we can continue reading input (before sending it to type stripping and evaluation). I don't think it would be hard to do.
Reproduce
> 1 %
Error description
``` parse error: Unexpected token 'eof'. Expected this, import, async, function, [ for array literal, { for object literal, @ for decorator, function, class, null, true, false, number, bigint, string, regexp, ` for template literal, (, or an identifier at 1:2 ```I would expect a new line, just like node does:
Is this working as expected? Would this be eligible as enhancement for REPL?