aboutsummaryrefslogtreecommitdiff
path: root/core/io.nom
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-09 16:40:36 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-09 16:41:19 -0800
commit69aaea030e08e083151aa25b8080eddd0d4c1683 (patch)
tree6cd90a65e6828f60cc052c4a1b33a4a4c0d65570 /core/io.nom
parenta2f07415c5284bf94c146cea6eed4a15f171b9ab (diff)
No longer passing `tree` to every compile action. Now, you can just
return a LuaCode object, and it will automatically get a source from `tree` if it didn't already have a source. Plus some fixes/cleanup.
Diffstat (limited to 'core/io.nom')
-rw-r--r--core/io.nom8
1 files changed, 4 insertions, 4 deletions
diff --git a/core/io.nom b/core/io.nom
index edeeab4..2df0999 100644
--- a/core/io.nom
+++ b/core/io.nom
@@ -9,17 +9,17 @@ use "core/metaprogramming.nom"
(say %message) compiles to:
lua> "\
..if \%message.type == "Text" then
- return LuaCode(tree.source, "print(", \(%message as lua expr), ");");
+ return LuaCode("print(", \(%message as lua expr), ");");
else
- return LuaCode(tree.source, "print(tostring(", \(%message as lua expr), "));");
+ return LuaCode("print(tostring(", \(%message as lua expr), "));");
end"
(ask %prompt) compiles to:
lua> "\
..if \%prompt.type == "Text" then
- return LuaCode(tree.source, "(io.write(", \(%prompt as lua expr), ") and io.read())");
+ return LuaCode("(io.write(", \(%prompt as lua expr), ") and io.read())");
else
- return LuaCode(tree.source, "(io.write(tostring(", \(..)
+ return LuaCode("(io.write(tostring(", \(..)
%prompt as lua expr
.., ")) and io.read())");
end"