You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For Lua versions below 5.3, bitwise operators aren't supported. However, their behavior can be substituted using the Lua BitOp library. This library is also included by default with LuaJIT. My suggestion would be to add a boolean argument to the compiler, perhaps a --use-bit-lib (which is what Fennel also uses). In practice, it could compile the code:
bit_or =(x, y)->
x | y
into this:
_bitop_0=require("bit")
localbit_orbit_or=function(x, y)
return_bitop_0.bor(x, y)
end
The text was updated successfully, but these errors were encountered:
SkyyySi
changed the title
[feature request] Compile bitwise operators into luabitop functions calls
[feature request] Compile bitwise operators into Lua BitOp functions calls
Oct 8, 2023
For Lua versions below 5.3, bitwise operators aren't supported. However, their behavior can be substituted using the Lua BitOp library. This library is also included by default with LuaJIT. My suggestion would be to add a boolean argument to the compiler, perhaps a
--use-bit-lib
(which is what Fennel also uses). In practice, it could compile the code:into this:
The text was updated successfully, but these errors were encountered: