Closed pesco closed 10 years ago
NB: i considered having the endianness to switch to be produced by a parser argument (akin to how h_length_value
gets its length), but decided against it because i think the more flexible solution is to use h_choice
and maybe h_and
. e.g. (pseudocode):
be(p) = with_endianness(BYTE_BIG_ENDIAN, p)
le(p) = with_endianness(BYTE_LITTLE_ENDIAN, p)
stuff = ... // actual parser
wrap = choice(seq(token("BE"), be(stuff)), seq(token("LE"), le(stuff)))
fixed a bug in
h_read_bits
along the way.