| Crates.io | minparser |
| lib.rs | minparser |
| version | 0.13.2 |
| created_at | 2024-08-16 21:11:04.453404+00 |
| updated_at | 2026-01-12 09:24:54.475514+00 |
| description | Simple parsing functions |
| homepage | https://codeberg.org/Loara/minparser |
| repository | https://codeberg.org/Loara/minparser |
| max_upload_size | |
| id | 1340971 |
| size | 100,928 |
Simple parsing functions
This crate is a collection of objects and algorithms shared among different crates that needs to implement a parser.
use minparser::prelude::*;
let (mtc, step) = View::from("My string value").match_tool_string(&"My string").unwrap();
assert_eq!(mtc, "My string");
assert_eq!(step.get_view(), " value");
use minparser::prelude::*;
let (data, step) = View::new("9180029a")
.match_tool_data(&RepeatAny::new_unbounded(Predicate::new(
|c : char| c.is_ascii_digit()), TrueTool)).unwrap();
assert_eq!(data, 7);
assert_eq!(step.get_view(), "a");
To add minparser as a dependency for your project first add this registry to your $CARGO_HOME/config.toml:
[registries.loara_forgejo]
index = "sparse+https://codeberg.org/api/packages/Loara/cargo/" # Sparse index
# index = "https://codeberg.org/Loara/_cargo-index.git" # Git
[net]
git-fetch-with-cli = true
then run inside your working directory
cargo add --registry loara_forgejo minparser