/** * The first step of every function in this tier: text becomes a file, and the * file becomes tokens. * * It is one place rather than four because all four begin identically and * because one of them beginning differently is a bug nobody would look for. * * The bag is created and, for `highlight`, thrown away. That is not waste: the * lexer reports rather than throws, so handing it somewhere to report is how it * is told to carry on, and a highlighter has nothing to say about a character * the language does not have. `diagnose` is what says it. */ import { DiagnosticBag } from '../core/index.js'; import type { CheckedScript, Script, SourceFile, Token } from '../core/index.js'; export interface Read { readonly file: SourceFile; readonly bag: DiagnosticBag; readonly tokens: readonly Token[]; } export interface ReadTree extends Read { readonly script: Script; } export interface ReadChecked extends ReadTree { readonly checked: CheckedScript; } /** Text to a file and its tokens. */ export declare function read(source: string): Read; /** The same, with the tree, for the functions that need one. */ export declare function readTree(source: string): ReadTree; /** * The same again, checked, for the two that ask what a name means. * * `complete` and `hover` both need the checker's answers: which names the file * has declared, where each was declared, and what type each one holds. Nothing * here is a lighter version of the checker. It is the checker, run on a file * that is halfway through being typed, which it is built to survive: a name * that does not resolve becomes `unknown` and the lines around it are still * checked, so the names above the cursor are still names. */ export declare function readChecked(source: string): ReadChecked; //# sourceMappingURL=reading.d.ts.map