Crates.io | pml |
lib.rs | pml |
version | 0.6.1 |
source | src |
created_at | 2023-04-01 02:56:27.743153 |
updated_at | 2023-09-09 05:16:02.871278 |
description | A parser for PML, just another format to specify your configs in |
homepage | |
repository | https://github.com/PhilVoel/pml.rs |
max_upload_size | |
id | 827055 |
size | 69,907 |
Just another format to specify your configs in
Currently under development, so don't expect full functionality until version 1.0.0
*.rs
use pml::parse::file as pml_parse;
fn main() {
let pml_result = pml_parse("testFile.pml");
match pml_result {
Err(e) => println("{e:#?}"),
Ok(result) => {
if(result.get::<bool>("stayAnonymous").is_some()) {
println!("I won't tell you anything about me.");
}
else {
println!("Hi, my name is {} and I am {} years old.", result.get::<String>("name").unwrap(), result.get::<&u64>("age").unwrap());
}
}
}
}
testFile.pml
age= <u32> 420;
first_name = "Max";
"name and age" = |first_name, last_name| " "|age|;
last_name = "Mustermann";
stayAnonymous = true;
friends = [
{
name= "Person";
past_ages= <u8> [
0,1,2,
3 , 4,5
]
}
{
name= |..first_name|;
past_ages = <u8> [
0,1,2,3,4,
]
}
]