What about a letter to define the possibility to "shift left" an int field when inflating it to the nearest int size, instead of the current default shift right?
I mean using an hypotetical symbol x
import std/[sugar, strutils]
import binarylang, bitstreams
struct(parser):
u15: one
ux17: two
let data = 0xFFFFFFFF.uint32
dump data.sizeof
let parsed = parser.get(newStringBitStream(data.toHex.parseHexStr))
dump parsed.one.sizeof
dump parsed.one.toHex
dump parsed.two.sizeof
dump parsed.two.toHex
# OUTPUT
# data = 4294967295
# data.sizeof = 4
# parsed.one.sizeof = 2
# parsed.one.toHex = 7FFF
# parsed.two.sizeof = 4
# parsed.two.toHex = 1FFFF000 instead of 0001FFFF
What about a letter to define the possibility to "shift left" an int field when inflating it to the nearest int size, instead of the current default shift right?
I mean using an hypotetical symbol x