Hi there! Are you looking for the official Deno documentation? Try docs.deno.com for all your Deno learning needs.

Usage

import * as breadNButter from "https://raw.githubusercontent.com/wavebeem/bread-n-butter/v0.6.0/src/bread-n-butter.ts";

§Classes

Parser

Represents a parsing action; typically not created directly via new.

§Variables

eof

This parser succeeds if the input has already been fully parsed.

location

Parser that yields the current SourceLocation, containing properties index, line and column.

§Functions

all

Parse all items, returning their values in the same order.

choice

Parse using the parsers given, returning the first one that succeeds.

fail

Returns a parser that fails with the given messages and consumes no input.

lazy

Takes a lazily invoked callback that returns a parser, so you can create recursive parsers.

match

Returns a parser that matches the entire regular expression at the current parser position.

ok

Returns a parser that yields the given value and consumes no input.

text

Returns a parser that matches the exact text supplied.

§Interfaces

ActionFail

Represents a successful result from a parser's action callback. This is made automatically by calling context.ok. Make sure to use context.merge when writing a custom parser that executes multiple parser actions.

ActionOK

Represents a successful result from a parser's action callback. This is made automatically by calling context.ok. Make sure to use context.merge when writing a custom parser that executes multiple parser actions.

ParseFail

Represents a failed parse result, where it failed, and what types of values were expected at the point of failure.

ParseNode

Result type from node. See node for more details.

ParseOK

Represents a successful parse result.

SourceLocation

Represents a location in the input (source code). Keeps track of index (for use with .slice and such), as well as line and column for displaying to users.

§Type Aliases

ActionResult

Represents the result of a parser's action callback.