From 4f30e02acb666c52e0254eb9a3bf89a9cabb5e6d Mon Sep 17 00:00:00 2001 From: Bruce Hill Date: Wed, 29 Aug 2018 19:38:14 -0700 Subject: Handling more compatibility stuff, including Lua 5.4, and a backup for if openssl module is not found, and moving containers (List/Dict) into their own file, as well as bit operators (and support for __bxor, etc. metamethods in Lua 5.2/LuaJIT) --- core/operators.nom | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'core/operators.nom') diff --git a/core/operators.nom b/core/operators.nom index fbf88bb..863ebc8 100644 --- a/core/operators.nom +++ b/core/operators.nom @@ -238,7 +238,7 @@ compile [%x or %y] to (Lua value "(\(%x as lua expr) or \(%y as lua expr))") # Bitwise Operators # TODO: implement OR, XOR, AND for multiple operands? test: - assume ((~ 5) == -6) + assume ((~ (~ 5)) == 5) assume ((1 | 4) == 5) assume ((1 ~ 3) == 2) assume ((1 & 3) == 1) @@ -285,8 +285,8 @@ compile [- %] to (Lua value "(- \(% as lua expr))") compile [not %] to (Lua value "(not \(% as lua expr))") test: - assume ((length of [1, 2, 3]) == 3) -compile [length of %list, len %list, || %list ||] to (..) + assume ((size of [1, 2, 3]) == 3) +compile [size of %list, length of %list, len %list, || %list ||] to (..) Lua value "(#\(%list as lua expr))" compile [%list is empty] to (Lua value "(#\(%list as lua expr) == 0)") -- cgit v1.2.3