Watch
1
0
Fork
You've already forked rust-muncher
0
No description
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Daniel Baumann b8be196df0
Adding debian version 0.7.0-1.
Signed-off-by: Daniel Baumann <daniel@debian.org>
2026-08-14 09:09:51 +02:00
.github/workflows Adding upstream version 0.7.0. 2026-08-14 09:05:49 +02:00
debian Adding debian version 0.7.0-1. 2026-08-14 09:09:51 +02:00
src Adding upstream version 0.7.0. 2026-08-14 09:05:49 +02:00
.cargo_vcs_info.json Adding upstream version 0.7.0. 2026-08-14 09:05:49 +02:00
.gitignore Adding upstream version 0.7.0. 2026-08-14 09:05:49 +02:00
Cargo.toml Adding upstream version 0.7.0. 2026-08-14 09:05:49 +02:00
Cargo.toml.orig Adding upstream version 0.7.0. 2026-08-14 09:05:49 +02:00
README.md Adding upstream version 0.7.0. 2026-08-14 09:05:49 +02:00
rustfmt.toml Adding upstream version 0.7.0. 2026-08-14 09:05:49 +02:00

Muncher

Rust Stable Latest Version

About

An easy-to-use string muncher that allows easy tokenization when writing a parser. Muncher has peek and fork capabilities, so you can look ahead and behind when needed. If lexing braces, Muncher has a built-in brace matching stack accessed from Muncher::brace_stack().

Use

[dependencies]
muncher = "0.6"

Examples

use muncher::Muncher;

let input = "hello\nworld";
let mut m = Muncher::new(input);

let hello = m.eat_until(|c| c == &'\n').collect::<String>();
assert_eq!(m.peek(), Some(&'\n'));
assert!(m.eat_eol());

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.