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

emit-declaration: when called by emit-statement, there is a semi in caller emit-block #117

Merged

Conversation

kamisori
Copy link
Contributor

@kamisori kamisori commented May 9, 2023

i feel if this breaks do-declare, it should be fixed in do-declare... like adding a (print ";") there, but emit-statement is only called by emit-block which already emits a semicolon

i feel if this breaks do-declare, it should be fixed in do-declare
@kamisori kamisori changed the title when called by emit-statement, there is a semi in caller emit-block emit-declaration: when called by emit-statement, there is a semi in caller emit-block May 9, 2023
@kamisori
Copy link
Contributor Author

kamisori commented May 9, 2023

so, previously:
emit-declaration and emit-block were emitting ";\n"
emit-block uses emit-statement uses emit-declaration -> if you had no expression to assign to your declaration you would end up with a superfluous semicolon

here, i moved the ";\n" from emit-declaration to do-declare, the only other caller of emit-declaration, aside emit-statement.

@bakpakin bakpakin merged commit 40ac3a8 into janet-lang:master May 12, 2023
@kamisori kamisori deleted the superfluous-semi-after-declaration branch May 12, 2023 10:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants