You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
395 B
JavaScript

"use strict";
const { NoMatch } = require("../symbols");
const coreOps = require("./index");
module.exports = function* oneOrMore(instruction, state, context) {
let matches = yield coreOps.internalCall.zeroOrMore({ rule: instruction.rule }, state, context);
// FIXME: NotEnoughInput propagation necessary here?
if (matches.length > 0) {
return matches;
} else {
return NoMatch;
}
};