parjs
Version:
A parser-combinator library for JavaScript.
27 lines (26 loc) • 688 B
JavaScript
;
/**
* @module parjs
*/
/** */
Object.defineProperty(exports, "__esModule", { value: true });
const result_1 = require("../result");
const parser_1 = require("../parser");
/**
* Returns a parser that yields the current user state object. It always succeeds.
*/
function state() {
return new 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;
}
}();
}
exports.state = state;
//# sourceMappingURL=state.js.map