aboutsummaryrefslogtreecommitdiff
path: root/code_obj.lua
diff options
context:
space:
mode:
authorBruce Hill <bitbucket@bruce-hill.com>2018-05-30 17:20:22 -0700
committerBruce Hill <bitbucket@bruce-hill.com>2018-05-30 17:21:19 -0700
commitb53516c47c0dd1f9325f9f721f561487510cca98 (patch)
tree92961e19bc94eec3ab8b0f19357c57399c205b7d /code_obj.lua
parent5637676bc45ce9aa3015726485f63a2a5745a45a (diff)
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]"
Diffstat (limited to 'code_obj.lua')
-rw-r--r--code_obj.lua8
1 files changed, 4 insertions, 4 deletions
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)