NORMALLY, terms emit the thing they bite off.
this language bites off "pasta" and emits it.
TRANSLATED:
add the default emit method to the term class.
class Term {
//...
emit(text) {
return this.bite(text)
}
}
then you can use it out-of-the-box.
const pastaTerm = new StringTerm("pasta")
function translate(text) {
return pastaTerm.emit(text)
}
back to the dream