From 7d2b7199d87930096b7fd799709fe0105d51eccb Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 9 Nov 2018 14:36:15 -0800 Subject: Lots of cleanups, including expanded use of (... compiles to "text literal") shorthand, deprecating Lua value, and more use of Lua "..." with text interpolations. --- syntax_tree.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'syntax_tree.lua') diff --git a/syntax_tree.lua b/syntax_tree.lua index 6615f9b..098dbce 100644 --- a/syntax_tree.lua +++ b/syntax_tree.lua @@ -83,9 +83,12 @@ do end return "SyntaxTree{" .. tostring(table.concat(bits, ", ")) .. "}" end, - get_source_code = function(self) + get_source_file = function(self) return self.__class.source_code_for_tree[self] end, + get_source_code = function(self) + return self.__class.source_code_for_tree[self]:sub(self.source.start, self.source.stop) + end, map = function(self, fn) local replacement = fn(self) if replacement == false then -- cgit v1.2.3