It should be possible to refer to already-read values in an easy way, rather than needing to make multiple calls to unpack. For example, length prefixed strings, which are currently:
local length = unpack("u4", true)
local str = unpack("s" .. length, true)
Could instead be:
local str = unpack("length:u4 s$length", true)
Current idea for backref syntax is that $name is a backref and can be used anywhere a number is allowed, e.g. "$count * { x:u4 y:u4 z:u4 }" is also legal. "name" can be a number ($1 being the first non-named value read), a simple name ($length), or a dot-separated identifier ($toc.count).
It should be possible to refer to already-read values in an easy way, rather than needing to make multiple calls to unpack. For example, length prefixed strings, which are currently:
Could instead be:
Current idea for backref syntax is that $name is a backref and can be used anywhere a number is allowed, e.g. "$count * { x:u4 y:u4 z:u4 }" is also legal. "name" can be a number ($1 being the first non-named value read), a simple name ($length), or a dot-separated identifier ($toc.count).