diff options
| author | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-26 12:38:17 -0700 |
|---|---|---|
| committer | Bruce Hill <bitbucket@bruce-hill.com> | 2018-07-26 12:38:17 -0700 |
| commit | ed996ad1b690c45ffb33dacb9eccd45e7364dce5 (patch) | |
| tree | 7112e715a0b30640935d3c87d2cf40d52cc1d725 | |
| parent | a69555bc03cc5fe75215a48b34b1e504c1afe512 (diff) | |
Switching compile action to parse action for 3-way comparison.
| -rw-r--r-- | core/operators.nom | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/core/operators.nom b/core/operators.nom index 2805b87..a44f06b 100644 --- a/core/operators.nom +++ b/core/operators.nom @@ -206,28 +206,28 @@ test: Three-way comparison evaluated middle value multiple times parse [%x < %y < %z] as (..) - =lua "(function(x,y,z) return x < y and y < z; end)(\%x,\%y,\%z)" + call ([%a, %b, %c] -> ((%a < %b) and (%b < %c))) with [%x, %y, %z] parse [%x <= %y < %z] as (..) - =lua "(function(x,y,z) return x <= y and y < z; end)(\%x,\%y,\%z)" + call ([%a, %b, %c] -> ((%a <= %b) and (%b < %c))) with [%x, %y, %z] parse [%x < %y <= %z] as (..) - =lua "(function(x,y,z) return x < y and y <= z; end)(\%x,\%y,\%z)" + call ([%a, %b, %c] -> ((%a < %b) and (%b <= %c))) with [%x, %y, %z] parse [%x <= %y <= %z] as (..) - =lua "(function(x,y,z) return x <= y and y <= z; end)(\%x,\%y,\%z)" + call ([%a, %b, %c] -> ((%a <= %b) and (%b <= %c))) with [%x, %y, %z] parse [%x > %y > %z] as (..) - =lua "(function(x,y,z) return x > y and y > z; end)(\%x,\%y,\%z)" + call ([%a, %b, %c] -> ((%a > %b) and (%b > %c))) with [%x, %y, %z] parse [%x >= %y > %z] as (..) - =lua "(function(x,y,z) return x >= y and y > z; end)(\%x,\%y,\%z)" + call ([%a, %b, %c] -> ((%a >= %b) and (%b > %c))) with [%x, %y, %z] parse [%x > %y >= %z] as (..) - =lua "(function(x,y,z) return x > y and y >= z; end)(\%x,\%y,\%z)" + call ([%a, %b, %c] -> ((%a > %b) and (%b >= %c))) with [%x, %y, %z] parse [%x >= %y >= %z] as (..) - =lua "(function(x,y,z) return x >= y and y >= z; end)(\%x,\%y,\%z)" + call ([%a, %b, %c] -> ((%a >= %b) and (%b >= %c))) with [%x, %y, %z] # TODO: optimize for common case where x,y,z are all either variables or number literals # Boolean Operators |
