Skip to content
This repository has been archived by the owner on Jul 10, 2023. It is now read-only.

schneiderfelipe/microparsec

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

76 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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