cktrs 0.1.0

A rust(🚀) parser for the CKT(🚀) config language.
Documentation
  • Coverage
  • 42.86%
    3 out of 7 items documented0 out of 2 items with examples
  • Size
  • Source code size: 15.33 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.64 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • owocean

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