stream-read-leb128 ( stream -- n )
LEB128 Encoding

Prev:read-leb128 ( -- n )


Vocabulary
leb128

Inputs
streaman object


Outputs
nan object


Definition


:: 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 ;