Add annotate_snippets for better parsing errors (#477)
Adds nicer errors for Podlang code, using the `annotate_snippets` crate, the same crate used by the Rust compiler to generate contextual errors. This prints a short snippet of the code containing the error within the error message, highlighting the part that needs to be fixed. It also includes a change to the `load_module` function, changing a `Vec` function argument to a slice.
This commit is contained in:
parent
acab26e5c1
commit
09d67de989
11 changed files with 612 additions and 40 deletions
|
|
@ -42,6 +42,7 @@ serde_arrays = "0.2.0"
|
|||
sha2 = { version = "0.10.9" }
|
||||
rand_chacha = "0.3.1"
|
||||
good_lp = { version = "1.8", default-features = false, features = ["microlp"] }
|
||||
annotate-snippets = "0.11"
|
||||
|
||||
# Uncomment for debugging with https://github.com/ed255/plonky2/ at branch `feat/debug`. The repo directory needs to be checked out next to the pod2 repo directory.
|
||||
# [patch."https://github.com/0xPARC/plonky2"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue