diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-07 18:45:27 -0800 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-01-07 18:45:27 -0800 |
| commit | 568a44ef191e1f4072d379700e3b6f599150a92b (patch) | |
| tree | c58e74b5f7539a0055d72d8ff40ef6f499aef9ea /lib/control_flow.nom | |
| parent | c92e5fbc81e57ada43f2c17792e500da5b708bee (diff) | |
Reworking some stuff so that functions only allow expressions to be
return values with either an explicit "return" statement or if they're
the only line in the function, and the line is an expression.
Diffstat (limited to 'lib/control_flow.nom')
| -rw-r--r-- | lib/control_flow.nom | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/control_flow.nom b/lib/control_flow.nom index 72a2ad1..33f72ab 100644 --- a/lib/control_flow.nom +++ b/lib/control_flow.nom @@ -210,7 +210,7 @@ compile [when %body] to code: if (%result != ""): %result join= "\nend" - %result + return %result # Switch statement compile [when %branch_value == ? %body] to code: @@ -259,7 +259,7 @@ compile [when %branch_value == ? %body] to code: ..\%result end end --when == ? - %result + return %result # Try/except compile [..] |
