Skip to content

[02/n] Add ParseContext context manager, wire in toml#2

Merged
thatch merged 1 commit intomainfrom
02-parse-context
Mar 19, 2026
Merged

[02/n] Add ParseContext context manager, wire in toml#2
thatch merged 1 commit intomainfrom
02-parse-context

Conversation

@thatch
Copy link
Copy Markdown
Member

@thatch thatch commented Mar 18, 2026

This is the most public API -- with this context manager active, any exception that's raised will be examined for a JSONPath string in its message. This was chosen because it's what msgspec generates today, and improving those errors is the first goal.

Modeling our source map after json-source-map, we store the keys as JSONPointer (which is a simpler, non-query-focused dialect). We now have a converter between them that works for the common case.

@thatch thatch requested a review from agarwala10 March 18, 2026 17:20
@thatch thatch changed the base branch from 01-toml-source-map to main March 19, 2026 19:08
This is the most public API -- with this context manager active, any
exception that's raised will be examined for a JSONPath string in its
message.  This was chosen because it's what msgspec generates today, and
improving those errors is the first goal.

Modeling our source map after json-source-map, we store the keys as
JSONPointer (which is a simpler, non-query-focused dialect).  We now
have a converter between them that works for the common case.
@thatch thatch force-pushed the 02-parse-context branch from 67f6e6e to b52bf6d Compare March 19, 2026 19:09
@thatch thatch merged commit 184ac6c into main Mar 19, 2026
0 of 15 checks passed
@thatch thatch deleted the 02-parse-context branch March 19, 2026 19:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant