1 unstable release

0.1.0 Feb 1, 2024

#1823 in Parser implementations

44 downloads per month

Apache-2.0

7KB
130 lines

toml2lua

Convert TOML to Lua table

Version badge Downloads badge License badge Docs badge

Example:

use toml2lua::parse;

let toml = r#"
string = "abc"
int = 123
bool = true

[object]
key = "value"
"#;

let lua = parse(toml).unwrap();
// Output:
// {
//   ["string"] = "abc",
//   ["int"] = 123,
//   ["bool"] = true,
//   ["object"] = {
//     ["key"] = "value",
//   },
// }

lib.rs:

toml2lua

Convert TOML to Lua table

Example:

use toml2lua::parse;

let toml = r#"
string = "toml2lua",
int = 420,
bool = true,

[object]
key = "value"
"#;

let lua = parse(toml).unwrap();
// Output:
// {
//   ["string"] = "toml2lua",
//   ["int"] = 420,
//   ["bool"] = true,
//   ["object"] = {
//	    ["key"] = "value",
//   },
// }

Made with <3 by Dervex

Dependencies

~1–1.4MB
~26K SLoC