Parser
import { Parser } from "https://raw.githubusercontent.com/wavebeem/bread-n-butter/v0.6.0/src/bread-n-butter.ts";
Represents a parsing action; typically not created directly via new
.
class Parser<A> { }
constructor(action: (context: Context) => ActionResult<A>);
action: (context: Context) => ActionResult<A>;
thru<B>(fn: (parser: this) => B): B;
tryParse(input: string): A;
§Constructors
§
new Parser(action: (context: Context) => ActionResult<A>)
[src]Creates a new custom parser that performs the given parsing action.
§Properties
§
action: (context: Context) => ActionResult<A>
[src]The parsing action. Takes a parsing Context and returns an ActionResult representing success or failure.