polyfilled bit ops

This commit is contained in:
Djeeberjr 2022-02-21 18:55:50 +01:00
parent da3eda84d3
commit fd745d623c

View File

@ -13,10 +13,64 @@ _G.require = function (module)
end
else
print("ERROR: Tell a dev to implement: " .. i)
os.exit()
end
end
}
setmetatable(module, metatable)
return module
end
print("ERROR: Tell a dev to implement: " .. module)
os.exit()
end
-- Polyfill bit. see: http://bitop.luajit.org/api.html
-- Already implemented
-- bit.band
-- bit.bnot
-- bit.bor
-- bit.bxor
--
bit.tobit = function(x)
print("ERROR: Tell a dev to implement: bit.tobi")
os.exit()
end
bit.tohex = function(x,n)
print("ERROR: Tell a dev to implement: bit.tohex")
os.exit()
end
bit.lshift = function(x,n)
print("ERROR: Tell a dev to implement: bit.lshift")
os.exit()
end
bit.rshift = function(x,n)
print("ERROR: Tell a dev to implement: bit.rshift")
os.exit()
end
bit.arshift = function(x,n)
-- TODO: this seems to easy.
return bit.brshift(x,n)
end
bit.rol = function(x,n)
print("ERROR: Tell a dev to implement: bit.rol")
os.exit()
end
bit.ror = function(x,n)
print("ERROR: Tell a dev to implement: bit.ror")
os.exit()
end
bit.bswap = function(x)
print("ERROR: Tell a dev to implement: bit.bswap")
os.exit()
end