{"id":16915622,"url":"https://github.com/zesterer/parze","last_synced_at":"2025-04-07T17:09:42.391Z","repository":{"id":57653286,"uuid":"223830843","full_name":"zesterer/parze","owner":"zesterer","description":"A clean, efficient parser combinator","archived":false,"fork":false,"pushed_at":"2022-02-15T15:20:17.000Z","size":104,"stargazers_count":124,"open_issues_count":0,"forks_count":6,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-31T14:15:01.766Z","etag":null,"topics":["parser","parser-combinators","parser-framework","rust"],"latest_commit_sha":null,"homepage":"https://docs.rs/parze","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zesterer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-25T00:25:18.000Z","updated_at":"2024-11-06T22:06:10.000Z","dependencies_parsed_at":"2022-09-01T00:22:50.535Z","dependency_job_id":null,"html_url":"https://github.com/zesterer/parze","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Fparze","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Fparze/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Fparze/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zesterer%2Fparze/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zesterer","download_url":"https://codeload.github.com/zesterer/parze/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247694876,"owners_count":20980733,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["parser","parser-combinators","parser-framework","rust"],"created_at":"2024-10-13T19:21:22.929Z","updated_at":"2025-04-07T17:09:42.374Z","avatar_url":"https://github.com/zesterer.png","language":"Rust","readme":"[![crates.io](https://img.shields.io/crates/v/parze.svg)](https://crates.io/crates/parze)\n[![crates.io](https://docs.rs/parze/badge.svg)](https://docs.rs/parze)\n\n**Parze is now deprecated**\n\n*Take a look at [chumsky](https://github.com/zesterer/chumsky/), a from-scratch reimplementation of parze with more features, better performance, and a cleaner API.*\n\n# Parze\n\nParze is a clean, efficient parser combinator written in Rust.\n\n## Example\n\nA parser capable of parsing all valid Brainfuck code into an AST.\n\n```rust\nuse parze::prelude::*;\n\n#[derive(Clone, Debug, PartialEq)]\nenum Instr { Add, Sub, Left, Right, In, Out, Loop(Vec\u003cInstr\u003e) }\n\nparsers! {\n    bf = {\n        ( '+' -\u003e { Instr::Add }\n        | '-' -\u003e { Instr::Sub }\n        | '\u003c' -\u003e { Instr::Left }\n        | '\u003e' -\u003e { Instr::Right }\n        | ',' -\u003e { Instr::In }\n        | '.' -\u003e { Instr::Out }\n        | '[' -\u0026 bf \u0026- ']' =\u003e { |i| Instr::Loop(i) }\n        ) *\n    }\n}\n```\n\n## Features\n\n- [x] All the usual parser combinator operations\n- [x] Macro for simple rule and parser declaration\n- [x] Support for recursive parser definitions\n- [x] Custom error types - define your own!\n- [x] Prioritised / merged failure for more useful errors\n- [x] No dependencies - fast compilation!\n- [x] `no_std` support\n\n## Why Parze?\n\nParze is fast and lightweight, acting as a bare-bones framework upon which more verbose and interesting parsers can be constructed (see the `custom_error` example).\n\n## Nightly\n\nParze's declaration macro currently requires a nightly Rust compiler to work.\nYou may use the explicit declaration form (as shown below) with stable by disabling the `nightly` feature, however.\n\nThis can be done like so in your `Cargo.toml`:\n\n```\n[dependencies.parze]\nversion = \"x.y.z\"\ndefault-features = false\n```\n\n## Performance\n\nHere are the results of a JSON parsing test when compared with [`pom`](https://github.com/J-F-Liu/pom). More performance metrics to come later.\n\n```\ntest parze ... bench:   3,696,323 ns/iter (+/- 358,597)\ntest pom   ... bench:  18,538,775 ns/iter (+/- 1,149,589)\n```\n\n## Explicit Form\n\nWhile Parze encourages use of macros for much of its declarative notation, it is possible (and often useful) to make use of the more explicit rust-y notation.\n\nHere is the Brainfuck parser given above, declared in explicit form.\n\n```rust\nlet bf: Parser\u003c_, _\u003e = recursive(|bf| (\n        sym('+').to(Instr::Add)\n    .or(sym('-').to(Instr::Sub))\n    .or(sym('\u003c').to(Instr::Left))\n    .or(sym('\u003e').to(Instr::Right))\n    .or(sym(',').to(Instr::In))\n    .or(sym('.').to(Instr::Out))\n    .or(sym('[').delimiter_for(bf).delimited_by(sym(']')).map(|i| Instr::Loop(i)))\n).repeat(..));\n```\n\n## License\n\nParze is distributed under either of:\n\n- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)\n\n- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)\n\nat the discretion of the user.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzesterer%2Fparze","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzesterer%2Fparze","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzesterer%2Fparze/lists"}