Closed fsareshwala closed 6 months ago
Use:
struct Foo:
0 [+1] UInt:8 a
0 [+2] UInt:16 b
There is no union
keyword because you can already specify overlapping fields in any struct
(or bits
).
This feature is mentioned in the User Guide (though only briefly), but not, as far as I can see, in the Language Reference. It would also probably be worth having a FAQ page or a "Recipe Book", and answering this question there.
That makes sense. I thought about this approach after making this pull request but I wasn't sure if this is the way it's supposed to be done. Good to know that it is.
I put in a pull request (https://github.com/google/emboss/pull/102) to address the documentation issue for now.
I'm attempting to define a simple union. At the moment, there aren't any examples of how to define a union in the Emboss repository. I've come up with my best guess as something like:
In any case, attempting to run this through
embossc
yields the following results:It would appear that defining a union in Emboss is currently not possible. We should probably add the ability to do so.