"use strict"; const { NoMatch, NotEnoughInput } = require("../symbols"); module.exports = function* literal(instruction, state) { let { string } = instruction; if (state.currentIndex + string.length > state.currentInput.length) { return NotEnoughInput; } else if (state.currentInput.slice(state.currentIndex, state.currentIndex + string.length) === string) { state.currentIndex += string.length; return string; } else { return NoMatch; } };