about summary refs log blame commit diff stats
path: root/baremetal/shell/eval.mu
blob: 8af64a9534c5c32a27f3a54ae5aef9b803e49fef (plain) (tree)


















                                                                                        
type interpreter {
  # tokenize
  # insert parens
  # transform infix
  # token tree
  # syntax tree
}

fn evaluate _self: (addr interpreter), in: (addr stream byte), out: (addr stream byte) {
  clear-stream out
  {
    var done?/eax: boolean <- stream-empty? in
    compare done?, 0/false
    break-if-!=
    var g/eax: grapheme <- read-grapheme in
    write-grapheme out, g
    loop
  }
}