From ea310306d73e0bc6542f7133825549ae4471b06a Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 12 Sep 2018 15:31:59 -0700 Subject: Initial working version. --- syntax_tree.lua | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'syntax_tree.lua') diff --git a/syntax_tree.lua b/syntax_tree.lua index 8fa15b7..b4cf45e 100644 --- a/syntax_tree.lua +++ b/syntax_tree.lua @@ -26,7 +26,9 @@ local types = { "DictEntry", "IndexChain", "Action", - "FileChunks" + "FileChunks", + "Error", + "Comment" } for _index_0 = 1, #types do local name = types[_index_0] @@ -49,6 +51,10 @@ for _index_0 = 1, #types do return Source:is_instance(x) and tostring(x) or nil end))) end + cls.source_code_for_tree = { } + cls.get_source_code = function(self) + return self.source_code_for_tree[self] + end cls.map = function(self, fn) local replacement = fn(self) if replacement == false then -- cgit v1.2.3