aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nomsu.lua8
-rwxr-xr-xnomsu.moon8
2 files changed, 8 insertions, 8 deletions
diff --git a/nomsu.lua b/nomsu.lua
index 9881a5c..a847715 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -1148,17 +1148,17 @@ do
return nil
end,
print_tree = function(self, tree)
- local buff = colors.bright .. colors.green
+ io.write(colors.bright .. colors.green)
for node, depth in coroutine.wrap(function()
return self:walk_tree(tree)
end) do
if type(node) ~= 'table' or not node.type then
- buff = buff + (((" "):rep(depth) .. repr(node)) .. "\n")
+ print((" "):rep(depth) .. repr(node))
else
- buff = buff + ((tostring((" "):rep(depth)) .. tostring(node.type) .. ":") .. "\n")
+ print(tostring((" "):rep(depth)) .. tostring(node.type) .. ":")
end
end
- return print(buff .. colors.reset)
+ return io.write(colors.reset)
end,
tree_to_str = function(self, tree)
local bits = { }
diff --git a/nomsu.moon b/nomsu.moon
index f64b3c9..3523a7a 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -773,13 +773,13 @@ class NomsuCompiler
return nil
print_tree: (tree)=>
- buff = colors.bright..colors.green
+ io.write(colors.bright..colors.green)
for node,depth in coroutine.wrap(-> @walk_tree tree)
if type(node) != 'table' or not node.type
- buff += ((" ")\rep(depth)..repr(node)).."\n"
+ print((" ")\rep(depth)..repr(node))
else
- buff += ("#{(" ")\rep(depth)}#{node.type}:").."\n"
- print(buff..colors.reset)
+ print("#{(" ")\rep(depth)}#{node.type}:")
+ io.write(colors.reset)
tree_to_str: (tree)=>
bits = {}