aboutsummaryrefslogtreecommitdiff
path: root/core/operators.nom
diff options
context:
space:
mode:
Diffstat (limited to 'core/operators.nom')
-rw-r--r--core/operators.nom12
1 files changed, 10 insertions, 2 deletions
diff --git a/core/operators.nom b/core/operators.nom
index 70b0207..bce91c4 100644
--- a/core/operators.nom
+++ b/core/operators.nom
@@ -1,4 +1,4 @@
-#!/usr/bin/env nomsu -V2.3.4.3
+#!/usr/bin/env nomsu -V2.4.4.3
#
This file contains definitions of operators like "+" and "and".
@@ -147,21 +147,29 @@ compile [%x wrapped around %y, %x mod %y] to (..)
# (uses a lambda to avoid re-evaluating middle value, while still being an expression)
parse [%x < %y < %z] as (..)
=lua "(function(x,y,z) return x < y and y < z; end)(\%x,\%y,\%z)"
+
parse [%x <= %y < %z] as (..)
=lua "(function(x,y,z) return x <= y and y < z; end)(\%x,\%y,\%z)"
+
parse [%x < %y <= %z] as (..)
=lua "(function(x,y,z) return x < y and y <= z; end)(\%x,\%y,\%z)"
+
parse [%x <= %y <= %z] as (..)
=lua "(function(x,y,z) return x <= y and y <= z; end)(\%x,\%y,\%z)"
+
parse [%x > %y > %z] as (..)
=lua "(function(x,y,z) return x > y and y > z; end)(\%x,\%y,\%z)"
+
parse [%x >= %y > %z] as (..)
=lua "(function(x,y,z) return x >= y and y > z; end)(\%x,\%y,\%z)"
+
parse [%x > %y >= %z] as (..)
=lua "(function(x,y,z) return x > y and y >= z; end)(\%x,\%y,\%z)"
+
parse [%x >= %y >= %z] as (..)
=lua "(function(x,y,z) return x >= y and y >= z; end)(\%x,\%y,\%z)"
+
# TODO: optimize for common case where x,y,z are all either variables or number literals
# Boolean Operators
compile [%x and %y] to (Lua value "(\(%x as lua expr) and \(%y as lua expr))")
@@ -204,4 +212,4 @@ parse [%var /= %] as (%var = (%var / %))
parse [%var ^= %] as (%var = (%var ^ %))
parse [%var and= %] as (%var = (%var and %))
parse [%var or= %] as (%var = (%var or %))
-parse [wrap %var around %] as (%var = (%var wrapped around %))
+parse [wrap %var around %] as (%var = (%var wrapped around %)) \ No newline at end of file