Handbook
Glossary
stream-read-leb128 ( stream -- n )
LEB128 Encoding
Prev:
read-leb128 ( -- n )
Vocabulary
leb128
Inputs
stream
an
object
Outputs
n
an
object
Definition
USING:
io
kernel
math
;
IN:
leb128
::
stream-read-leb128
( stream -- n )
0 0
[
stream
stream-read1
:>
( i b ) b 127
bitand
i 7
*
shift
+
i 1
+
b 7
bit?
dup
[
b 6
bit?
[
[
[
7
*
2^
neg
bitor
]
keep
]
dip
]
when
]
unless
]
loop
drop
;