From 69aaea030e08e083151aa25b8080eddd0d4c1683 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Fri, 9 Nov 2018 16:40:36 -0800 Subject: No longer passing `tree` to every compile action. Now, you can just return a LuaCode object, and it will automatically get a source from `tree` if it didn't already have a source. Plus some fixes/cleanup. --- containers.moon | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'containers.moon') diff --git a/containers.moon b/containers.moon index 4cafdaf..990a741 100644 --- a/containers.moon +++ b/containers.moon @@ -85,9 +85,9 @@ _list_mt = return nil from_1_to: (start, stop)=> n = #@ - start = (n+1-start) if n < 0 - stop = (n+1-stop) if n < 0 - return [@[i] for i=start,stop] + start = (n+1-start) if start < 0 + stop = (n+1-stop) if stop < 0 + return List[@[i] for i=start,stop] -- TODO: remove this safety check to get better performance? __newindex: (k,v)=> assert type(k) == 'number', "List indices must be numbers" -- cgit v1.2.3