Skip to content

Error docs and cleanup #101

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 31 commits into from
Feb 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
45c4fde
* Renames `crate::resolve::ResolveError` to `crate::resolve::Error`
chanced Oct 21, 2024
e892a48
rename SlicePointer --> PointerIndex (#92)
asmello Oct 22, 2024
5dbf330
Improve `ParseIndexError::InvalidCharacter` error (#94)
asmello Oct 29, 2024
0b60a5c
adds ParseBufError, report::{Report,IntoReport,Subject,ReportErr}
chanced Nov 9, 2024
b48e05b
adds `Index` link to in docs
chanced Nov 9, 2024
16731e1
impls `miette::Diagnostic` for `Report`
chanced Nov 14, 2024
78704a4
refactoring
chanced Nov 14, 2024
1845e56
finishes up this round of the implementation - forgot a few things ea…
chanced Nov 14, 2024
8699be5
test now properly shows the fancy error display
chanced Nov 14, 2024
f69fa55
`Diagnostic::label` -> `Diagnostic::labels`
chanced Nov 15, 2024
112fec5
improves parse error & adds a quick spike test to see miette formatti…
chanced Nov 15, 2024
b78f2a6
Update CHANGELOG.md
chanced Nov 15, 2024
516e9b3
cleans up parse error message
chanced Nov 15, 2024
8550151
resolves a couple of review items
chanced Nov 15, 2024
f507257
impls miette::Report for RichParseError
chanced Nov 15, 2024
2b71eb9
rework Diagnostic trait
asmello Nov 18, 2024
8b63c7a
add diagnose back + tests
asmello Nov 18, 2024
a9cfea1
deref + fix tests
asmello Nov 18, 2024
cf3bcfa
revert name + some simplifications
asmello Nov 18, 2024
3c9ff88
rename diagnostic --> report, add into_owned
asmello Nov 18, 2024
a728f72
better generics
asmello Nov 18, 2024
1404c61
remove Report::new
asmello Nov 18, 2024
83cf219
refactor a bit (#100)
chanced Jan 30, 2025
2655535
fixes ci issue
chanced Feb 1, 2025
d1742eb
merge main
chanced Feb 1, 2025
27264a3
fixes missing use alloc::string::ToString statements
chanced Feb 1, 2025
6903441
fixes missing use alloc::boxed::Box
chanced Feb 1, 2025
e5be2ca
docs
chanced Feb 13, 2025
55ad5a6
updates CHANGELOG
chanced Feb 13, 2025
3cd820e
CHANGELOG
chanced Feb 13, 2025
3a5c61c
version bump
chanced Feb 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 27 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,29 +5,52 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [Unreleased]

### Added

- Adds method `into_buf` for `Box<Pointer>` and `impl From<PathBuf> for Box<Pointer>`.
- Adds method `into_buf` for `Box<Pointer>` and `impl From<PathBuf> for Box<Pointer>`.
- Adds unsafe associated methods `Pointer::new_unchecked` and `PointerBuf::new_unchecked` for
external zero-cost construction.
- Adds `Pointer::starts_with` and `Pointer::ends_with` for prefix and suffix matching.
- Adds new `ParseIndexError` variant to express the presence non-digit characters in the token.
- Adds `Token::is_next` for checking if a token represents the `-` character.
- Adds `InvalidEncoding` to represent the two possible encoding errors when decoding a token.
- Adds `diagnotic::Diagnostic` trait to facilitate error reporting and
`miette` integration. All errors intended for usage with `assign::Assign` or
`resolve::Resolve` must implement this trait.
- Adds `diagnostic::Report<T>` to capture the input for `PointerBuf::parse`
and to facilitate `miette` integration for all errors.
- Adds `"miette"` feature flag to enable `miette` integration for error reporting.

### Changed

- Changed signature of `PathBuf::parse` to avoid requiring allocation.
- Bumps minimum Rust version to 1.79.
- `Pointer::get` now accepts ranges and can produce `Pointer` segments as output (similar to
`slice::get`).
- Bumps minimum Rust version to 1.79.
- `PointerBuf::parse` now returns `RichParseError`, an alias to
`Report<ParseError>` which contains the allocated string as well as the
error. Use `Report::original` for matches or `Report::
- Renames `ParseError::NoLeadingBackslash` to `ParseError::NoLeadingSlash`
(sorry for the churn, I spaced hard - @chanced).
- Adds field `position` to variants of `resolve::Error` and `assign::Error` to indicate the
token index of where the error occurred.
- Renames `ParseError::is_no_leading_backslash` to `ParseError::is_no_leading_slash`.
- Renames `assign::AssignError` to `assign::Error`
- Renames `resolve::ResolveError` to `resolve::Error`
- Renames `InvalidEncodingError` to `EncodingError`

### Fixed

- Make validation of array indices conform to RFC 6901 in the presence of non-digit characters.

### Deprecated

- `ParseError::is_no_leading_backslash` renamed to `ParseError::is_no_leading_slash`.
- `assign::AssignError` renamed to `assign::Error`
- `resolve::ResolveError` renamed to `resolve::Error`
- `InvalidEncodingError` renamed to `EncodingError`

## [0.6.2] 2024-09-30

### Added
Expand Down
Loading