kohaku

Crates.iokohaku
lib.rskohaku
version0.1.5
created_at2025-09-22 11:24:14.661059+00
updated_at2025-12-04 14:28:30.723024+00
descriptionA simple tokenizer
homepage
repositoryhttps://github.com/mushitoriami/kohaku
max_upload_size
id1849914
size14,764
Komorebi Sakuramochi (mushitoriami)

documentation

README

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)]
);
Commit count: 11

cargo fmt