diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2018-11-09 14:36:15 -0800 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2018-11-09 14:37:22 -0800 |
| commit | 7d2b7199d87930096b7fd799709fe0105d51eccb (patch) | |
| tree | f33de61cb44357497758bb08ec6993753d8baa43 /syntax_tree.lua | |
| parent | ba96cdfa07cea15ada62f8f89b2563de1286a0de (diff) | |
Lots of cleanups, including expanded use of (... compiles to "text
literal") shorthand, deprecating Lua value, and more use of Lua "..."
with text interpolations.
Diffstat (limited to 'syntax_tree.lua')
| -rw-r--r-- | syntax_tree.lua | 5 |
1 files changed, 4 insertions, 1 deletions
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 |
