From 95f3f55ff2598cd3f00baa3317ebd98ce252f0be Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 26 Jan 2018 15:03:07 -0800 Subject: Cleaned up unnecessary buffer use. --- nomsu.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'nomsu.lua') 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 = { } -- cgit v1.2.3