Skip to content

Commit 1747d40

Browse files
committed
encode flags as u8^N
Signed-off-by: Roman Volosatovs <[email protected]>
1 parent 88e6d8f commit 1747d40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

design/mvp/Binary.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -380,7 +380,7 @@ val((record (field l t)+)) ::= v+:<val(t)>+ => (recor
380380
val((variant (case l t?)+) ::= i:<core:u32> v?:<val(t[i])>? => (variant l[i] v?)
381381
val((list t)) ::= v:vec(<val(t)>) => (list v)
382382
val((tuple t+)) ::= v+:<val(t)>+ => (tuple v+)
383-
val((flags l+)) ::= v:<core:uN> => (flags (l[i] for i in 0..N-1 if v & 2^i > 0)) (where N = |l+|)
383+
val((flags l+)) ::= (v:<core:byte>)^N => (flags (l[i] for i in 0..N-1 if v & 2^i > 0)) (where N = ceil(|l+| / 8))
384384
val((enum l+)) ::= i:<core:u32> => (enum l[i])
385385
val((option t)) ::= 0x00 => none
386386
| 0x01 v:<val(t)> => (some v)

0 commit comments

Comments
 (0)