diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2016-07-22 19:56:18 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2016-07-22 19:56:18 -0700 |
commit | 9acf5c0fc91d7e348c794c8b8181d4e56f393925 (patch) | |
tree | 97bf8a15ec6c4803d661e13c868e8f288fc977aa /067stream.mu | |
parent | 1cb09d70d068304f5330330c5708b806ab693589 (diff) | |
download | mu-9acf5c0fc91d7e348c794c8b8181d4e56f393925.tar.gz |
3129
Degenerate 'parser' that handles just atoms of one character.
Diffstat (limited to '067stream.mu')
-rw-r--r-- | 067stream.mu | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/067stream.mu b/067stream.mu index db7c189a..e55d5986 100644 --- a/067stream.mu +++ b/067stream.mu @@ -18,6 +18,16 @@ def rewind-stream in:address:stream -> in:address:stream [ *in <- put *in, index:offset, 0 ] +def read in:address:stream -> result:character, in:address:stream [ + local-scope + load-ingredients + idx:number <- get *in, index:offset + s:address:array:character <- get *in, data:offset + result <- index *s, idx + idx <- add idx, 1 + *in <- put *in, index:offset, idx +] + def read-line in:address:stream -> result:address:array:character, in:address:stream [ local-scope load-ingredients |