From a5bbce315dd9e6861d426bb16a3d792e2a3c0dfc Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 3 May 2018 22:33:44 -0700 Subject: Minor tweaks/cleanups. --- nomsu.moon | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'nomsu.moon') 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) -- cgit v1.2.3