- Fixed a bug where base prefix substrings would be recognized as such later in the string.
- The
0b
in0XDEAD_BEEF0b
should be catorgized as digits and not a base prefix.
- The
- Fixed a bug where, in base 0 mode,
lenient_parse
would parse a string with an incomplete base prefix.01
should reject, as it is missing a specifier (b
,B
,o
,O
,x
,X
).
- Fixed a bug where
lenient_parse
was rejecting strings containing leading / trailing uncommon whitespace characters.
- Fixed precision errors. We now rely on
bigi
andpilkku
to construct the final float representation.
- Fixed precision errors in some float representations by removing the need to add together the integer and fractional parts of a float.
- Fixed a bug where an underscore was not allowed in between a base prefix string and the number:
0x_DEAD_BEEF
should parse.
- Added base 0 support to
lenient_parse.to_int_with_base
. When providing a base of 0, the function will look for a base prefix string (0b
,0o
,0x
) to try to determine the base value. If no prefix is found, the function will default to base 10.
- Added arbitrary base support for integer parsing - use pub
lenient_parse.to_int_with_base
. - Introduced
OutOfBaseRange
andInvalidBaseValue
errors.
- Added support for scientific notation for float parsing.
- Ex:
lenient_parse.to_float("4e-3")
// Ok(0.004)
- Ex:
- Implemented a new recursive descent parser.
- Breaking changes:
GleamIntParseError
andGleamIntParseErrorReason
have been removed.InvalidCharacter
has been renamed toUnknownCharacter
.- A new
InvalidDigitPosition
error has been introduced.
- Fixed bugs.
- Return custom error types for various parsing errors instead of simply
Nil
. - Reworked internal algorithm for more robust parsing.
- Added more examples to
README.md
.
- Initial release.