diff options
Diffstat (limited to 'baremetal/shell/eval.mu')
-rw-r--r-- | baremetal/shell/eval.mu | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/baremetal/shell/eval.mu b/baremetal/shell/eval.mu new file mode 100644 index 00000000..8af64a95 --- /dev/null +++ b/baremetal/shell/eval.mu @@ -0,0 +1,19 @@ +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 + } +} |