-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Insert explicit return expressions in functions/macros/do-blocks
This patch make sure that function definitions end with an explicit `return` statement before the last expression in the body. If `for` or `while` is the last expression a `return nothing` node is inserted after the loop instead of `return for ...`. `if`, `try`, `let`, and `begin` are currently are left as they are. Perhaps in the future Runic will recurse down into branches, or insert `return if` but for now this is left alone. Another exception is also made whenever the last expression is a call to `throw` or `error` because it is pretty clear that the function will not return in this case (`return throw(...)` look silly). Closes #43.
- Loading branch information
1 parent
13b6402
commit 57e5cd3
Showing
6 changed files
with
226 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.