Skip to main content
Module

x/pazza/mod.ts>lazy

Parser combinators library designed for Deno, but also works on browsers and Node.js.
Go to Latest
function lazy
import { lazy } from "https://deno.land/x/pazza@v0.3.0/mod.ts";

Construct a parser only when it's needed. This is useful when building a recursive parser.

// We don't call the `parse` method,
// so the `recursiveParser` won't be constructed.
lazy(() => recursiveParser());

Parameters

fn: () => IParser<O, E, I>

Function that returns a parser.