diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2019-03-20 16:16:41 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2019-03-20 16:16:41 -0700 |
| commit | 938adbfe446e7f4a4e45b9dd27b5cf2e7ee4070c (patch) | |
| tree | 1a28126609a6d2ad3acabfa044aea106f0abf10b /lib/core | |
| parent | e665d9725c4bb02f4c18d16527367f424cb880fa (diff) | |
Switching more verbose ("Action" tree with "foo" $x) syntax to `(foo
`$x) when possible
Diffstat (limited to 'lib/core')
| -rw-r--r-- | lib/core/control_flow.nom | 26 | ||||
| -rw-r--r-- | lib/core/things.nom | 2 |
2 files changed, 14 insertions, 14 deletions
diff --git a/lib/core/control_flow.nom b/lib/core/control_flow.nom index 481507f..1329cc8 100644 --- a/lib/core/control_flow.nom +++ b/lib/core/control_flow.nom @@ -232,18 +232,18 @@ test: if ($body, contains `(do next)): $lua, add "\n ::continue::" - if ($key and ($body, contains ("Action" tree with "do" "next" $key))): - $lua, add "\n " (("Action" tree with "---" "next" $key "---") as lua) + if ($key and ($body, contains `(do next `$key))): + $lua, add "\n " (`(---next `$key ---) as lua) - if ($body, contains ("Action" tree with "do" "next" $value)): - $lua, add "\n " (("Action" tree with "---" "next" $value "---") as lua) + if ($body, contains `(do next `$value)): + $lua, add "\n " (`(---next `$value ---) as lua) $lua, add "\n end" - if ($key and ($body, contains ("Action" tree with "stop" $key))): - $lua, add "\n " (("Action" tree with "---" "stop" $key "---") as lua) + if ($key and ($body, contains `(stop `$key))): + $lua, add "\n " (`(---stop `$key ---) as lua) - if ($body, contains ("Action" tree with "stop" $value)): - $lua, add "\n " (("Action" tree with "---" "stop" $value "---") as lua) + if ($body, contains `(stop `$value)): + $lua, add "\n " (`(---stop `$value ---) as lua) $lua, add "\nend -- for-loop" $lua, remove free vars @@ -445,7 +445,7 @@ test: assume ((result of: return 99) == 99) ### Inline thunk: -(result of $body) compiles to "\(("Action" tree with "->" $body) as lua)()" +(result of $body) compiles to "\(`(-> `$body) as lua)()" test: $t = [1, [2, [[3], 4], 5, [[[6]]]]] $flat = [] @@ -474,11 +474,11 @@ test: if ($body, contains `(do next)): $lua, add "\n ::continue::" - if ($body, contains ("Action" tree with "do" "next" $var)): - $lua, add "\n \(("Action" tree with "---" "next" $var "---") as lua)" + if ($body, contains `(do next `$var)): + $lua, add "\n \(`(---next `$var ---) as lua)" $lua, add "\n end -- Recursive loop" - if ($body, contains ("Action" tree with "stop" $var)): - $lua, add "\n \(("Action" tree with "---" "stop" $var "---") as lua)" + if ($body, contains `(stop `$var)): + $lua, add "\n \(`(---stop `$var ---) as lua)" $lua, add "\nend -- Recursive scope" return $lua diff --git a/lib/core/things.nom b/lib/core/things.nom index e83f88d..e6d215a 100644 --- a/lib/core/things.nom +++ b/lib/core/things.nom @@ -121,4 +121,4 @@ external: ") $lua, add free vars [$class_id] - return $lua
\ No newline at end of file + return $lua |
