From 7d2b7199d87930096b7fd799709fe0105d51eccb Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 9 Nov 2018 14:36:15 -0800 Subject: Lots of cleanups, including expanded use of (... compiles to "text literal") shorthand, deprecating Lua value, and more use of Lua "..." with text interpolations. --- core/metaprogramming.nom | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'core/metaprogramming.nom') diff --git a/core/metaprogramming.nom b/core/metaprogramming.nom index be7450a..2ae8b1b 100644 --- a/core/metaprogramming.nom +++ b/core/metaprogramming.nom @@ -71,9 +71,8 @@ lua> "\ if \%body.type == "Text" then \%body = SyntaxTree{source=\%body.source, type="Action", "Lua", \%body} end - local lua = LuaCode(tree.source, "compile.action[", \%action.stub:as_lua(), + return LuaCode(tree.source, "compile.action[", \%action.stub:as_lua(), "] = ", \(what (%args -> %body) compiles to)) - return lua end" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -332,7 +331,7 @@ test: ..one "two"" ..== "\"one\\n\\\"two\\\"\"" -(quote %s) compiles to (Lua "tostring(\(%s as lua expr)):as_lua()") +(quote %s) compiles to "tostring(\(%s as lua expr)):as_lua()" test: assume (lua type of {}) == "table" -- cgit v1.2.3