Skip to content

Commit 7559b11

Browse files
cakevmclaude
andauthored
feat: introduce source code maps (#88)
Co-authored-by: Claude <[email protected]>
1 parent 90d2947 commit 7559b11

Some content is hidden

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

53 files changed

+1333
-1174
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22

33
# Huff Neo Compiler changelog
44

5+
## Unreleased
6+
7+
## [1.3.1] - 2025-08-14
8+
- Add constructor and runtime source maps in Artifact structure.
9+
- Remove UUID field from FileSource struct for better WASM compatibility.
10+
- Fix span end to be inclusive at the end.
11+
512
## [1.3.0] - 2025-08-12
613
- Update rust to 1.89 and dependencies to the latest version.
714
- **Breaking**: Implement proper label scoping to prevent label overwriting in macro invocations. (fixes #82)

Cargo.lock

Lines changed: 8 additions & 13 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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ license = "MIT OR Apache-2.0"
1111
readme = "README.md"
1212
repository = "https://github.com/cakevm/huff-neo"
1313
rust-version = "1.89"
14-
version = "1.3.0"
14+
version = "1.3.1"
1515

1616
[workspace.dependencies]
1717
huff-neo-codegen = { path = "crates/codegen" }
@@ -38,7 +38,6 @@ thiserror = "2.0.14"
3838
tokio = "1.47.1"
3939
tracing = "0.1.41"
4040
tracing-subscriber = { version = "0.3.19", default-features = false, features = ["env-filter", "fmt"] }
41-
uuid = { version = "1.18.0", default-features = false, features = ["js", "v4"] }
4241
walkdir = "2.5.0"
4342
wasm-bindgen = "0.2.100"
4443
yansi = "1.0.1"
@@ -71,7 +70,6 @@ toml = { version = "0.8.23", default-features = false, features = ["parse"] }
7170

7271
# dev
7372
criterion = "0.6.0"
74-
getrandom = { version = "0.3.3", features = ["wasm_js"] }
7573
rayon = "1.10.0"
7674

7775
[profile.test]

Makefile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ doc:
5555
RUSTDOCFLAGS="--show-type-layout --generate-link-to-definition --enable-index-page -D warnings -Z unstable-options" \
5656
cargo +nightly doc --workspace --all-features --no-deps --document-private-items
5757

58+
.PHONY: udeps
59+
udeps:
60+
cargo install cargo-machete --locked && cargo-machete --with-metadata
61+
5862
.PHONY: pre-release
5963
pre-release:
6064
mdbook test

bin/hnc/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ serde.workspace = true
2929
shadow-rs.workspace = true
3030
tokio.workspace = true
3131
tracing.workspace = true
32-
uuid.workspace = true
3332
yansi.workspace = true
3433

3534
[build-dependencies]

bin/hnc/src/main.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -295,13 +295,7 @@ fn main() {
295295
.map(|s| Span {
296296
start: 0,
297297
end: 0,
298-
file: Some(Arc::new(FileSource {
299-
id: uuid::Uuid::new_v4(),
300-
path: s.clone(),
301-
source: None,
302-
access: None,
303-
dependencies: vec![],
304-
})),
298+
file: Some(Arc::new(FileSource { path: s.clone(), source: None, access: None, dependencies: vec![] })),
305299
})
306300
.collect::<Vec<Span>>(),
307301
),

crates/codegen/Cargo.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,3 @@ indexmap.workspace = true
2020
regex.workspace = true
2121
serde_json.workspace = true
2222
tracing.workspace = true
23-
uuid.workspace = true

crates/codegen/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ fn example() {
4040
let main_bytecode = "5f3560e01c8063a9059cbb1461004757806340c10f19146100d757806370a082311461014157806318160ddd1461015c578063095ea7b314610166578063dd62ed3e1461017d575b600435336024358160016000526000602001526040600020548082116100d3578190038260016000526000602001526040600020558281906001600052600060200152604060002054018360016000526000602001526040600020555f527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60205fa360015f5260205ff35b5f5ffd5b5f5433146100e3575f5ffd5b6004355f60243582819060016000526000602001526040600020540183600160005260006020015260406000205580600254016002555f527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60205fa35b60043560016000526000602001526040600020545f5260205ff35b6002545f5260205ff35b602435600435336000526000602001526040600020555b6024356004356000526000602001526040600020545f5260205ff3";
4141
let constructor_bytecode = "335f55";
4242
let inputs = vec![];
43-
let churn_res = cg.churn(Arc::new(FileSource::default()), inputs, main_bytecode, constructor_bytecode, false);
43+
let churn_res = cg.churn(Arc::new(FileSource::default()), inputs, main_bytecode, constructor_bytecode, false, None, None);
4444

4545
// Validate the output bytecode
4646
assert_eq!(churn_res.unwrap().bytecode, "335f5561019980600d3d393df35f3560e01c8063a9059cbb1461004757806340c10f19146100d757806370a082311461014157806318160ddd1461015c578063095ea7b314610166578063dd62ed3e1461017d575b600435336024358160016000526000602001526040600020548082116100d3578190038260016000526000602001526040600020558281906001600052600060200152604060002054018360016000526000602001526040600020555f527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60205fa360015f5260205ff35b5f5ffd5b5f5433146100e3575f5ffd5b6004355f60243582819060016000526000602001526040600020540183600160005260006020015260406000205580600254016002555f527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef60205fa35b60043560016000526000602001526040600020545f5260205ff35b6002545f5260205ff35b602435600435336000526000602001526040600020555b6024356004356000526000602001526040600020545f5260205ff3".to_lowercase());

0 commit comments

Comments
 (0)