arbitrary
arbitrary copied to clipboard
Enum discriminants should be taken from the end of the input string, like lengths
The same rationale for why we take lengths from the end of the input byte string applies to discriminants: depending on the discriminant chosen, it changes which subsequent arbitrary calls are made and how many bytes are needed. It generally seems best to have "control flow"-y choices that affect shape be taken from the end of the input string and "filler" data taken from the start.
To do this we'll need to expose our internal int_in_range that takes from the end. Not sure what to call it, or how to explain why there are two variants in the documentation well...
We should do this for dataful enums, C-like enums should still just fetch a number from the cursor position.