dillon1000/react
Commit
Browse files [new-arch][easy] Handle declarations (let/const) through codegen
Distinguishes between `LValue` and `Place`. For the most part this is the same data structure (LValue composes Place), but it's helpful to distinguish them since LValue has other properties such as the kind of declaration. The representations may diverge more in the future. This change lets us correctly emit code for variable declarations: previously we didn't emit `let` or `const`.
Changed paths25 files
First-parent comparisoncompiler/forget/src/HIR/BuildDefUseGraph.ts ModifiedM compiler/forget/src/HIR/BuildHIR.ts ModifiedM compiler/forget/src/HIR/Codegen.ts ModifiedM compiler/forget/src/HIR/HIR.ts ModifiedM compiler/forget/src/HIR/InferMutability.ts ModifiedM compiler/forget/src/HIR/PrintHIR.ts ModifiedM compiler/forget/src/HIR/ScopeAnalysis.ts ModifiedM compiler/forget/src/__tests__/fixtures/hir-svg/component.svg ModifiedM compiler/forget/src/__tests__/fixtures/hir-svg/switch.svg ModifiedM compiler/forget/src/__tests__/fixtures/hir/call.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/component.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/conditional-break.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/conditional-on-mutable.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/constructor.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/hook-call.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/independent-across-if.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/independent.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/interdependent-across-if.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/interdependent.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/property-assignment.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/reassignment-conditional.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/reassignment.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/simple.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/switch-non-final-default.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/switch.expect.md ModifiedPatch
Files changed
Rendering syntax-highlighted changes…