"use strict"; const { NoMatch } = require("../symbols"); module.exports = function* optional(instruction, state, context) { let result = yield instruction.rule; // FIXME: NotEnoughInput handling? if (result === NoMatch) { return undefined; } else { return result; } };