Skip to content

Commit 8b93af5

Browse files
committed
Refactor diagnostic errors to use miette.
This commit refactors the lexer/ast/resolution errors to be based on `miette` and removes the custom error formatting implementation. The relevant error types also no longer have a lifetime parameter and own the data. Test baselines have been updated to the new error format. The `Span` type has been replaced with `SourceSpan` from `miette`.
1 parent 787bdd4 commit 8b93af5

137 files changed

Lines changed: 2822 additions & 2727 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.lock

Lines changed: 111 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ serde_json = { workspace = true }
3131
wat = { workspace = true }
3232
wasmparser = { workspace = true }
3333
wasmprinter = { workspace = true }
34+
thiserror = { workspace = true }
35+
# TODO: use the next release which has support for primary labels
36+
miette = { git = "https://github.com/zkat/miette", features = ["fancy"] }
3437

3538
[features]
3639
default = []

crates/wac-parser/Cargo.toml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,17 +24,21 @@ wit-component = { workspace = true }
2424
wasm-encoder = { workspace = true }
2525
wasm-metadata = { workspace = true }
2626
wat = { workspace = true, optional = true }
27-
owo-colors = { workspace = true }
27+
# TODO: use the next release which has support for primary labels
28+
miette = { git = "https://github.com/zkat/miette", features = ["serde"] }
2829

2930
[features]
3031
default = ["wat"]
3132

3233
[dev-dependencies]
34+
owo-colors = "3.5.0"
3335
pretty_assertions = "1.4.0"
3436
pretty_env_logger = { workspace = true }
3537
rayon = "1.8.0"
3638
serde_json = { workspace = true }
3739
wasmprinter = { workspace = true }
40+
# TODO: use the next release which has support for primary labels
41+
miette = { git = "https://github.com/zkat/miette", features = ["serde", "fancy"] }
3842

3943
[[test]]
4044
name = "parser"

0 commit comments

Comments
 (0)