From 4dc08222b1b9160a699a03fca7cc0e21cc4bdece Mon Sep 17 00:00:00 2001 From: Kai Stevenson Date: Sun, 2 Nov 2025 20:07:43 -0800 Subject: cleanup --- src/lang/core/common.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/lang/core/common.ts') diff --git a/src/lang/core/common.ts b/src/lang/core/common.ts index c1a1dc3..9e3840b 100644 --- a/src/lang/core/common.ts +++ b/src/lang/core/common.ts @@ -55,3 +55,18 @@ export type ParserCtx = { lastToken: Token | null; stack: readonly ASTNode[]; }; + +export type StackFrame< + Bindings extends Record = Record, + Parent extends StackFrame | null = any +> = { + bindings: Bindings; + parent: Parent; +}; + +export type EmptyStackFrame = StackFrame<{}, null>; + +export type WithPushedBindings< + OldFrame extends StackFrame, + Bindings extends StackFrame["bindings"] +> = StackFrame; -- cgit v1.2.3-70-g09d2