/** * One module's semantic index, built in one walk over the program. * * D115 §一.1 / D114 R1f: `buildSemanticIndex` was one 830-line closure with * twenty-six inner arrows. Each of those is a method here — the class is the * closure, the fields are its `const`s, and `build()` is the three loops and * the index it returned, in the order they ran. Three families that never walk * a statement moved out to `declarations.ts`, `references.ts` and * `documentation.ts`; this module is the walk. */ import type { Program } from "../ast.ts"; import { type SourceText } from "../source.ts"; import { type Token } from "../token.ts"; import { type ValueType } from "../types.ts"; import { type CompilerSemanticExtension, type SemanticIndex } from "./symbols.ts"; /** * One module's semantic index, built in one walk. Every piece of the walk is a * method here rather than a closure inside one 830-line function, so a reader * is sent to the arm that answers for the declaration in front of them. * * D115 §一.1 / D114 R1f: the closure `buildSemanticIndex` was became this class * unchanged — each `const name = (…) => …` is the method of the same name, each * `const name = value` is the field of the same name, and the three loops and * the returned index are `build()`, in the order they ran. */ export declare class SemanticIndexBuilder { private readonly program; private readonly source; private readonly bindingTypes; private readonly bindingMembers; private readonly expressionTypes; private readonly expressionMembers; private readonly expressionOwners; private readonly objectPropertyOwners; private readonly bindingEntryOwners; private readonly jsxAttributeOwners; private readonly expressionContexts; private readonly expressionContextMembers; private readonly semanticExtensions; private readonly lexicalTokens; private readonly symbols; private readonly references; private readonly memberReferences; private readonly imports; private readonly moduleReferences; private readonly expressions; private readonly syntaxTokens; private readonly syntaxDocumentation; private readonly syntaxTokenIdentities; private readonly syntaxDocumentationIdentities; private readonly expressionKeys; private readonly describedMemberCache; private readonly declarations; private readonly rootScope; private readonly scopes; private readonly allScopes; private readonly contextMarkersBySpecificity; private extensionContext; private nextScopeId; private readonly names; private readonly reads; private readonly syntax; constructor(program: Program, source: SourceText, bindingTypes: ReadonlyMap, bindingMembers: ReadonlyMap>, expressionTypes: ReadonlyMap, expressionMembers: ReadonlyMap>, expressionOwners: ReadonlyMap, objectPropertyOwners: ReadonlyMap, bindingEntryOwners: ReadonlyMap, jsxAttributeOwners: ReadonlyMap, expressionContexts: ReadonlyMap, expressionContextMembers: ReadonlyMap>, semanticExtensions: readonly CompilerSemanticExtension[], lexicalTokens: readonly Token[]); /** * The one object the three halves of the index are handed. Every property is * a live read of this builder: the scope stack grows and shrinks and the * symbol arrays are appended to while a half is running, so none of it can be * a value captured when the halves were built. */ private indexHost; private predeclareTopLevel; private visitPattern; private visitMatchPattern; private visitExpression; private visitFunction; private visitBlock; /** * `extern module`: every function, constant and class it declares, and the * type references each of them names. * * D115 §一.1 / D114 R1f: one arm of `visitStatement`, moved out unchanged so * both fit in one screen. */ private visitExternModuleDeclaration; /** * A class body: its base, its parameters and fields, the three compiler-owned * blocks (`initialization`, `@dispose`, `@iterate`), and the getters and * methods that are visited after the class scope closes. * * D115 §一.1 / D114 R1f: one arm of `visitStatement`, moved out unchanged. */ private visitClassDeclaration; private visitStatement; build(): SemanticIndex; } //# sourceMappingURL=indexer.d.ts.map