This change adds a new keyword, $next, which may be used in the offset
expression of a physical field, and which translates to "the offset of
the first byte after the end of the syntactically previous physical
field."
Essentially, it allows structs or bits like:
struct Foo:
0 [+4] UInt a
$next [+2] UInt b
$next [+1] UInt c
$next [+4] UInt d
... where each field is packed directly after the previous one. See the
updated documentation in doc/language-reference.md for details.
This also contains a few incidental changes:
A new function in ir_util, for scanning subtrees of the IR. Note
that a similar function used to exist; this is really a resurrection
of that functionality.
synthetics.synthesize_fields has been renamed to
synthetics.desugar, since it now does more than just synthesize
fields.
The "how to use the Emboss compiler" sections of guide.md have been
expanded.
The comment in compiler/front_end/docs_are_up_to_date_test.py has
been updated with the correct paths for the open-source Emboss.
This change adds a new keyword,
$next
, which may be used in the offset expression of a physical field, and which translates to "the offset of the first byte after the end of the syntactically previous physical field."Essentially, it allows
struct
s orbits
like:... where each field is packed directly after the previous one. See the updated documentation in
doc/language-reference.md
for details.This also contains a few incidental changes:
ir_util
, for scanning subtrees of the IR. Note that a similar function used to exist; this is really a resurrection of that functionality.synthetics.synthesize_fields
has been renamed tosynthetics.desugar
, since it now does more than just synthesize fields.guide.md
have been expanded.compiler/front_end/docs_are_up_to_date_test.py
has been updated with the correct paths for the open-source Emboss.