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.moon | |
| parent | 6afa71d67843c2c0624240d90f6ec2a268a5d300 (diff) | |
Oops, didn't mean to check in smushed_action.
Diffstat (limited to 'nomsu_compiler.moon')
| -rw-r--r-- | nomsu_compiler.moon | 8 |
1 files changed, 6 insertions, 2 deletions
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 |
