From ab38fd19fa6e30b4a0629b3445812cb6bf025a25 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Thu, 30 Aug 2018 14:06:41 -0700 Subject: Fixed obnoxious bug where List was getting used instead of a Dict, causing havoc when .first and .pop were being accessed. --- syntax_tree.lua | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) (limited to 'syntax_tree.lua') diff --git a/syntax_tree.lua b/syntax_tree.lua index 2f50f09..bc4d0a5 100644 --- a/syntax_tree.lua +++ b/syntax_tree.lua @@ -70,6 +70,12 @@ for _index_0 = 1, #types do unpack(self.comments) } end + do + local init = replacement.__init + if init then + init(replacement) + end + end end else replacement = { @@ -102,6 +108,12 @@ for _index_0 = 1, #types do return self end replacement = setmetatable(replacement, getmetatable(self)) + do + local init = replacement.__init + if init then + init(replacement) + end + end end return replacement end @@ -131,13 +143,24 @@ for _index_0 = 1, #types do assert(Source:is_instance(t.source)) end setmetatable(t, self) - if t.__init then - t:__init() + do + local init = t.__init + if init then + init(t) + end end return t end }) end +AST.Block.__init = function(self) + for _index_0 = 1, #self do + local a = self[_index_0] + if not AST.is_syntax_tree(a) then + require('ldt').breakpoint() + end + end +end AST.Action.__init = function(self) local stub_bits = { } local arg_i = 1 -- cgit v1.2.3