| 1 |
# Changelog |
| 2 |
|
| 3 |
All notable changes to this project will be documented in this file. |
| 4 |
|
| 5 |
|
| 6 |
## [Unreleased] |
| 7 |
|
| 8 |
## [1.0.0] - 2025-10-20 |
| 9 |
As announced, this is basically just v0.5. I'm really happy to finally have `litrs` in v1.x state, as the library was already fit for production usage for a long time. Now the version reflects that. |
| 10 |
|
| 11 |
- **Breaking**: Mark `Literal` as `#[non_exhaustive]` |
| 12 |
- Document semver guarantees |
| 13 |
|
| 14 |
## [0.5.1] - 2025-08-01 |
| 15 |
- Add `Literal::raw_input` |
| 16 |
|
| 17 |
## [0.5.0] - 2025-07-25 |
| 18 |
**Note**: this is supposed to be essentially a 1.0 release candidate. |
| 19 |
If there are no problems with this release, it will be released as 1.0 after some time. |
| 20 |
|
| 21 |
- **Breaking** Bump MSRC from 1.54 to 1.56 |
| 22 |
- **Breaking**: Remove `proc-macro2` from default features |
| 23 |
- **Breaking**: Make `StringLit<String>::into_value` return `String` instead of `Cow<'static, str>`. |
| 24 |
Make `ByteStringLit<String>::into_value` return `Vec<u8>` instead of `Cow<'static, [u8]>`. |
| 25 |
- Add support for C string literals (also breaking due to new enum variant) |
| 26 |
- Limit number of `#` as delimiter of raw string literals to 256 (to align with spec) |
| 27 |
- Fix license in `Cargo.toml` to use proper SPDX format (in #19, thanks @atouchet) |
| 28 |
- Fix error span for `InvalidStartOfUnicodeEscape` errors |
| 29 |
|
| 30 |
|
| 31 |
## [0.4.2] - 2025-07-25 |
| 32 |
- Fix incorrect byte string value with non-ASCII `\xHH` byte string escapes |
| 33 |
- `ByteStringLit::parse(r#"b"\xff""#).unwrap().value()` would return `[0xc3, 0xbf]` instead of `[0xff]`. |
| 34 |
- Remove CR LF normalization to align with spec |
| 35 |
- 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. |
| 36 |
- Fix incorrect error span for out-of-range Unicode escapes |
| 37 |
|
| 38 |
## [0.4.1] - 2023-10-18 |
| 39 |
- Fixed incorrectly labeling `27f32` a float literals in docs. |
| 40 |
- Added hint to integer literal docs about parsing as `u128`. |
| 41 |
|
| 42 |
## [0.4.0] - 2023-03-05 |
| 43 |
### Added |
| 44 |
- Add ability to parse literals with arbitrary suffixes (e.g. `"foo"bla` or `23px`) |
| 45 |
- Add `suffix()` method to all literal types except `BoolLit` |
| 46 |
- Add `IntegerBase::value` |
| 47 |
- Add `from_suffix` and `suffix` methods to `FloatType` and `IntegerType` |
| 48 |
- Add `FromStr` and `Display` impls to `FloatType` and `IntegerType` |
| 49 |
|
| 50 |
### Changed |
| 51 |
- **Breaking**: Mark `FloatType` and `IntegerType` as `#[non_exhaustive]` |
| 52 |
- **Breaking**: Fix integer parsing for cases like `27f32`. `Literal::parse` |
| 53 |
and `IntegerLit::parse` will both identify this as an integer literal. |
| 54 |
- **Breaking**: Fix float parsing by correctly rejecting inputs like `27f32`. A |
| 55 |
float literal must have a period OR an exponent part, according to the spec. |
| 56 |
Previously decimal integers were accepted in `FloatLit::parse`. |
| 57 |
- Improved some parts of the docs |
| 58 |
|
| 59 |
### Removed |
| 60 |
- **Breaking**: Remove `OwnedLiteral` and `SharedLiteral` |
| 61 |
|
| 62 |
## [0.3.0] - 2022-12-19 |
| 63 |
### Breaking |
| 64 |
- Bump MSRV (minimal supported Rust version) to 1.54 |
| 65 |
|
| 66 |
### Added |
| 67 |
- Add `raw_input` and `into_raw_input` to non-bool `*Lit` types |
| 68 |
- Add `impl From<*Lit> for pm::Literal` (for non-bool literals) |
| 69 |
- Add `impl From<BoolLit> for pm::Ident` |
| 70 |
|
| 71 |
### Fixed |
| 72 |
- Fix link to reference and clarify bool literals ([#7](https://github.com/LukasKalbertodt/litrs/pull/7)) |
| 73 |
|
| 74 |
### Internals |
| 75 |
- Move lots of parsing code into non-generic functions (this hopefully reduces compile times) |
| 76 |
- To implement `[into_]raw_input` for integer and float literals, their |
| 77 |
internals were changed a bit so that they store the full input string now. |
| 78 |
|
| 79 |
## [0.2.3] - 2021-06-09 |
| 80 |
### Changed |
| 81 |
- Minor internal code change to bring MSRV from 1.52 to 1.42 |
| 82 |
|
| 83 |
## [0.2.2] - 2021-06-09 |
| 84 |
### Changed |
| 85 |
- Fixed (byte) string literal parsing by: |
| 86 |
- Correctly handling "string continue" sequences |
| 87 |
- Correctly converting `\n\r` into `\n` |
| 88 |
|
| 89 |
## [0.2.1] - 2021-06-04 |
| 90 |
### Changed |
| 91 |
- Fixed the `expected` value of the error returned from `TryFrom<TokenTree>` impls in some cases |
| 92 |
|
| 93 |
## [0.2.0] - 2021-05-28 |
| 94 |
### Changed |
| 95 |
- **Breaking**: rename `Error` to `ParseError`. That describes its purpose more |
| 96 |
closely and is particular useful now that other error types exist in the library. |
| 97 |
|
| 98 |
### Removed |
| 99 |
- **Breaking**: remove `proc-macro` feature and instead offer the corresponding |
| 100 |
`impl`s unconditionally. Since the feature didn't enable/disable a |
| 101 |
dependency (`proc-macro` is a compiler provided crate) and since apparently |
| 102 |
it works fine in `no_std` environments, I dropped this feature. I don't |
| 103 |
currently see a reason why the corresponding impls should be conditional. |
| 104 |
|
| 105 |
### Added |
| 106 |
- `TryFrom<TokenTree> for litrs::Literal` impls |
| 107 |
- `From<*Lit> for litrs::Literal` impls |
| 108 |
- `TryFrom<proc_macro[2]::Literal> for *Lit` |
| 109 |
- `TryFrom<TokenTree> for *Lit` |
| 110 |
- `InvalidToken` error type for all new `TryFrom` impls |
| 111 |
|
| 112 |
|
| 113 |
## [0.1.1] - 2021-05-25 |
| 114 |
### Added |
| 115 |
- `From` impls to create a `Literal` from references to proc-macro literal types: |
| 116 |
- `From<&proc_macro::Literal>` |
| 117 |
- `From<&proc_macro2::Literal>` |
| 118 |
- Better examples in README and repository |
| 119 |
|
| 120 |
## 0.1.0 - 2021-05-24 |
| 121 |
### Added |
| 122 |
- Everything |
| 123 |
|
| 124 |
|
| 125 |
[Unreleased]: https://github.com/LukasKalbertodt/litrs/compare/v1.0.0...HEAD |
| 126 |
[1.0.0]: https://github.com/LukasKalbertodt/litrs/compare/v0.5.1...v1.0.0 |
| 127 |
[0.5.1]: https://github.com/LukasKalbertodt/litrs/compare/v0.5.0...v0.5.1 |
| 128 |
[0.5.0]: https://github.com/LukasKalbertodt/litrs/compare/v0.4.2...v0.5.0 |
| 129 |
[0.4.2]: https://github.com/LukasKalbertodt/litrs/compare/v0.4.1...v0.4.2 |
| 130 |
[0.4.1]: https://github.com/LukasKalbertodt/litrs/compare/v0.4.0...v0.4.1 |
| 131 |
[0.4.0]: https://github.com/LukasKalbertodt/litrs/compare/v0.3.0...v0.4.0 |
| 132 |
[0.3.0]: https://github.com/LukasKalbertodt/litrs/compare/v0.2.3...v0.3.0 |
| 133 |
[0.2.3]: https://github.com/LukasKalbertodt/litrs/compare/v0.2.2...v0.2.3 |
| 134 |
[0.2.2]: https://github.com/LukasKalbertodt/litrs/compare/v0.2.1...v0.2.2 |
| 135 |
[0.2.1]: https://github.com/LukasKalbertodt/litrs/compare/v0.2.0...v0.2.1 |
| 136 |
[0.2.0]: https://github.com/LukasKalbertodt/litrs/compare/v0.1.1...v0.2.0 |
| 137 |
[0.1.1]: https://github.com/LukasKalbertodt/litrs/compare/v0.1.0...v0.1.1 |