google / emboss

Emboss is a tool for generating code that reads and writes binary data structures.
Apache License 2.0
72 stars 22 forks source link

[Feature Request] Allow modulus operator in requires #174

Open AlanRosenthal opened 2 months ago

AlanRosenthal commented 2 months ago

I would like to enforce this requirement: Range: 0x0002 to 0xFFFE; only even values are valid

I was envisioning something like this:

    [requires: 0x0002 <= this <= 0xFFFE]
    [requires: this % 2 == 0]
reventlov commented 1 month ago

This would be covered by #41