diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-17 17:25:12 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-17 17:25:28 -0700 |
| commit | 77a338c1673ae5815ea2124f709cc657da30e8c8 (patch) | |
| tree | 05465a58eda23f7ca6d914eca817ed18b906f492 /nomsu_compiler.lua | |
| parent | 6afa71d67843c2c0624240d90f6ec2a268a5d300 (diff) | |
Oops, didn't mean to check in smushed_action.
Diffstat (limited to 'nomsu_compiler.lua')
| -rw-r--r-- | nomsu_compiler.lua | 12 |
1 files changed, 10 insertions, 2 deletions
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 |
