4.5 KiB
4.5 KiB
Changelog
All notable changes to this project will be documented in this file.
Unreleased
0.4.2 - 2025-07-25
- Fix incorrect byte string value with non-ASCII
\xHHbyte string escapesByteStringLit::parse(r#"b"\xff""#).unwrap().value()would return[0xc3, 0xbf]instead of[0xff].
- Remove CR LF normalization to align with spec
- This is technically a breaking change, but released with a minor version bump as it just aligns with the specification. It is extremely unlikely to affect any real world use case.
- Fix incorrect error span for out-of-range Unicode escapes
0.4.1 - 2023-10-18
- Fixed incorrectly labeling
27f32a float literals in docs. - Added hint to integer literal docs about parsing as
u128.
0.4.0 - 2023-03-05
Added
- Add ability to parse literals with arbitrary suffixes (e.g.
"foo"blaor23px) - Add
suffix()method to all literal types exceptBoolLit - Add
IntegerBase::value - Add
from_suffixandsuffixmethods toFloatTypeandIntegerType - Add
FromStrandDisplayimpls toFloatTypeandIntegerType
Changed
- Breaking: Mark
FloatTypeandIntegerTypeas#[non_exhaustive] - Breaking: Fix integer parsing for cases like
27f32.Literal::parseandIntegerLit::parsewill both identify this as an integer literal. - Breaking: Fix float parsing by correctly rejecting inputs like
27f32. A float literal must have a period OR an exponent part, according to the spec. Previously decimal integers were accepted inFloatLit::parse. - Improved some parts of the docs
Removed
- Breaking: Remove
OwnedLiteralandSharedLiteral
0.3.0 - 2022-12-19
Breaking
- Bump MSRV (minimal supported Rust version) to 1.54
Added
- Add
raw_inputandinto_raw_inputto non-bool*Littypes - Add
impl From<*Lit> for pm::Literal(for non-bool literals) - Add
impl From<BoolLit> for pm::Ident
Fixed
- Fix link to reference and clarify bool literals (#7)
Internals
- Move lots of parsing code into non-generic functions (this hopefully reduces compile times)
- To implement
[into_]raw_inputfor integer and float literals, their internals were changed a bit so that they store the full input string now.
0.2.3 - 2021-06-09
Changed
- Minor internal code change to bring MSRV from 1.52 to 1.42
0.2.2 - 2021-06-09
Changed
- Fixed (byte) string literal parsing by:
- Correctly handling "string continue" sequences
- Correctly converting
\n\rinto\n
0.2.1 - 2021-06-04
Changed
- Fixed the
expectedvalue of the error returned fromTryFrom<TokenTree>impls in some cases
0.2.0 - 2021-05-28
Changed
- Breaking: rename
ErrortoParseError. That describes its purpose more closely and is particular useful now that other error types exist in the library.
Removed
- Breaking: remove
proc-macrofeature and instead offer the correspondingimpls unconditionally. Since the feature didn't enable/disable a dependency (proc-macrois a compiler provided crate) and since apparently it works fine inno_stdenvironments, I dropped this feature. I don't currently see a reason why the corresponding impls should be conditional.
Added
TryFrom<TokenTree> for litrs::LiteralimplsFrom<*Lit> for litrs::LiteralimplsTryFrom<proc_macro[2]::Literal> for *LitTryFrom<TokenTree> for *LitInvalidTokenerror type for all newTryFromimpls
0.1.1 - 2021-05-25
Added
Fromimpls to create aLiteralfrom references to proc-macro literal types:From<&proc_macro::Literal>From<&proc_macro2::Literal>
- Better examples in README and repository
0.1.0 - 2021-05-24
Added
- Everything