Compare commits

...

2 Commits

Author SHA1 Message Date
fd745d623c polyfilled bit ops 2022-02-21 18:55:50 +01:00
da3eda84d3 added polyfill to make 2022-02-21 18:55:39 +01:00
2 changed files with 55 additions and 1 deletions

View File

@@ -14,7 +14,7 @@ all: clean build
build: $(MIN_PATH)
$(HAXE_PATH): $(shell find src -name '*.hx')
$(HAXE_PATH): $(shell find src -name '*.hx') $(POLYFILL_SRC)
haxe build.hxml $(HAXE_FLAGS)
$(MIN_PATH): $(POLYFILL_PATH)

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