rust-forth-tokenizer

Crates.iorust-forth-tokenizer
lib.rsrust-forth-tokenizer
version0.2.1
created_at2019-08-28 17:17:17.998196+00
updated_at2025-06-05 16:31:55.973247+00
descriptionA Forth tokenizer written in Rust.
homepagehttps://github.com/rickprice/rust-forth-tokenizer
repositoryhttps://github.com/rickprice/rust-forth-tokenizer
max_upload_size
id160461
size448,919
Frederick Price (rickprice)

documentation

README

rust-forth-tokenizer

A Forth tokenizer written in Rust

Usage:

main() { use rust_forth_tokenizer::ForthToken; use rust_forth_tokenizer::ForthTokenizer;

 let tokenizer = ForthTokenizer::new("word : wordname 1 2 3 ; definition");
 // The code also supports the regular for loop iterator syntax
 let collected: Vec<_> = tokenizer.into_iter().collect();
 assert_eq!(
        &collected,
        &vec![
            ForthToken::Command("word"),
            ForthToken::Colon,
            ForthToken::Command("wordname"),
            ForthToken::Number(1),
            ForthToken::Number(2),
            ForthToken::Number(3),
            ForthToken::SemiColon,
            ForthToken::Command("definition"),
        ]
    );    

}

Commit count: 49

cargo fmt