diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-04-18 15:45:58 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-04-18 15:46:01 -0700 |
| commit | ec17442090e3a193c95d5fd53ef0016ecb53b230 (patch) | |
| tree | 5782dd53c3a91c036df817f5de0d55d55adf01ee /lua_obj.lua | |
| parent | 16f3a189fd9b32f599d1271c772e6d4287f95d20 (diff) | |
Cleaning up.
Diffstat (limited to 'lua_obj.lua')
| -rw-r--r-- | lua_obj.lua | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/lua_obj.lua b/lua_obj.lua index eca0bf1..569752a 100644 --- a/lua_obj.lua +++ b/lua_obj.lua @@ -150,13 +150,17 @@ do _class_0 = setmetatable({ __init = function(self, source, ...) self.source = source - if type(self.source) == 'string' then - local filename, start, stop = self.source:match("^(.-)[(%d+):(%d+)]$") - self.source = Source(filename, tonumber(start), tonumber(stop)) - end self.bits = { ... } + if type(self.source) == 'string' then + local filename, start, stop = self.source:match("^(.-)[(%d+):(%d+)]$") + if start or stop then + self.source = Source(filename, tonumber(start), tonumber(stop)) + else + self.source = Source(self.source, 1, #self) + end + end end, __base = _base_0, __name = "Code" |
