From 930d522fbc3ab57faa926ed85f0d35d661722402 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Mon, 27 Aug 2018 13:38:58 -0700 Subject: Bunch of miscellaneous changes. Paved the way a little bit for having different compiler domains. --- syntax_tree.lua | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'syntax_tree.lua') diff --git a/syntax_tree.lua b/syntax_tree.lua index 64b4efc..9b47123 100644 --- a/syntax_tree.lua +++ b/syntax_tree.lua @@ -40,11 +40,15 @@ for _index_0 = 1, #types do return getmetatable(x) == self end cls.__tostring = function(self) - return tostring(self.type) .. "(" .. tostring(repr(tostring(self.source))) .. ", " .. tostring(concat((function() + local args = { + tostring(self.source), + unpack(self) + } + return tostring(self.type) .. "(" .. tostring(concat((function() local _accum_0 = { } local _len_0 = 1 - for _index_1 = 1, #self do - local v = self[_index_1] + for _index_1 = 1, #args do + local v = args[_index_1] _accum_0[_len_0] = repr(v) _len_0 = _len_0 + 1 end @@ -114,7 +118,7 @@ for _index_0 = 1, #types do end AST[name] = setmetatable(cls, { __tostring = function(self) - return self.name + return self.__name end, __call = function(self, source, ...) if type(source) == 'string' then -- cgit v1.2.3