Skip to main content

Crate htl_core

Crate htl_core 

Source
Expand description

htl: Teal, hidden.

Embeds the Teal compiler (tl.lua) into an mlua state so .tl sources can be type-checked, generated and executed without any external toolchain.

  • Htl::check / [Htl::gen]: type-check and generate Lua from a .tl file
  • Htl::install_searcher: strict require for .tl (type errors abort the require)
  • Htl::preload: register generated Lua (e.g. from include_tl!) under a module name
  • bundle: stripped-bytecode bundles produced by htl build

Re-exports§

pub use mlua;

Modules§

bundle
Stripped-bytecode bundle format (.hb).
pkg
mlua-pkg integration: a TealResolver that serves .tl modules through mlua-pkg’s Registry, so Teal sources sit in the same resolution chain as Rust-native modules, embedded Lua, vendored git deps and assets.
teal
Rust <-> Teal type bridge used by #[derive(TealRecord)] and #[host_module].
testing
htl test: discovery, one isolated Lua state per test file, compile, report.

Structs§

CheckInfo
Result of type-checking one .tl file.
Htl
An mlua state with the Teal compiler loaded.

Constants§

TEAL_VERSION
Teal version vendored into this crate.

Functions§

collect_tl
Collect .tl sources from files and directories (sorted, recursive).
is_tl_source
true for foo.tl but not foo.d.tl.
module_name
root/foo/bar.tl -> foo.bar, root/foo/init.tl -> foo.
parent_dir
Parent directory of a file, . when the path has none.
write_if_changed
Write text to path only if the content differs. Returns true when written. Used by the derive macros to emit .d.tl files without churning cargo’s fingerprints.