From 77a338c1673ae5815ea2124f709cc657da30e8c8 Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Tue, 17 Jul 2018 17:25:12 -0700 Subject: Oops, didn't mean to check in smushed_action. --- nomsu_compiler.moon | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'nomsu_compiler.moon') diff --git a/nomsu_compiler.moon b/nomsu_compiler.moon index 877de6b..e89dffa 100644 --- a/nomsu_compiler.moon +++ b/nomsu_compiler.moon @@ -71,13 +71,17 @@ _list_mt = __lt: (other)=> assert type(@) == 'table' and type(other) == 'table', "Incompatible types for comparison" for i=1,math.max(#@, #other) - if @[i] < other[i] then return true + if not @[i] and other[i] then return true + elseif @[i] and not other[i] then return false + elseif @[i] < other[i] then return true elseif @[i] > other[i] then return false return false __le: (other)=> assert type(@) == 'table' and type(other) == 'table', "Incompatible types for comparison" for i=1,math.max(#@, #other) - if @[i] < other[i] then return true + if not @[i] and other[i] then return true + elseif @[i] and not other[i] then return false + elseif @[i] < other[i] then return true elseif @[i] > other[i] then return false return true -- cgit v1.2.3