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.lua | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'nomsu_compiler.lua') diff --git a/nomsu_compiler.lua b/nomsu_compiler.lua index ac3e741..b096659 100644 --- a/nomsu_compiler.lua +++ b/nomsu_compiler.lua @@ -94,7 +94,11 @@ local _list_mt = { __lt = function(self, other) assert(type(self) == 'table' and type(other) == 'table', "Incompatible types for comparison") for i = 1, math.max(#self, #other) do - if self[i] < other[i] then + if not self[i] and other[i] then + return true + elseif self[i] and not other[i] then + return false + elseif self[i] < other[i] then return true elseif self[i] > other[i] then return false @@ -105,7 +109,11 @@ local _list_mt = { __le = function(self, other) assert(type(self) == 'table' and type(other) == 'table', "Incompatible types for comparison") for i = 1, math.max(#self, #other) do - if self[i] < other[i] then + if not self[i] and other[i] then + return true + elseif self[i] and not other[i] then + return false + elseif self[i] < other[i] then return true elseif self[i] > other[i] then return false -- cgit v1.2.3