let's make a "string" term in the new system. it takes a string as an ARGUMENT.
/**
* @param {string} string
* @returns {Term}
*/
Term.string = (string) => ({
bite(text) {
return text.startsWith(string) ? [string] : []
}
})
we can use it in the normal way.
Term.Root = Term.string("pasta")
back to the dream