nom snacks
Github | Crates.io | Documentation
- Parsers
More useful parser-combinators for nom.
WARNING! This project is still in development.
If a parser looks useful, it may be more practical to copy it to your project.
To add this library to your project run:
combinators
find all
Run the parser at each found substring.
let input = "This is a {text} with some {special} {words}!";
let result = ;
assert_eq!;
find_all_intoThis method can be used to push the items into a buffer, for saving allocations.
recognize separated
Runs the item parser interlaced by the separator parser.
The main difference to the separated_list0 parser from nom is,
that this parser returns the recognized string without allocating a list.
let input = "comma,separated,words other";
let result = ;
assert_eq!;
take all
Takes the items from the item parser, preceded by a prefix parser.
let input = "An example #sentence with #cool tags!";
let result = ;
assert_eq!;
take_all_intoThis method can be used to push the items into a buffer, for saving allocations.
values
weblink
Takes a link from the input.