diff options
author | Himbeer <himbeer@disroot.org> | 2024-10-01 19:00:57 +0200 |
---|---|---|
committer | Himbeer <himbeer@disroot.org> | 2024-10-01 19:05:01 +0200 |
commit | 7c2cfd1657924a9d66757a627eef9caa117684a9 (patch) | |
tree | a1d2f6c5b488d3ce9878addc3a41d76a46a9ecff | |
parent | 66a3f35595d429b411a33d90da9c4b56846ceb59 (diff) |
Make return expressions optional
Since it is impossible to construct a value of type void (or even spell
its type) this change is needed to enable returning from void functions
conditionally.
-rw-r--r-- | doc/grammar.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/doc/grammar.txt b/doc/grammar.txt index 8253d00..d3c9829 100644 --- a/doc/grammar.txt +++ b/doc/grammar.txt @@ -32,7 +32,7 @@ else := "else" block for := "for" [ assignment ";" ] expression [ ";" assignment ] block -return := "return" expression +return := "return" [ expression ] break := "break" [ ":" NAME ] [ expression ] continue := "continue" [ ":" NAME ] |