Crates.io | dalbit |
lib.rs | dalbit |
version | |
source | src |
created_at | 2024-12-11 08:39:48.678134 |
updated_at | 2024-12-11 15:38:41.757934 |
description | A Luau-to-Lua transpiler |
homepage | |
repository | https://github.com/CavefulGames/dal |
max_upload_size | |
id | 1479756 |
Cargo.toml error: | TOML parse error at line 18, column 1 | 18 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
Dalbit(달빛) is a Luau-to-Lua transpiler, designed specifically for Lua 5.3
.
darklua
and full-moon
.convert_bit32
modifier now converts bit32.btest
.cargo install dalbit --locked
init
Initializes dalbit manifest file in the current path.
dalbit init
fetch
Fetches and updates lua polyfills.
dalbit fetch
transpile
Transpiles luau code to lua code.
dalbit transpile
clean
Cleans polyfill caches from disk.
dalbit clean
dalbit.toml
input = "input.luau"
output = "output.lua"
file_extension = "lua"
target_version = "lua53"
minify = true
[modifiers]
[polyfill]
repository = "https://github.com/CavefulGames/dalbit-polyfill"
injection_path = "__polyfill__"
inputs/input.luau
local obj = { items = {1, 4, 9} }
setmetatable(obj, { __iter = function(o) return next, o.items end })
for k, v in obj do
print(k * k)
end
outputs/output.luau
local setmetatable=require'./__polyfill__'.setmetatable local __DALBIT_getmetatable_iter=require'./__polyfill__'.__DALBIT_getmetatable_iter local type=require'./__polyfill__'.type local next=require'./__polyfill__'.next local io=nil local module=nil local package=nil local dofile=nil local loadfile=nil local load=nil local obj={items={1,4,9}}
setmetatable(obj,{__iter=function(o)return next,o.items end})do local _DALBIT_REMOVE_GENERALIZED_ITERATION_itere234e8bef135bb4c, _DALBIT_REMOVE_GENERALIZED_ITERATION_invare234e8bef135bb4c, _DALBIT_REMOVE_GENERALIZED_ITERATION_controle234e8bef135bb4c=
obj if type(_DALBIT_REMOVE_GENERALIZED_ITERATION_itere234e8bef135bb4c)=='table'then local m=__DALBIT_getmetatable_iter(_DALBIT_REMOVE_GENERALIZED_ITERATION_itere234e8bef135bb4c)if type(m)=='table'and type(m.__iter)=='function'then _DALBIT_REMOVE_GENERALIZED_ITERATION_itere234e8bef135bb4c, _DALBIT_REMOVE_GENERALIZED_ITERATION_invare234e8bef135bb4c, _DALBIT_REMOVE_GENERALIZED_ITERATION_controle234e8bef135bb4c=m.__iter(_DALBIT_REMOVE_GENERALIZED_ITERATION_itere234e8bef135bb4c)else _DALBIT_REMOVE_GENERALIZED_ITERATION_itere234e8bef135bb4c, _DALBIT_REMOVE_GENERALIZED_ITERATION_invare234e8bef135bb4c, _DALBIT_REMOVE_GENERALIZED_ITERATION_controle234e8bef135bb4c=next, _DALBIT_REMOVE_GENERALIZED_ITERATION_itere234e8bef135bb4c end end for k,v in _DALBIT_REMOVE_GENERALIZED_ITERATION_itere234e8bef135bb4c,_DALBIT_REMOVE_GENERALIZED_ITERATION_invare234e8bef135bb4c,_DALBIT_REMOVE_GENERALIZED_ITERATION_controle234e8bef135bb4c do
print(k*k)
end end
darklua-demo
over darklua
?darklua-demo
is a temporary fork to work properly with dal.darklua-demo
will be replaced by official darklua
once darklua released with important features to work properly with dal.The name of this project, Dalbit, translates to "moonshine" in Korean.