"use strict"; const { NotEnoughInput, NoMatch } = require("../symbols"); module.exports = function* endOfInput(_instruction, state) { // FIXME: Make this not order-sensitive in an `either`! Currently the NotEnoughInput marker *might* cause issues if this (zero-width) rule comes after nonzero-width rules? Need to investigate. if (state.currentIndex === state.currentInput.length) { if (state.isFullyLoaded) { return true; } else { return NotEnoughInput; } } else { return NoMatch; } };