aboutsummaryrefslogtreecommitdiff
path: root/nomsu_tree.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-04-20 14:33:49 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-04-20 14:33:57 -0700
commit14bda2fb2d881bd2ad4f1a53aabb937b534d545e (patch)
treea6ecd7b204f5285a773a32b2b43d63595e547e77 /nomsu_tree.lua
parent931ae40f408c789eca3a2bf36e886f174f4f8038 (diff)
Cleanups and optimizations.
Diffstat (limited to 'nomsu_tree.lua')
-rw-r--r--nomsu_tree.lua14
1 files changed, 1 insertions, 13 deletions
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)