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.moon | |
| parent | 16f3a189fd9b32f599d1271c772e6d4287f95d20 (diff) | |
Cleaning up.
Diffstat (limited to 'lua_obj.moon')
| -rw-r--r-- | lua_obj.moon | 7 |
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 |
