+22
-8
README.md
+22
-8
README.md
···
1
1
# mipl
2
2
3
-
Minimal Imperative Parsing Library, `mipl`—a Rust crate for building minimal, simple parsers.
3
+
Minimal Imperative Parsing Library, `mipl`—a Rust crate for building simple, minimal parsers.
4
+
5
+
Find `mipl`:
6
+
7
+
- [crates.io](https://crates.io/crates/mipl) for installation instructions and additional metadata.
8
+
9
+
- [docs.rs](https://docs.rs/mipl) for documentation.
10
+
11
+
- [Codeberg](https://codeberg.org/ecsolticia/mipl).
12
+
13
+
- [Tangled (mirror)](https://tangled.org/@did:plc:h5uflu6cfdbvjsggusevvy6i/mipl).
14
+
15
+
## Overview
4
16
5
17
### Token Streams
6
18
7
-
`mipl` fundamentally works on token streams, with peeking and **conditional** advancing of tokens being the central operations. [`Parser`](./src/parser.rs) is the core token stream, which is also an iterator, is peekable, and offers more specialized conditional token advancing through what are called "concrete parsers".
19
+
`mipl` fundamentally works on token streams, with peeking and **conditional** advancing of tokens being the central operations. [`Parser`](https://docs.rs/mipl/latest/mipl/parser/struct.Parser.html) is the core token stream, which is also an iterator, is peekable, and offers more specialized conditional token advancing through what are called "concrete parsers".
8
20
9
21
### Concrete Parsers
10
22
11
-
Concrete parsers are structs that implement the [`ConcreteParser`](./src/parser/concrete_parser.rs) trait. This trait, along with [`Peeker` and `ContainerCp`](./src/parser/concrete_parser.rs), provides an interface for defining how to advance tokens. The given peeker returns the peeked token only if it satisfied the directly defined criteria in its implementation. `ConcreteParser` only advances if said peeking criteria is satisfied for the coming token.
23
+
Concrete parsers are structs that implement the [`ConcreteParser`](https://docs.rs/mipl/latest/mipl/parser/concrete_parser/trait.ConcreteParser.html) trait. This trait, along with [`Peeker`](https://docs.rs/mipl/latest/mipl/parser/concrete_parser/trait.Peeker.html) and [`ContainerCp`](https://docs.rs/mipl/latest/mipl/parser/concrete_parser/trait.ContainerCp.html), provides an interface for defining how to advance tokens. The given peeker returns the peeked token only if it satisfied the directly defined criteria in its implementation. `ConcreteParser` only advances if said peeking criteria is satisfied for the coming token.
12
24
13
25
### Subparsers
14
26
···
18
30
19
31
That `mipl` fundamentally works on tokens requires that it have a relatively "good" way of tokenization. `mipl` does it this way: there are two types of delimiters. Those that are to be discarded, and those that are kept in the token stream in spite of taking part in delimiting. This allows one to split based on tokens and do away with them, and then have further splits according to tokens that can also be matched individually later.
20
32
21
-
## Development Environment
33
+
## Documentation
22
34
23
-
The development environment for this project is specified in the root [`flake.nix`](./flake.nix) file. Importantly, it currently features `rustc` and `cargo` versions `1.89`, and `bash`.
35
+
`mipl` currently has a non-zero amount of documentation on at least every public item through comments. Importantly, while it is not yet fully comprehensive, it can provide additional context for **each accessible item** compared to what is available on this file.
36
+
37
+
Said documentation is available here: [docs.rs/mipl](https://docs.rs/mipl).
24
38
25
-
## Documentation
39
+
For offline viewing, the documentation pages can be built using `cargo doc`. Note that this requires an appropriate development environment.
26
40
27
-
`mipl` currently has a non-zero amount of documentation on at least every public item through comments. Importantly, while it is not yet fully comprehensive, it can provide additional context for **each accessible item** compared to what is available on this file.
41
+
## Development Environment
28
42
29
-
The documentation pages can be built using `cargo doc`. Note that this requires an appropriate development environment.
43
+
The development environment for this project is specified in the root [`flake.nix`](./flake.nix) file. Importantly, it currently features `rustc` and `cargo` versions `1.89`, and `bash`.
30
44
31
45
## Licensing
32
46