aboutsummaryrefslogtreecommitdiff
path: root/nomsu_compiler.lua
diff options
context:
space:
mode:
Diffstat (limited to 'nomsu_compiler.lua')
-rw-r--r--nomsu_compiler.lua12
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