Crates.io | ruminant |
lib.rs | ruminant |
version | 0.17.0 |
source | src |
created_at | 2023-06-15 02:35:43.895694 |
updated_at | 2023-09-29 14:28:06.034174 |
description | An exploration into implementing parser combinators |
homepage | |
repository | https://gitlab.com/wake-sleeper/ruminant |
max_upload_size | |
id | 890738 |
size | 20,914 |
Deprecated
See my latest stab at this: parser-compose
⚠️ Warning ☣️
Homemade, hand-rolled code ahead. Experimental. May not function as advertised.
This is an introduction by example. For a first-principles introduction to parser combinators see here.
A parser is a function that takes some input in, extracts some information and returns the result of this extraction. In order to make any progress, the result contains the leftover input after consuming some part of it, or in the case of error returns some value indicating failure.
A combinator takes one or more parsers as input and returns a different parser. They are useful for uhh...combining multiple parsers together or even changing what parsers do.
With only these two ideas the world becomes your oyster.
Examples coming sooon