6 releases (breaking)
Uses new Rust 2024
new 0.5.0 | Apr 12, 2025 |
---|---|
0.4.0 | Apr 12, 2025 |
0.3.0 | Sep 10, 2024 |
0.2.3 | Sep 9, 2024 |
0.1.0 | Aug 16, 2024 |
#67 in Parser tooling
322 downloads per month
44KB
863 lines
Minparser
Simple parsing functions
lib.rs
:
Simple parsing tools
This crate is a collection of objects and algorithms shared among different crates that needs to implement a parser.
The [predicates] module contains some useful functions in order to analize ASCII and Unicode characters. Some of these functions are just wrappers of functions defined in the standard library.
A Position
is an object that identifies a (textual) file and a position inside it,
represented as a line index and a column index. The main role of a [Position] object is to
uniquely identify a single character or a (textual) token inside a file in order to allow the
user to easily find it.
A Pos<T>
is just an object containing a T
object and a Position
. Usually you set
T
to be equal to char
or to a custom token type.
A View<'a, D, F>
can be seen as a suffix of a larger string with the position of
its first character and some data of type D
. The match_tool
method
can be used to match its prefix with any object implementing the
ParseTool
trait which represents a pattern that can be sstisfied
or not by a string.
Dependencies
~230–670KB
~16K SLoC