From 7de1682e913b988e462ee7e14f97f2c0d7fe2afc Mon Sep 17 00:00:00 2001 From: Corey Johnson Date: Fri, 17 Oct 2025 18:39:34 -0700 Subject: [PATCH] feat(scope): add ScopeContext wrapper for pending identifiers MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/parser/scopeTracker.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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),