Skip to content

Scopes

Scopes models the nested declaration stack used by the checker.

new Scopes(parent?, scopes?): Scopes

Scopes

Group = ...

Scopes

readonly optional parent?: Scopes


readonly scopes: Group

addIdent(decl): void

addIdent stores an identifier in the current frame.

VariableDecl

void


copy(): Scopes

copy clones the full scope chain.

Scopes


findFunction(name): FunctionDecl | undefined

findFunction resolves a function from inner to outer scope.

string

FunctionDecl | undefined


findGlobalIdent(name): VariableDecl | undefined

findGlobalIdent resolves an identifier from the root frame only.

string

VariableDecl | undefined


findIdent(name): VariableDecl | undefined

findIdent resolves an identifier from inner to outer scope.

string

VariableDecl | undefined


findIdentInScope(name): VariableDecl | undefined

findIdentInScope resolves an identifier only in the current frame.

string

VariableDecl | undefined


findLocalIdent(name): VariableDecl | undefined

findLocalIdent resolves an identifier while ignoring the root frame.

string

VariableDecl | undefined


pop(): Scopes

pop returns the parent scope when present.

Scopes


push(): Scopes

push creates a new innermost scope frame.

Scopes


setFunction(fn): void

setFunction stores a function in the current frame.

FunctionDecl

void