Skip to content

Commit f1d9673

Browse files
committed
Implement name resolution.
This commit implements name resolution for type and import statements. Package resolution and resolution of let and export statements is still forthcoming. Additionally, parser and resolution tests have been added to the `wac-parser` crate. The `wac parse` command now outputs JSON containing the AST and resolution.
1 parent 9aef47e commit f1d9673

114 files changed

Lines changed: 8220 additions & 230 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: 148 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ pretty_env_logger = { workspace = true }
1818
log = { workspace = true }
1919
tokio = { workspace = true }
2020
owo-colors = { workspace = true }
21+
serde = { workspace = true }
22+
serde_json = { workspace = true }
2123

2224
[workspace.dependencies]
2325
wac-parser = { path = "crates/wac-parser" }
@@ -32,4 +34,7 @@ pretty_env_logger = "0.5.0"
3234
log = "0.4.20"
3335
tokio = { version = "1.32.0", default-features = false, features = ["macros", "rt-multi-thread"] }
3436
owo-colors = "3.5.0"
37+
indexmap = { version = "2.0.0", features = ["serde"] }
3538
id-arena = "2.2.1"
39+
serde = { version = "1.0.188", features = ["derive"] }
40+
serde_json = "1.0.107"

crates/wac-parser/Cargo.toml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,21 @@ pest_derive = { workspace = true }
1818
pest-ast = { workspace = true }
1919
from-pest = { workspace = true }
2020
semver = { workspace = true }
21+
log = { workspace = true }
22+
indexmap = { workspace = true }
2123
id-arena = { workspace = true }
24+
serde = { workspace = true }
2225

2326
[dev-dependencies]
2427
pretty_assertions = "1.4.0"
28+
pretty_env_logger = { workspace = true }
29+
rayon = "1.8.0"
30+
serde_json = { workspace = true }
31+
32+
[[test]]
33+
name = "parser"
34+
harness = false
35+
36+
[[test]]
37+
name = "resolution"
38+
harness = false

0 commit comments

Comments
 (0)