# coroutines


08/23/2017, 3:15 AM
how do i support a declarative syntax such as:
val terminal = any_of(seq(singleQuote, character, repeating(character), singleQuote), seq(doubleQuote, character, repeating(character), doubleQuote))
... and then wrap coroutines around the ctor params which are themselves functions which should be coroutines....
thinking out loud here... i think i want a coroutine graph to pursue parse trees in parrallel, where the predicate functions return true or false and the coroutines continue or die. it seems like the easiest way to instrument lambdas similarly the courtine wrapper around lambdas could signal a context to rewind input in a less parallel scenario... so iiuc i might wind up with a couritine context, and a sequence generator for parser input, and a sequence generator for parse graph lambdas
the parser would produce windows of the input sequence from a lexer/tokenizer, and the coroutines would signal for more tokens, or die...