dillon1000/react

Commit

[rust] Support destructuring

Adds a `Destructure` instruction closely following the design of the TS-based 
compiler. The main change is fairly small: the TS compiler doesn't support rest 
spreads that are not identifiers, such as the `...y[]` in `const [x, ...[y]] = 
z`. I added support for this in the Rust compiler.
Browse files
Changed paths21 files
First-parent comparison
M compiler/forget/crates/forget_build_hir/src/build.rs ModifiedA compiler/forget/crates/forget_fixtures/tests/fixtures/destructure-array.js AddedA compiler/forget/crates/forget_fixtures/tests/fixtures/destructure-object.js AddedM compiler/forget/crates/forget_fixtures/tests/fixtures_test.rs ModifiedM compiler/forget/crates/forget_fixtures/tests/snapshots/fixtures_test__fixtures@constant-propagation-constant-if-condition.js.snap ModifiedM compiler/forget/crates/forget_fixtures/tests/snapshots/[email protected] ModifiedA compiler/forget/crates/forget_fixtures/tests/snapshots/[email protected] AddedA compiler/forget/crates/forget_fixtures/tests/snapshots/[email protected] AddedM compiler/forget/crates/forget_fixtures/tests/snapshots/[email protected] ModifiedM compiler/forget/crates/forget_fixtures/tests/snapshots/[email protected] ModifiedM compiler/forget/crates/forget_fixtures/tests/snapshots/[email protected] ModifiedM compiler/forget/crates/forget_fixtures/tests/snapshots/[email protected] ModifiedM compiler/forget/crates/forget_fixtures/tests/snapshots/[email protected] ModifiedM compiler/forget/crates/forget_fixtures/tests/snapshots/[email protected] ModifiedM compiler/forget/crates/forget_fixtures/tests/snapshots/[email protected] ModifiedM compiler/forget/crates/forget_fixtures/tests/snapshots/[email protected] ModifiedM compiler/forget/crates/forget_hir/src/instruction.rs ModifiedM compiler/forget/crates/forget_hir/src/print.rs ModifiedM compiler/forget/crates/forget_semantic_analysis/src/analyzer.rs ModifiedM compiler/forget/crates/forget_ssa/src/eliminate_redundant_phis.rs ModifiedM compiler/forget/crates/forget_ssa/src/enter.rs Modified
Patch

Files changed

Rendering syntax-highlighted changes…