Currently hex strings (bytes tmp = hex"001122";) cannot have spaces in them.
I am writing a contract right now which has quite a large hex string (237 bytes) with clearly separate parts. Splitting that with spaces would allow easier visual identification and comparison of the parts.
E.g. bytes tmp = hex"00 11 22"; would be equivalent to the above.
I'd only allow spaces between hex bytes (and not nibbles) and would disallow trailing or leading spaces.
An alternative solutions is to allow underscore instead of space with a similar strictness how underscores are allowed in number literals.
Currently hex strings (
bytes tmp = hex"001122";) cannot have spaces in them.I am writing a contract right now which has quite a large hex string (237 bytes) with clearly separate parts. Splitting that with spaces would allow easier visual identification and comparison of the parts.
E.g.
bytes tmp = hex"00 11 22";would be equivalent to the above.I'd only allow spaces between hex bytes (and not nibbles) and would disallow trailing or leading spaces.
An alternative solutions is to allow underscore instead of space with a similar strictness how underscores are allowed in number literals.