cktrs

Crates.iocktrs
lib.rscktrs
version0.1.0
sourcesrc
created_at2022-10-13 17:02:34.618232
updated_at2022-10-13 17:02:34.618232
descriptionA rust(🚀) parser for the CKT(🚀) config language.
homepage
repositoryhttps://github.com/owocean/cktrs
max_upload_size
id687320
size14,471
(owocean)

documentation

https://docs.rs/cktrs

README

cktrs

A rust(🚀) parser for the CKT(🚀) config language.

usage

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

Commit count: 0

cargo fmt