Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gabrielelana/paco
A parser combinator library for Elixir
https://github.com/gabrielelana/paco
Last synced: 9 days ago
JSON representation
A parser combinator library for Elixir
- Host: GitHub
- URL: https://github.com/gabrielelana/paco
- Owner: gabrielelana
- License: mit
- Created: 2015-01-05T21:12:03.000Z (almost 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-25T20:02:14.000Z (about 9 years ago)
- Last Synced: 2024-07-31T21:54:43.858Z (3 months ago)
- Language: Elixir
- Size: 945 KB
- Stars: 31
- Watchers: 2
- Forks: 3
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-combinator-parsers - paco
README
# Paco
[![Build Status](https://travis-ci.org/gabrielelana/paco.svg?branch=master)](https://travis-ci.org/gabrielelana/paco)#### Parse everything with Elixir
Paco is a monadic parser combinator library written in Elixir. Goals:
* Be **easy to learn** and **easy to use**
* Allows to create **powerful**, **understandable** and **maintainable** parsers
* Allows to quickly create complex parsers starting from **tons of reusable parsers**
* Have the **best error reporting** ever seen
* Be **testable** and **introspectable**
* **Easy things** should be **trivial**, **hard things** should be **possible**
* **Correctness** over usability (no corners cut, no special cases)
* **Usability** over features (no black magic)
* **Features** over performance (developers time is more important)
* Be as **fast** as possible> **WARNING:** This is a work in progress, is not ready for use, so don't use it yet.
## Example
```elixir
defmodule Expression do
use Pacoparser expression do
one_of([number, expression]) |> separated_by(",") |> surrounded_by("(", ")")
end
endExpression.parse("(7, (4, 5), (1, 2, 3), 6)") # => [7, [4, 5], [1, 2, 3], 6]
```