UNPKG

parjs

Version:

Library for building parsers using combinators.

22 lines 641 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.state = void 0; const result_1 = require("../result"); const parser_1 = require("../parser"); class State extends parser_1.ParjserBase { constructor() { super(...arguments); this.type = "state"; this.expecting = "expecting anything"; } _apply(ps) { ps.value = ps.userState; ps.kind = result_1.ResultKind.Ok; } } /** Returns a parser that yields the current user state object. It always succeeds. */ function state() { return new State(); } exports.state = state; //# sourceMappingURL=state.js.map