diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-08-27 13:38:58 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-08-27 13:39:22 -0700 |
| commit | 930d522fbc3ab57faa926ed85f0d35d661722402 (patch) | |
| tree | 8c91c71728b43b4e1817ed182c39bf991cb4b2a9 /syntax_tree.lua | |
| parent | c6a7b0be9ebdddb58a03749705987cb3058060d3 (diff) | |
Bunch of miscellaneous changes. Paved the way a little bit for having
different compiler domains.
Diffstat (limited to 'syntax_tree.lua')
| -rw-r--r-- | syntax_tree.lua | 12 |
1 files changed, 8 insertions, 4 deletions
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 |
