dillon1000/react
Commit
Browse files Make implicit break/continue explicit in ReactiveFunction
Previously when converting from HIR -> ReactiveFunction we elided break/continue terminals in places where control would implicitly transfer to the break/continue target and therefore nothing has to be emitted. The one downside of this approach is that it makes scope analysis a bit trickier. We want to close scopes once we see an instruction id past the end of the scope's range, but these implicit breaks were causing us to miss some instruction ids. We compensated for this, but it's helpful to keep the representation explicit and discard these terminals later in codegen.
Changed paths11 files
First-parent comparisoncompiler/forget/src/HIR/HIR.ts ModifiedM compiler/forget/src/ReactiveScopes/BuildReactiveFunction.ts ModifiedM compiler/forget/src/ReactiveScopes/CodegenReactiveFunction.ts ModifiedM compiler/forget/src/__tests__/fixtures/hir/conditional-break.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/conditional-break.js ModifiedR compiler/forget/src/__tests__/fixtures/hir/_bug_conditional-break-labeled.expect.md →compiler/forget/src/__tests__/fixtures/hir/error.conditional-break-labeled.expect.md RenamedR compiler/forget/src/__tests__/fixtures/hir/_bug_conditional-break-labeled.js →compiler/forget/src/__tests__/fixtures/hir/error.conditional-break-labeled.js RenamedR compiler/forget/src/__tests__/fixtures/hir/ssa-for-of.expect.md →compiler/forget/src/__tests__/fixtures/hir/error.ssa-for-of.expect.md RenamedR compiler/forget/src/__tests__/fixtures/hir/ssa-for-of.js →compiler/forget/src/__tests__/fixtures/hir/error.ssa-for-of.js RenamedM compiler/forget/src/__tests__/fixtures/hir/inverted-if.expect.md ModifiedM compiler/forget/src/__tests__/fixtures/hir/inverted-if.js ModifiedPatch
Files changed
Rendering syntax-highlighted changes…