aboutsummaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-02-06 22:06:39 -0800
committerBruce Hill <bitbucket@bruce-hill.com>2018-02-06 22:07:11 -0800
commit3661754ed90e7b85bcfe61d6b44a65436c9c4c3f (patch)
tree3ce18d2e4bf8e910832a4b2634f26523b2788b61 /core
parente8d5d2a24061347a96ae9feda45ceb0d6dca09be (diff)
Reverted to ACTIONS instead of ACTION and added 'show lua %' macro.
Diffstat (limited to 'core')
-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