From ec17442090e3a193c95d5fd53ef0016ecb53b230 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 18 Apr 2018 15:45:58 -0700 Subject: Cleaning up. --- lua_obj.moon | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lua_obj.moon') 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 -- cgit v1.2.3