aboutsummaryrefslogtreecommitdiff
path: root/containers.moon
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2018-11-09 16:40:36 -0800
committerBruce Hill <bruce@bruce-hill.com>2018-11-09 16:41:19 -0800
commit69aaea030e08e083151aa25b8080eddd0d4c1683 (patch)
tree6cd90a65e6828f60cc052c4a1b33a4a4c0d65570 /containers.moon
parenta2f07415c5284bf94c146cea6eed4a15f171b9ab (diff)
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.
Diffstat (limited to 'containers.moon')
-rw-r--r--containers.moon6
1 files changed, 3 insertions, 3 deletions
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"