-
Notifications
You must be signed in to change notification settings - Fork 7
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
parser: Harden return statements #23
Conversation
Visit the preview URL for this PR (updated for commit 0b2202d): https://evy-lang--pr23-return-errors-qvps6m8p.web.app (expires Wed, 12 Oct 2022 08:16:10 GMT) 🔥 via Firebase Hosting GitHub Action 🌎 |
Unify statement parsing for program and block - just a small refactor in order to not repeat myself.
ceff6b7
to
50c8cc5
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
some stuff to get you going, but i really like how this looks. again, reasonably simple to add means its in pretty good shape
069ee1f
to
57c421e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🐲 bloody beautiful
Ensure correct return type according to function signature, append error otherwise.
Add error message for unreachable code after `return` statement.
Ensure functions with specified return type always return, print error otherwise.
ae665c7
to
0b2202d
Compare
Harden return statements such that there is an error when there is
unreachable code after a return statement or a return statement is of
the wrong type.