aboutsummaryrefslogtreecommitdiff
path: root/syntax_tree.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-09-12 15:31:59 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-09-12 15:32:04 -0700
commitea310306d73e0bc6542f7133825549ae4471b06a (patch)
treefcc2a5a868fe09fb599d8261f66dad96ac69bb0b /syntax_tree.lua
parent9e10c8bf006f42e90a011b8f9284e3ffa52a5859 (diff)
Initial working version.
Diffstat (limited to 'syntax_tree.lua')
-rw-r--r--syntax_tree.lua8
1 files changed, 7 insertions, 1 deletions
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