diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2015-05-14 12:06:16 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2015-05-14 12:27:31 -0700 |
commit | af336c444f4fe9d8a1677a200f40748ce5f24a26 (patch) | |
tree | b06b1c2323a5033194724171af7681e760bd546b /061channel.mu | |
parent | b98d3876b67a35f1d913ba374749bc97103b7790 (diff) | |
download | mu-af336c444f4fe9d8a1677a200f40748ce5f24a26.tar.gz |
1368 - alias carriage-return and newline
CRLF still shows as two newlines, though. Cross that bridge when we get to it. The new chessboard test is still hanging, though.
Diffstat (limited to '061channel.mu')
-rw-r--r-- | 061channel.mu | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/061channel.mu b/061channel.mu index bb18f931..5445447d 100644 --- a/061channel.mu +++ b/061channel.mu @@ -280,6 +280,8 @@ scenario channel-read-not-full [ # out:address:channel <- buffer-lines in:address:channel, out:address:channel recipe buffer-lines [ default-space:address:address:array:location <- new location:type, 30:literal +#? $print [buffer-lines: aaa +#? ] in:address:channel <- next-ingredient out:address:channel <- next-ingredient # repeat forever @@ -313,13 +315,17 @@ recipe buffer-lines [ loop +next-character:label } # append anything else +#? $print [buffer-lines: appending ], c:character, [ +#? ] line:address:buffer <- buffer-append line:address:buffer, c:character - line-done?:boolean <- equal c:character, 13:literal/newline + line-done?:boolean <- equal c:character, 10:literal/newline break-if line-done?:boolean loop } #? return-to-console #? 1 # copy line into 'out' +#? $print [buffer-lines: emitting +#? ] i:number <- copy 0:literal line-contents:address:array:character <- get line:address:buffer/deref, data:offset max:number <- get line:address:buffer/deref, length:offset @@ -368,7 +374,7 @@ F buffer-lines-blocks-until-newline: channel should be empty after writing 'a'] assert 7:boolean, [ F buffer-lines-blocks-until-newline: channel should be empty after writing 'b'] # write newline - 1:address:channel <- write 1:address:channel, 13:literal/newline + 1:address:channel <- write 1:address:channel, 10:literal/newline restart 4:number/buffer-routine wait-for-routine 4:number/buffer-routine 8:boolean <- channel-empty? 2:address:channel/buffered-stdin |