From 14bda2fb2d881bd2ad4f1a53aabb937b534d545e Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 20 Apr 2018 14:33:49 -0700 Subject: Cleanups and optimizations. --- nomsu_tree.lua | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) (limited to 'nomsu_tree.lua') diff --git a/nomsu_tree.lua b/nomsu_tree.lua index 25fef75..b42fe52 100644 --- a/nomsu_tree.lua +++ b/nomsu_tree.lua @@ -13,18 +13,6 @@ do local _obj_0 = require("lua_obj") Lua, Location = _obj_0.Lua, _obj_0.Location end -local common_methods = { - __tostring = function(self) - return tostring(self.name) .. "(" .. tostring(repr(self.value)) .. ")" - end, - with_value = function(self, value) - return getmetatable(self)(value, self.source) - end -} -local fields = { - "value", - "source" -} local Types = { } Types.DictEntry = immutable({ "key", @@ -39,7 +27,7 @@ local Tree Tree = function(name, methods) do methods.__tostring = function(self) - return tostring(self.name) .. "(" .. tostring(repr(self.value)) .. ")" + return tostring(self.name) .. "(" .. tostring(repr(self.value)) .. ", " .. tostring(repr(self.source)) .. ")" end methods.with_value = function(self, value) return getmetatable(self)(value, self.source) -- cgit v1.2.3