kohaku 0.1.5

A simple tokenizer
Documentation
  • Coverage
  • 0%
    0 out of 4 items documented0 out of 3 items with examples
  • Size
  • Source code size: 14.8 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 283.5 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 5s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • mushitoriami/kohaku
    0 0 4
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • mushitoriami

kohaku

A simple tokenizer

use kohaku::Tokenizer;

assert_eq!(
    r#"{abc -> "123 <- 456"}"#
        .tokenize(["->", "<-", "{", "}"])
        .collect::<Vec<Result<&str, usize>>>(),
    [Ok("{"), Ok("abc"), Ok("->"), Ok(r#""123 <- 456""#), Ok("}")]
);

assert_eq!(
    "{abc -> 1-3}"
        .tokenize(["->", "<-", "{", "}"])
        .collect::<Vec<Result<&str, usize>>>(),
    [Ok("{"), Ok("abc"), Ok("->"), Ok("1"), Err(10)]
);