diff options
author | elioat <hi@eli.li> | 2024-06-09 15:41:19 -0400 |
---|---|---|
committer | elioat <hi@eli.li> | 2024-06-09 15:41:19 -0400 |
commit | 79fcbb5f40e91fc74d4d7b1491b8e246ec6a42b5 (patch) | |
tree | 08499113a679e782f997dbaaf78a78a68bed6ca6 /lua/chupacabra/chupacabra.lua | |
parent | a461b64cd0996f707914abc7927bb46da8026e46 (diff) | |
download | tour-79fcbb5f40e91fc74d4d7b1491b8e246ec6a42b5.tar.gz |
*
Diffstat (limited to 'lua/chupacabra/chupacabra.lua')
-rw-r--r-- | lua/chupacabra/chupacabra.lua | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lua/chupacabra/chupacabra.lua b/lua/chupacabra/chupacabra.lua index 9d18b69..4296e19 100644 --- a/lua/chupacabra/chupacabra.lua +++ b/lua/chupacabra/chupacabra.lua @@ -23,11 +23,10 @@ end function chupacabra.evaluate(tokens, context) local stack = {} - -- FIXME: explore if there is a better way to approach this, so that you don't need to special case the array math for _, token in ipairs(tokens) do if tonumber(token) then table.insert(stack, tonumber(token)) - elseif token:match("^%b[]$") then -- If the token is an array + elseif token:match("^%b[]$") then local array = {} for number in token:sub(2, -2):gmatch("%S+") do table.insert(array, tonumber(number)) |