Subject: | full name for format specification |
use a full name for the field type instead for a symbol
the most cryptic symbols:
@ => header
# => comment
X => skip \d+
but maybe these symbols too:
none => size \d+
Xxb => bitfield size \d+ byte_offset \d+ bit_offset \d+
where \d+ could be in hexadecimal
thus the documentation example
header,12:name,10:magic,2:offset,4:BITMAP,4,bright_yellow:ff,x2b2:fx,b32:f0,b16:field,x8b8:field2,
b17:footer,20
or
header,12
:name,10
:magic,2
:offset,4
:BITMAP,4,bright_yellow
:ff,x2b2
:fx,b32
:f0,b16
:field,x8b8
:field2, b17
:footer,20
becomes
header,size 12:name,size 10:magic,size 2:offset,size 4:BITMAP,size
4,bright_yellow:ff,bitmap size 2 bit_offset 2:fx,bitmap size
32:f0,bitmap size 16:field,bitmap size 8 bit_offset 8:field2, bitmap
size 17:footer,size 20
header,size 12
:name,size 10
:magic,size 2
:offset,size 4
:BITMAP,size 4,bright_yellow
:ff,bitmap size 2 bit_offset 2
:fx,bitmap size 32
:f0,bitmap size 16
:field,bitmap size 8 bit_offset 8
:field2, bitmap size 17
:footer,size 20