dillon1000/react

Commit

Improve "value block" handling

This is a pre-req to construct reactive scopes in #857. "Value blocks" such as 
`for` init/test/update and `while` test need to be consistently wrapped in 
enter/leave calls so that we can extend the range of values properly. We also 
need to handle `for` init blocks a bit differently, since they allow variable 
declarations but not other types of statements. 

This PR ensures that we use consistent methods for handling value blocks (`for` 
test/update and `while` test) and treats `for` init as a new type with its own 
enter/append/leave visitor functions.
Browse files
Changed paths6 files
First-parent comparison
M compiler/forget/src/HIR/Codegen.ts ModifiedM compiler/forget/src/HIR/HIRTreeVisitor.ts ModifiedM compiler/forget/src/HIR/InferReactiveScopeDependencies.ts ModifiedM compiler/forget/src/HIR/InferReactiveScopes.ts ModifiedM compiler/forget/src/HIR/PrintHIRTree.ts ModifiedM compiler/forget/src/__tests__/fixtures/hir/ssa-for.expect.md Modified
Patch

Files changed

Rendering syntax-highlighted changes…