aboutsummaryrefslogtreecommitdiff
path: root/syntax_tree.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-08-30 14:06:41 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-08-30 14:07:40 -0700
commitab38fd19fa6e30b4a0629b3445812cb6bf025a25 (patch)
treeea2a2c71535d1a9c58ca947671ca039441a728cc /syntax_tree.lua
parent77ebe2fb2a7f6508437f1560af031eb8abd4672b (diff)
Fixed obnoxious bug where List was getting used instead of a Dict,
causing havoc when .first and .pop were being accessed.
Diffstat (limited to 'syntax_tree.lua')
-rw-r--r--syntax_tree.lua27
1 files changed, 25 insertions, 2 deletions
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