Skip to main content
Deno 2 is finally here 🎉️
Learn more

parzec_deno

parzec_deno is a Deno port of the Parzec NPM package. This module was created because currently the module at deno.land/x/parzec does not seem to support Deno out of the box.

Parzec is a parser combinator library adapted from Haskell’s famous Parsec library. A parser combinator library consist of higher order functions which make it easy to build recursive descent parsers.

johtela/parzec

License Deno module Github
tag Build Code
coverage

Usage

import * as pz from "https://deno.land/x/parzec_deno/mod.ts";

Changes

In order to make the NPM based Parzec compatible with Deno, some changes have to be made. Parzec fortunately has no run-time dependencies, so only local imports need to be updated. These are parzec_deno’s contributions to the original Parzec repository:

  • Update docs and metadata.
    • Removed all files that were not TypeScript source file.
    • Added the README.md file (which you are reading right now).
    • Added the GitHub compatible LICENSE file with the original license text.
  • Translated the NPM project structure to Deno.
    • Added the mod.ts module that exports everything.
    • Replaced all NPM style import statements with ES module imports.
    • Removed property-based tests in src/test.
    • Replaced all tests in src/test with Deno compatible unit tests.
    • Renamed all test files to ensure a _test.ts suffix.
  • Fixed errors discovered by deno fmt and deno lint.
    • Formatted all files with deno fmt.
    • Added // deno-lint-ignore no-explicit-any where necessary.
    • Replaced let with const where possible.
    • Removed unnecessary async keywords in tests.
  • Added new build and CI tools.
    • Added dev.ts which uses edcb for running checks.
    • Added the GitHub Action ci workflow which runs dev.ts.
    • Added code coverage reporting.