A simple parser combinator library heavily inspired by nom. This library is more of a personal excersise to learn the Dart programming language. It is not meant to be a full rewrite of nom, since i'm not planning on expanding it a whole lot. It is not particularly optimized for speed and cannot be used with binary data.
It is just a quick and dirty library to create string parsers.
Allows you to write parsers using simple combinators. Here are the parsers and combinators you can use.
Parsers:
- tag
- take
- takeTill *
- takeUntil *
- takeWhile *
- takeAll *
- Also has a variant that needs to have at least one character matched.
Combinators:
- opt
- alt
- list
Utilities:
- map
- del
- clear
Example on how to match markdown links:
final parser = list([
tag("["),
takeUntil("]"),
tag("]("),
takeUntil(")"),
tag(")")
]);
var (value, tail) = parser("[test](https://www.github.com)");
var [_, text, _, url, _] = value;