Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukewilliamboswell/roc-parser
A simple Parser for Roc
https://github.com/lukewilliamboswell/roc-parser
roc-lang
Last synced: 8 days ago
JSON representation
A simple Parser for Roc
- Host: GitHub
- URL: https://github.com/lukewilliamboswell/roc-parser
- Owner: lukewilliamboswell
- License: upl-1.0
- Created: 2023-10-02T22:43:14.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-20T18:46:05.000Z (24 days ago)
- Last Synced: 2024-10-21T10:28:46.517Z (23 days ago)
- Topics: roc-lang
- Language: Roc
- Homepage: https://lukewilliamboswell.github.io/roc-parser/
- Size: 123 KB
- Stars: 28
- Watchers: 4
- Forks: 11
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- roc-awesome - lukewilliamboswell/roc-parser
README
# A Parser for Roc
A simple [Parser Combinator](https://en.wikipedia.org/wiki/Parser_combinator) package for Roc.
```roc
color : Parser Utf8 [Red, Green, Blue]
color =
oneOf [
const Red |> skip (string "red"),
const Green |> skip (string "green"),
const Blue |> skip (string "blue"),
]expect parseStr color "green" == Ok Green
```Also includes modules to parse the following formats (with various levels of maturity);
- Utf-8 Strings
- CSV
- XML
- Markdown
- HTTP## Documentation
See [lukewilliamboswell.github.io/roc-parser/](https://lukewilliamboswell.github.io/roc-parser/)
Locally generate docs using `roc docs package/main.roc`
## Contributing
If you see anything that could be improved please create an Issue or Pull Request.
## Tests
Run tests locally with `roc test package/main.roc`
## Packaging
Bundle package into a URL for distribution using `roc build --bundle .tar.br package/main.roc`