From b53516c47c0dd1f9325f9f721f561487510cca98 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 30 May 2018 17:20:22 -0700 Subject: Simplified and correctified lib/object (though the codegen still need streamlining), added a .stub member to Action trees, and switched Source's repr to be @filename[start:stop] instead of "filename[start:stop]" --- code_obj.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'code_obj.lua') diff --git a/code_obj.lua b/code_obj.lua index 848ed84..dcdd95a 100644 --- a/code_obj.lua +++ b/code_obj.lua @@ -22,17 +22,17 @@ Source = immutable({ return filename, start, stop end, from_string = function(self, str) - local filename, start, stop = str:match("^(.-)%[(%d+):(%d+)%]$") + local filename, start, stop = str:match("^@(.-)%[(%d+):(%d+)%]$") if not (filename) then - filename, start = str:match("^(.-)%[(%d+)%]$") + filename, start = str:match("^@(.-)%[(%d+)%]$") end return Source(filename or str, tonumber(start or 1), tonumber(stop)) end, __tostring = function(self) if self.stop then - return "\"" .. tostring(self.filename) .. "[" .. tostring(self.start) .. ":" .. tostring(self.stop) .. "]\"" + return "@" .. tostring(self.filename) .. "[" .. tostring(self.start) .. ":" .. tostring(self.stop) .. "]" else - return "\"" .. tostring(self.filename) .. "[" .. tostring(self.start) .. "]\"" + return "@" .. tostring(self.filename) .. "[" .. tostring(self.start) .. "]" end end, __lt = function(self, other) -- cgit v1.2.3