"use strict"; const mapObject = require("map-obj"); const yieldcore = require("../yieldcore"); let coreOps = { literal: require("./literal"), characterRange: require("./character-range"), endOfInput: require("./end-of-input"), either: require("./either"), peek: require("./peek"), test: require("./test"), zeroOrMore: require("./zero-or-more"), oneOrMore: require("./one-or-more"), optional: require("./optional"), until: require("./until"), wholeMatch: require("./whole-match"), // FIXME: Implement trackPosition }; Object.assign(module.exports, { ... coreOps, internalCall: mapObject(coreOps, (name, func) => { return [ name, function (properties, state, context) { let instruction = { __protocolKitInstruction: true, type: name, ... properties, }; return yieldcore.Internal(func(instruction, state, context), instruction); } ]; }) });