mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-09 04:51:49 +00:00
bitwise expressions compiler
This commit is contained in:
parent
d9d4d2b305
commit
cba48e3a0c
5 changed files with 484 additions and 0 deletions
21
res/modules/bitwise/util.lua
Normal file
21
res/modules/bitwise/util.lua
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
local util = { }
|
||||
|
||||
util.stack = { }
|
||||
|
||||
function util.throw(column, msg)
|
||||
error("column "..column..": "..msg)
|
||||
end
|
||||
|
||||
function util.stack.push(stack, value)
|
||||
table.insert(stack, value)
|
||||
end
|
||||
|
||||
function util.stack.pop(stack)
|
||||
return table.remove(stack, #stack)
|
||||
end
|
||||
|
||||
function util.stack.top(stack)
|
||||
return stack[#stack]
|
||||
end
|
||||
|
||||
return util
|
||||
Loading…
Add table
Add a link
Reference in a new issue