Crates.io | cktrs |
lib.rs | cktrs |
version | 0.1.0 |
source | src |
created_at | 2022-10-13 17:02:34.618232 |
updated_at | 2022-10-13 17:02:34.618232 |
description | A rust(🚀) parser for the CKT(🚀) config language. |
homepage | |
repository | https://github.com/owocean/cktrs |
max_upload_size | |
id | 687320 |
size | 14,471 |
A rust(🚀) parser for the CKT(🚀) config language.
use cktrs::parse;
use std::fs;
fn main() {
let unparsed_file = fs::read_to_string("test.ckt").expect("cannot read file");
let file = parse(&unparsed_file)
.expect("unsuccessful parse");
for (key, value) in file.into_iter() {
println!("{}: {:?}", key, value);
}
}
cktrs::parse()
returns a result containing a hashmap of all the tokens in the config. Each token is part of the cktrs::Tokens
enum.
numerical table keys are indexed in the hashmap as a String