From 4dee1f562de247cb202362ab276303b0dc717453 Mon Sep 17 00:00:00 2001 From: elioat Date: Sun, 9 Jun 2024 18:11:04 -0400 Subject: * --- lua/chupacabra/chupacabra.lua | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lua/chupacabra/chupacabra.lua') diff --git a/lua/chupacabra/chupacabra.lua b/lua/chupacabra/chupacabra.lua index e64afc3..562dc6b 100644 --- a/lua/chupacabra/chupacabra.lua +++ b/lua/chupacabra/chupacabra.lua @@ -60,6 +60,22 @@ function chupacabra.evaluate(tokens, context) local b = table.remove(stack) table.insert(stack, a) table.insert(stack, b) + elseif token == "=" then + local b = table.remove(stack) + local a = table.remove(stack) + table.insert(stack, a == b) + elseif token == "@=" then + -- checks if the values of 2 equally lenghted arrays are equal, and returns a bit mask of the differences + local b = table.remove(stack) + local a = table.remove(stack) + if #a ~= #b then + error("Arrays must have equal length") + end + local result = {} + for i = 1, #a do + table.insert(result, a[i] == b[i]) + end + table.insert(stack, result) elseif token == "@" then local index = table.remove(stack) local array = table.remove(stack) -- cgit 1.4.1-2-gfad0 79dd916a870cb7697291'>blame commit diff stats
path: root/src/release.c
blob: 8ec00b4391d8eb03b0e2983a23f0450770c04ae1 (plain) (tree)