# Minparser
Simple parsing functions
This crate is a collection of objects and algorithms shared among different crates that needs to implement a parser.
## Usage examples
```rust
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");
```
```rust
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");
```
## Installation
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
```
# Links
- [Package registry](https://codeberg.org/Loara/minparser/packages);
- [crates.io page](https://crates.io/crates/minparser);
- [Documentation for the latest version on crates.io](https://docs.rs/minparser/latest/minparser/).