feat(scope): add ScopeContext wrapper for pending identifiers

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Corey Johnson 2025-10-17 18:39:34 -07:00
parent 2fc321596f
commit 7de1682e91

View File

@ -41,6 +41,19 @@ export class Scope {
}
}
// Wrapper that adds temporary state for identifier capture
class ScopeContext {
constructor(
public scope: Scope,
public pendingIds: string[] = []
) {}
}
// Hash function only hashes the scope, not pending state
const hashScope = (context: ScopeContext): number => {
return context.scope.hash()
}
export const trackScope = new ContextTracker<Scope>({
start: new Scope(null, new Set(), [], false),