mirror of
https://github.com/Mercury-Language/mercury.git
synced 2026-04-15 17:33:38 +00:00
Support direct putback of int8 and uint8 values to binary input streams
instead of via the bottom 8 bits of an int value.
library/io.m:
Add putback_{int8,uint8}/[34].
Add stream type class instances for putback streams binary_input_stream
with int8 and uint8.
tests/hard_coded/Mmakefile:
tests/hard_coded/putback_binary_int8.{m,exp}:
tests/hard_coded/putback_binary_uint8.{m,exp}:
Add tests of the above.
33 lines
259 B
Plaintext
33 lines
259 B
Plaintext
Position: 0
|
|
|
|
Read: 97u8
|
|
Position: 1
|
|
|
|
Seek: +1
|
|
Position: 2
|
|
|
|
Read: 99u8
|
|
Position: 3
|
|
|
|
Put back: 128u8
|
|
Position: 2
|
|
|
|
Read: 128u8
|
|
Position: 3
|
|
|
|
Read: 10u8
|
|
Position: 4
|
|
|
|
Read: eof
|
|
Position: 4
|
|
|
|
Put back: 255u8
|
|
Position: 3
|
|
|
|
Seek: -2
|
|
Position: 1
|
|
|
|
Read: 98u8
|
|
Position: 2
|
|
|