Closed MarkWheelhouse closed 5 months ago
Seems like the internal representation in number32
works fine for this, but octal32 | hexadecimal32 | binary32 | decimal32
does not. This makes sense as these are all atomic, so a failure to parse an in bounds is going to defer to a later number and be syntactically invalid that way. I don't think there is a nice way, necessarily, of allowing that to work, except by using number32
.
At the moment, if you try to parse a Binary, Hex or Octal integer literal (with the correct flags set) that is too large to be represented as a 32-bit Int, you get a rather unhelpful "unrecognised {x,b,o}" error message, rather than something more informative.
It would be good if this could be handled either internally by parsley, or if there was some way to hook a custom error message of of such an invalid input catch.