aboutsummaryrefslogtreecommitdiff
path: root/core/scopes.nom
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-07-18 17:55:29 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-07-18 17:56:15 -0700
commitbf67a610135c0803187cf6ed896638962f142d14 (patch)
treea0b126c954168282c8c69ea728d4abbae712ac33 /core/scopes.nom
parentacb86f78c3f79479ac3a73f0e5862f8f5d8f31f5 (diff)
Updating to version 2.4.4.3, with new syntax for multi-statement 'if'
and switch statements.
Diffstat (limited to 'core/scopes.nom')
-rw-r--r--core/scopes.nom13
1 files changed, 6 insertions, 7 deletions
diff --git a/core/scopes.nom b/core/scopes.nom
index 2be24e6..30bdea0 100644
--- a/core/scopes.nom
+++ b/core/scopes.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V2.3.4.3
+#!/usr/bin/env nomsu -V2.4.4.3
#
This file contains definitions pertaining to variable scoping
@@ -8,17 +8,16 @@ use "core/collections.nom"
use "core/control_flow.nom"
compile [with local %locals %body, with local %locals do %body] to:
%body_lua = (%body as lua statements)
- when %locals.type = ?:
- * "Dict":
+ if %locals.type is:
+ "Dict":
%body_lua = (..)
Lua "\(compile as (<- %locals))\n\%body_lua"
declare locals ("\(%.1 as lua)" for % in %locals) in %body_lua
- * "List": declare locals ("\(% as lua)" for % in %locals) in %body_lua
- * "Var"
- * "Action": declare locals ["\(%locals as lua)"] in %body_lua
- *else (barf "Unexpected local: \(%locals as nomsu)")
+ "List": declare locals ("\(% as lua)" for % in %locals) in %body_lua
+ "Var" "Action": declare locals ["\(%locals as lua)"] in %body_lua
+ else: compile error at %locals.source "Unexpected locals: %s"
return (..)
Lua "do\n \%body_lua\nend" \ No newline at end of file