Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] return does not accept variables #2

Open
Vurv78 opened this issue Jan 18, 2022 · 0 comments
Open

[bug] return does not accept variables #2

Vurv78 opened this issue Jan 18, 2022 · 0 comments
Labels
A-Compiler Dealing with the compiler (analyzer, tokenizer, parser, transpiler) P-Low T-Bug Something isn't working

Comments

@Vurv78
Copy link
Owner

Vurv78 commented Jan 18, 2022

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.

@Vurv78 Vurv78 added T-Bug Something isn't working A-Compiler Dealing with the compiler (analyzer, tokenizer, parser, transpiler) labels Jan 18, 2022
@Vurv78 Vurv78 added the P-Low label Feb 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Compiler Dealing with the compiler (analyzer, tokenizer, parser, transpiler) P-Low T-Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant