diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-11 14:13:43 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-11 14:14:16 -0700 |
| commit | ba2b83d5669f9fcf6f49fcd2adac5997eb07f7d8 (patch) | |
| tree | 55d0ecaafd6c5c871bd987a28a2b61fca16b250c /core/control_flow.nom | |
| parent | b32634faf8eb0fe1448ca44ddf9b3a6bfaf20b68 (diff) | |
Fixed nomsu codegen for indented text and improved text parsing. Also
moved some more tests inline.
Diffstat (limited to 'core/control_flow.nom')
| -rw-r--r-- | core/control_flow.nom | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/core/control_flow.nom b/core/control_flow.nom index 61438d1..4733168 100644 --- a/core/control_flow.nom +++ b/core/control_flow.nom @@ -8,14 +8,17 @@ use "core/operators.nom" use "core/errors.nom" # No-Op +test: do nothing compile [do nothing] to: Lua "" # Conditionals +test: if (no): barf "conditional fail" compile [if %condition %if_body] to Lua ".." if \(%condition as lua expr) then \(%if_body as lua statements) end +test: unless (yes): barf "conditional fail" parse [unless %condition %unless_body] as: if (not %condition) %unless_body compile [if %condition %if_body else %else_body, unless %condition %else_body else %if_body] to |
