Skip to content

Commit 7db2f70

Browse files
committed
add parsing for AST using chumsky
This adds parsing via `chumsky` and some necessary changes for it to work: - Change `error::Span` type to use byte offset for position. Also add the `line-index` crate to replace the `line_col` method which was previously used with the `pest` parser. - Replace the `PestParse` trait with the `ChumskyParse` trait and the `ParseFromStr` implementation for it.
1 parent 213e93a commit 7db2f70

4 files changed

Lines changed: 949 additions & 980 deletions

File tree

Cargo.lock

Lines changed: 20 additions & 141 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ serde = ["dep:serde", "dep:serde_json"]
2323

2424
[dependencies]
2525
base64 = "0.21.2"
26-
pest = "2.1.3"
27-
pest_derive = "2.7.1"
2826
serde = { version = "1.0.188", features = ["derive"], optional = true }
2927
serde_json = { version = "1.0.105", optional = true }
3028
simplicity-lang = { version = "0.6.0" }
@@ -34,6 +32,7 @@ itertools = "0.13.0"
3432
arbitrary = { version = "1", optional = true, features = ["derive"] }
3533
clap = "4.5.37"
3634
chumsky = "0.11.2"
35+
line-index = "0.1.2"
3736

3837
[target.wasm32-unknown-unknown.dependencies]
3938
getrandom = { version = "0.2", features = ["js"] }

0 commit comments

Comments
 (0)