update license year to 2023
update rlua-searcher dependency
update fennel-src dep
Compile Fennel source code to Lua.
Adds Fennel to rlua::Context
via fennel-src crate.
If you wish to accept the default Fennel release version provided by fennel-src:
[dependencies]
fennel-compile = "*"
If you wish to specify a Fennel release version:
# basic
[dependencies]
fennel-compile = { version = "*", default-features = false, features = ["fennel100"] }
# advanced
[features]
default = ["fennel100"]
fennel100 = ["fennel-compile/fennel100"]
[dependencies]
fennel-compile = { version = "*", default-features = false }
use fennel_compile::{Compile, Mount, Result};
use rlua::Lua;
fn main() {
let lua = Lua::new();
let got = lua
.context::<_, Result<String>>(|lua_ctx| {
// Add Fennel to Lua's `package.searchers`.
lua_ctx.mount_fennel()?;
lua_ctx.compile_fennel_string("(print (+ 1 1))")
})
.unwrap();
// Prints "return print((1 + 1))".
println!("{}", got);
}
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.