aboutsummaryrefslogtreecommitdiff
path: root/lua_obj.moon
diff options
context:
space:
mode:
Diffstat (limited to 'lua_obj.moon')
-rw-r--r--lua_obj.moon7
1 files changed, 5 insertions, 2 deletions
diff --git a/lua_obj.moon b/lua_obj.moon
index 6ee1970..c315bdc 100644
--- a/lua_obj.moon
+++ b/lua_obj.moon
@@ -62,10 +62,13 @@ Source = immutable {"filename","start","stop"}, {
class Code
new: (@source, ...)=>
+ @bits = {...}
if type(@source) == 'string'
filename,start,stop = @source\match("^(.-)[(%d+):(%d+)]$")
- @source = Source(filename, tonumber(start), tonumber(stop))
- @bits = {...}
+ if start or stop
+ @source = Source(filename, tonumber(start), tonumber(stop))
+ else
+ @source = Source(@source, 1, #self)
clone: =>
cls = @__class