Describe the bug
If you try and return with anything but a literal, it will fail, with the token seemingly being skipped or just not existing at all.
To Reproduce
function foo() {
let bar = 55;
return bar; // FAIL: "Expected ; after return", as it finds the semicolon instead of the identifier in the parser
};
Expected behaviour
Return works with identifiers.
Additional context
The tokenizer works fine. Inspecting the output tokens gives proper identifiers and semicolons. This is something incredibly cursed with the parser.
Describe the bug
If you try and return with anything but a literal, it will fail, with the token seemingly being skipped or just not existing at all.
To Reproduce
Expected behaviour
Return works with identifiers.
Additional context
The tokenizer works fine. Inspecting the output tokens gives proper identifiers and semicolons. This is something incredibly cursed with the parser.