It is often convenient to incrementally build a format string, creating format strings describing individual sub-records before combining them into something larger. This is currently unwieldy and must be done with .. or string.format.
It would be nice to be able to do something like, say:
vstruct.register("toc_entry", "path:c4 size:u4")
vstruct.register("toc", "count:u4 toc:{ $count * <toc_entry> }")
vstruct.unpack("<toc>", buffer)
Syntax is still a work in progress, and this can be considered an intermediate step towards format string combinators (which I need to open an issue for).
It is often convenient to incrementally build a format string, creating format strings describing individual sub-records before combining them into something larger. This is currently unwieldy and must be done with
..orstring.format.It would be nice to be able to do something like, say:
Syntax is still a work in progress, and this can be considered an intermediate step towards format string combinators (which I need to open an issue for).