diff --git a/src/parser/scopeTracker.ts b/src/parser/scopeTracker.ts index fa42dd2..42e9af4 100644 --- a/src/parser/scopeTracker.ts +++ b/src/parser/scopeTracker.ts @@ -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({ start: new Scope(null, new Set(), [], false),