aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-05-14 15:39:12 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-05-14 15:39:16 -0700
commit3be20840caa484e6f07865338bac57de45765c81 (patch)
tree858588061d6952b13e53b9eef2bb2b7b475e319d
parent52a3631ed62e2ac7460bff49eebfa1153abd47ee (diff)
Removing dead code.
-rw-r--r--nomsu.lua32
-rwxr-xr-xnomsu.moon24
2 files changed, 0 insertions, 56 deletions
diff --git a/nomsu.lua b/nomsu.lua
index 3a2679d..7329c2e 100644
--- a/nomsu.lua
+++ b/nomsu.lua
@@ -508,38 +508,6 @@ do
end
return nil
end,
- print_tree = function(self, tree)
- io.write(colors.bright .. colors.green)
- for node, depth in coroutine.wrap(function()
- return self:walk_tree(tree)
- end) do
- if Types.is_node(node) then
- print(tostring((" "):rep(depth)) .. tostring(node.type) .. ":")
- else
- print((" "):rep(depth) .. repr(node))
- end
- end
- return io.write(colors.reset)
- end,
- tree_to_str = function(self, tree)
- local bits = { }
- for node, depth in coroutine.wrap(function()
- return self:walk_tree(tree)
- end) do
- if Types.is_node(node) then
- insert(bits, (tostring((" "):rep(depth)) .. tostring(node.type) .. ":"))
- else
- insert(bits, ((" "):rep(depth) .. repr(node)))
- end
- end
- return concat(bits, "\n")
- end,
- tree_map = function(self, tree, fn)
- if not (Types.is_node(tree)) then
- return tree
- end
- return tree:map(fn)
- end,
tree_with_replaced_vars = function(self, tree, replacements)
if not (next(replacements)) then
return tree
diff --git a/nomsu.moon b/nomsu.moon
index 7ba25e7..c22136d 100755
--- a/nomsu.moon
+++ b/nomsu.moon
@@ -425,30 +425,6 @@ class NomsuCompiler
else @walk_tree(tree.value, depth+1)
return nil
- print_tree: (tree)=>
- io.write(colors.bright..colors.green)
- for node,depth in coroutine.wrap(-> @walk_tree tree)
- if Types.is_node(node)
- print("#{(" ")\rep(depth)}#{node.type}:")
- else
- print((" ")\rep(depth)..repr(node))
- io.write(colors.reset)
-
- tree_to_str: (tree)=>
- bits = {}
- for node,depth in coroutine.wrap(-> @walk_tree tree)
- if Types.is_node(node)
- insert bits, ("#{(" ")\rep(depth)}#{node.type}:")
- else
- insert bits, ((" ")\rep(depth)..repr(node))
- return concat(bits, "\n")
-
- tree_map: (tree, fn)=>
- -- Return a new tree with fn mapped to each node. If fn provides a replacement,
- -- use that and stop recursing, otherwise recurse.
- unless Types.is_node(tree) then return tree
- return tree\map(fn)
-
tree_with_replaced_vars: (tree, replacements)=>
return tree unless next(replacements)
if next(replacements).type == "Var"