microparsec

A performant Nim parsing library built for humans.


Keywords
parser-combinators, parser-library, microparsec, parsec, functional-programming, haskell, nim, nim-lang
License
MIT
Install
nimble install microparsec

Documentation

Documentation

Microparsec ⭐

[WIP] Microparsec is a fast parser combinator library with excellent error messages.

import microparsec
let p = between(
  ch('{'),
  str("hello") >> many(space) >> str("world!"),
  ch('}')
)
echo p.parse("{hello\n world?}")
Failed reading: satisfy

1:6:(13):
  |
1 |  world?}
  |       ^
unexpected '?'
expecting "world!"

Microparsec is a pure Nim adaptation of Parsec, the popular monadic parser combinator library for Haskell by Daan Leijen, Further inspiration was taken from Attoparsec and Megaparsec.

Installation

Microparsec supports Nim 1.2.6+ and can be installed using Nimble:

$ nimble install microparsec

Some references

Inspiring projects