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:
parent
2fc321596f
commit
7de1682e91
|
|
@ -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>({
|
export const trackScope = new ContextTracker<Scope>({
|
||||||
start: new Scope(null, new Set(), [], false),
|
start: new Scope(null, new Set(), [], false),
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user