diff --git a/compiler/forget/src/HIR/HIR.ts b/compiler/forget/src/HIR/HIR.ts index 23efaac7ac..85d7586b9a 100644 --- a/compiler/forget/src/HIR/HIR.ts +++ b/compiler/forget/src/HIR/HIR.ts @@ -555,7 +555,7 @@ export type ReactiveScope = { id: ScopeId; range: MutableRange; dependencies: Set; - outputs: Set; + declarations: Set; }; export type ReactiveScopeDependency = { diff --git a/compiler/forget/src/ReactiveScopes/CodegenReactiveFunction.ts b/compiler/forget/src/ReactiveScopes/CodegenReactiveFunction.ts index ac71deb6ba..22ac9479b7 100644 --- a/compiler/forget/src/ReactiveScopes/CodegenReactiveFunction.ts +++ b/compiler/forget/src/ReactiveScopes/CodegenReactiveFunction.ts @@ -179,7 +179,7 @@ function codegenReactiveScope( ); } let firstOutputIndex: number | null = null; - for (const output of scope.outputs) { + for (const output of scope.declarations) { const index = cx.nextCacheIndex; if (firstOutputIndex === null) { firstOutputIndex = index; diff --git a/compiler/forget/src/ReactiveScopes/InferReactiveScopeVariables.ts b/compiler/forget/src/ReactiveScopes/InferReactiveScopeVariables.ts index 6ad35c57b1..14be0c0a77 100644 --- a/compiler/forget/src/ReactiveScopes/InferReactiveScopeVariables.ts +++ b/compiler/forget/src/ReactiveScopes/InferReactiveScopeVariables.ts @@ -128,7 +128,7 @@ export function inferReactiveScopeVariables(fn: HIRFunction) { id: makeScopeId(scopes.size), range: identifier.mutableRange, dependencies: new Set(), - outputs: new Set(), + declarations: new Set(), }; scopes.set(groupIdentifier, scope); } else { diff --git a/compiler/forget/src/ReactiveScopes/PrintReactiveFunction.ts b/compiler/forget/src/ReactiveScopes/PrintReactiveFunction.ts index d066232603..8be8a48664 100644 --- a/compiler/forget/src/ReactiveScopes/PrintReactiveFunction.ts +++ b/compiler/forget/src/ReactiveScopes/PrintReactiveFunction.ts @@ -43,9 +43,9 @@ export function printReactiveBlock( writer.writeLine( `scope @${block.scope.id} [${block.scope.range.start}:${ block.scope.range.end - }] deps=[${Array.from(block.scope.dependencies) + }] dependencies=[${Array.from(block.scope.dependencies) .map((dep) => printDependency(dep)) - .join(", ")}] out=[${Array.from(block.scope.outputs) + .join(", ")}] declarations=[${Array.from(block.scope.declarations) .map((out) => printIdentifier(out)) .join(", ")}] {` ); diff --git a/compiler/forget/src/ReactiveScopes/PromoteUsedTemporaries.ts b/compiler/forget/src/ReactiveScopes/PromoteUsedTemporaries.ts index d15dda3236..6b9519205a 100644 --- a/compiler/forget/src/ReactiveScopes/PromoteUsedTemporaries.ts +++ b/compiler/forget/src/ReactiveScopes/PromoteUsedTemporaries.ts @@ -25,7 +25,7 @@ class Visitor extends ReactiveFunctionVisitor { // value. // Many of our current test fixtures do not return a value, so // it is better for now to promote (and memoize) every output. - for (const identifier of block.scope.outputs) { + for (const identifier of block.scope.declarations) { if (identifier.name == null) { identifier.name = `t${state.nextId++}`; } diff --git a/compiler/forget/src/ReactiveScopes/PropagateScopeDependencies.ts b/compiler/forget/src/ReactiveScopes/PropagateScopeDependencies.ts index 71107c4a2e..aca9608203 100644 --- a/compiler/forget/src/ReactiveScopes/PropagateScopeDependencies.ts +++ b/compiler/forget/src/ReactiveScopes/PropagateScopeDependencies.ts @@ -153,7 +153,7 @@ class Context { if (decl !== undefined) { const operandScope = maybeDependency.place.identifier.scope; if (operandScope !== null && !this.#isScopeActive(operandScope)) { - operandScope.outputs.add(maybeDependency.place.identifier); + operandScope.declarations.add(maybeDependency.place.identifier); } } diff --git a/compiler/forget/src/ReactiveScopes/PruneUnusedScopes.ts b/compiler/forget/src/ReactiveScopes/PruneUnusedScopes.ts index fe5e38387e..333dc69fde 100644 --- a/compiler/forget/src/ReactiveScopes/PruneUnusedScopes.ts +++ b/compiler/forget/src/ReactiveScopes/PruneUnusedScopes.ts @@ -30,7 +30,7 @@ function visitBlock(block: ReactiveBlock): ReactiveBlock { } case "scope": { stmt.instructions = visitBlock(stmt.instructions); - if (stmt.scope.outputs.size === 0) { + if (stmt.scope.declarations.size === 0) { nextBlock ??= block.slice(0, i); nextBlock.push(...stmt.instructions); continue;