aboutsummaryrefslogtreecommitdiff
path: root/core/metaprogramming.nom
diff options
context:
space:
mode:
Diffstat (limited to 'core/metaprogramming.nom')
-rw-r--r--core/metaprogramming.nom12
1 files changed, 9 insertions, 3 deletions
diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom
index 544ae59..b56f0e9 100644
--- a/core/metaprogramming.nom
+++ b/core/metaprogramming.nom
@@ -98,13 +98,13 @@ immediately:
action [remove action %stub]:
lua> ".."
- local fn = ACTION[\%stub];
+ local fn = ACTIONS[\%stub];
local metadata = ACTION_METADATA[fn];
for i=#metadata.aliases,1,-1 do
metadata.arg_orders[metadata.aliases[i]] = nil;
table.remove(metadata.aliases, i);
end
- ACTION[\%stub] = nil;
+ ACTIONS[\%stub] = nil;
immediately:
action [%tree as lua]:
@@ -141,7 +141,7 @@ immediately:
compile [%var as lua identifier] to {expr:"nomsu:var_to_lua_identifier(\(%var as lua expr))"}
action [action %names metadata]:
- =lua "ACTION_METADATA[ACTION[\%names]]"
+ =lua "ACTION_METADATA[ACTIONS[\%names]]"
# Get the source code for a function
action [help %action]:
@@ -160,6 +160,12 @@ immediately:
parse [disable debugging] as: lua> "nomsu.debug = false;"
immediately:
+ compile [show lua %block] to:
+ lua> ".."
+ local \%lua = nomsu:tree_to_lua(\%block);
+ return {statements = "print("..repr(\%lua.statements or \%lua.expr)..");"};
+
+immediately:
compile [say %message] to:
lua> ".."
if \%message.type == "Text" then