https://github.com/akkartik/mu/blob/main/shell/read.mu

     1 fn read-cell in: (addr gap-buffer), out: (addr handle cell), trace: (addr trace) {
     2   var tokens-storage: (stream cell 0x100)
     3   var tokens/ecx: (addr stream cell) <- address tokens-storage
     4   tokenize in, tokens, trace
     5   var error?/eax: boolean <- has-errors? trace
     6   compare error?, 0/false
     7   {
     8     break-if-=
     9     return
    10   }
    11   # TODO: insert parens
    12   # TODO: transform infix
    13   parse-input tokens, out, trace
    14 }