This fixes certain invalid syntaxes reported in #783 like
123 = []
[] = []
{} = []
But cases like 123foo = [] are caused by lexer's whitespace-insensitive. Which means that it doesn't consider whitespace while reading characters. So in this case, it'll tokenize the code into Int, Ident, Eq, LBracket and RBracket instead of Illegal, Eq, LBracket and RBracket.
To make the lexer whitespace-sensetive, we need to do some refactoring or even redesign for our lexer. So I choose to pick the low hanging fruits first and address that in other PR.
This fixes certain invalid syntaxes reported in #783 like
But cases like
123foo = []
are caused by lexer's whitespace-insensitive. Which means that it doesn't consider whitespace while reading characters. So in this case, it'll tokenize the code intoInt, Ident, Eq, LBracket and RBracket
instead ofIllegal, Eq, LBracket and RBracket
.To make the lexer whitespace-sensetive, we need to do some refactoring or even redesign for our lexer. So I choose to pick the low hanging fruits first and address that in other PR.