aboutsummaryrefslogtreecommitdiff
path: root/nomsu.moon
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-05-03 22:33:44 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-05-03 22:34:00 -0700
commita5bbce315dd9e6861d426bb16a3d792e2a3c0dfc (patch)
treef52d66e366bcc9c2aee002a27e69febc6cadef9b /nomsu.moon
parentbf60ac28c5ab128a15d1b0a2d5f1021dbe7081fd (diff)
Minor tweaks/cleanups.
Diffstat (limited to 'nomsu.moon')
-rwxr-xr-xnomsu.moon9
1 files changed, 3 insertions, 6 deletions
diff --git a/nomsu.moon b/nomsu.moon
index fd6899f..cc6b17b 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -243,7 +243,7 @@ class NomsuCompiler
(...)->
error("Attempt to run undefined action: #{key}", 0)
})
- @environment.MACROS = {}
+ @environment.COMPILE_ACTIONS = {}
@environment.ARG_ORDERS = setmetatable({}, {__mode:"k"})
@environment.LOADED = {}
@environment.Types = Types
@@ -258,7 +258,7 @@ class NomsuCompiler
{~ (%space->'') (('%' (%varname->'')) / %word)? ((%space->' ') (('%' (%varname->'')) / %word))* (%space->'') ~}
]=], stub_defs
var_pattern = re.compile "{| %space ((('%' {%varname}) / %word) %space)+ |}", stub_defs
- define_action: (signature, fn, is_macro=false)=>
+ define_action: (signature, fn, is_compile_action=false)=>
assert(type(fn) == 'function', "Bad fn: #{repr fn}")
if type(signature) == 'string'
signature = {signature}
@@ -275,7 +275,7 @@ class NomsuCompiler
for alias in *signature
stub = assert(stub_pattern\match(alias))
stub_args = assert(var_pattern\match(alias))
- (is_macro and @environment.MACROS or @environment.ACTIONS)[stub] = fn
+ (is_compile_action and @environment.COMPILE_ACTIONS or @environment.ACTIONS)[stub] = fn
arg_orders[stub] = [fn_arg_positions[@var_to_lua_identifier(a)] for a in *stub_args]
@environment.ARG_ORDERS[fn] = arg_orders
@@ -522,9 +522,6 @@ class NomsuCompiler
lua\append bit_lua
return lua
- @define_compile_action "!! code location !!", =>
- return Lua.Value(@source, repr(tostring(@source)))
-
@define_action "run file %filename", (_filename)->
return nomsu\run_file(_filename)