Skip to content

Commit 5b84168

Browse files
rvolosatovslukewagner
authored andcommitted
adapt flag rule definition to LE byte sequence
Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
1 parent cf665bc commit 5b84168

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
@@ -377,7 +377,7 @@ val((record (field l t)+)) ::= v+:<val(t)>+ => (recor
377377
val((variant (case l t?)+) ::= i:<core:u32> v?:<val(t[i])>? => (variant l[i] v?)
378378
val((list t)) ::= v:vec(<val(t)>) => (list v)
379379
val((tuple t+)) ::= v+:<val(t)>+ => (tuple v+)
380-
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))
380+
val((flags l+)) ::= (v:<core:byte>)^N => (flags (l[i] for i in 0..|l+|-1 if v[floor(i / 8)] & 2^(i mod 8) > 0)) (where N = ceil(|l+| / 8))
381381
val((enum l+)) ::= i:<core:u32> => (enum l[i])
382382
val((option t)) ::= 0x00 => none
383383
| 0x01 v:<val(t)> => (some v)

0 commit comments

Comments
 (0)