diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-04-25 17:43:48 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-04-25 17:44:24 -0700 |
| commit | 4e821308af654706b8bda5f3d00dce7a933d9942 (patch) | |
| tree | 674f4eea13cd7475a14344132ec6f12937ac9a96 /core/control_flow.nom | |
| parent | 5d59d510cd6fdc8553250e5ec10f19a285e8878c (diff) | |
Overhauling parsing of Blocks (can no longer contain only one statement)
Diffstat (limited to 'core/control_flow.nom')
| -rw-r--r-- | core/control_flow.nom | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/control_flow.nom b/core/control_flow.nom index b51ecdf..d3d18ac 100644 --- a/core/control_flow.nom +++ b/core/control_flow.nom @@ -261,7 +261,9 @@ immediately %fallthroughs <- [] %is_first <- (yes) %seen_else <- (no) - for %func_call in %body.value + %branches <- + %body.value if (%body.type = "Block") else [%body] + for %func_call in %branches assume (%func_call.type is "Action") or barf ".." Invalid format for 'when' statement. Only '*' blocks are allowed. %tokens <- %func_call.value @@ -308,7 +310,9 @@ immediately %fallthroughs <- [] %is_first <- (yes) %seen_else <- (no) - for %func_call in %body.value + %branches <- + %body.value if (%body.type = "Block") else [%body] + for %func_call in %branches assume (%func_call.type is "Action") or barf ".." Invalid format for 'when' statement. Only '*' blocks are allowed. %tokens <- %func_call.value |
