dillon1000/react
Commit
Browse files [rust] Fixture tests for parsing and lowering
Adds a new `fixtures` crate intended for running end-to-end tests of the compiler. As we expand the compiler this will eventually match our JS fixture setup, where we have .js files as input and produce memoized JS output. For now, this does the following: * Parses with SWC (omg this was painful to setup) * Runs SWC's name resolution, which annotates the SWC ast in-place * Convert the SWC ast into our `estree` representation * Convert `estree` into `hir` for each top-level function declaration in the input program * Print the Rust `Debug` view of the resulting HIR As a next step i'll add a pretty-printer for the HIR to roughly match what we have in JS.
Changed paths19 files
First-parent comparisoncompiler/forget/Cargo.lock ModifiedM compiler/forget/Cargo.toml ModifiedM compiler/forget/crates/build-hir/src/build.rs ModifiedM compiler/forget/crates/build-hir/src/builder.rs ModifiedM compiler/forget/crates/estree-swc/Cargo.toml ModifiedM compiler/forget/crates/estree-swc/src/lib.rs ModifiedA compiler/forget/crates/fixtures/Cargo.toml AddedA compiler/forget/crates/fixtures/README.md AddedA compiler/forget/crates/fixtures/src/lib.rs AddedA compiler/forget/crates/fixtures/tests/fixtures/simple.js AddedA compiler/forget/crates/fixtures/tests/fixtures_test.rs AddedA compiler/forget/crates/fixtures/tests/snapshots/fixtures_test__fixtures.snap AddedM compiler/forget/crates/hir/src/basic_block.rs ModifiedM compiler/forget/crates/hir/src/function.rs ModifiedM compiler/forget/crates/hir/src/id_types.rs ModifiedM compiler/forget/crates/hir/src/instruction.rs ModifiedM compiler/forget/crates/hir/src/terminal.rs ModifiedM compiler/forget/crates/hir/src/types.rs ModifiedA compiler/forget/rust-toolchain.toml AddedPatch
Files changed
Rendering syntax-highlighted changes…