import type { Token, TokenKind } from '../core/index.js'; /** * What a span of source is, for the purpose of giving it a colour. * * Eleven kinds, and the set is closed: a host writes eleven theme rules once and * never has to add a twelfth, because a new word in the language arrives as one * of these rather than as a kind nobody has a colour for. * * `whitespace` and `unknown` exist because every character of the file is * covered exactly once (see `scan.ts`), so the spaces between tokens have to be * something. `unknown` is source the lexer took no token from and that is not a * space or a comment: a character the language does not have, a region somebody * meant as a block comment, or a line continuation backslash. It does not mean * "wrong": `diagnose` says what is wrong, and a highlighter that had a second * opinion about it would be a second opinion about the language. */ export type HighlightKind = 'keyword' | 'builtin' | 'name' | 'number' | 'string' | 'color' | 'comment' | 'operator' | 'punctuation' | 'whitespace' | 'unknown'; /** Whether a token's kind is a reserved word of language.md 3.4. */ export declare function isReserved(kind: TokenKind): boolean; /** * The kind a token is painted as, given the tokens before it. * * The tokens before it are needed for exactly one question, the dotted name * above. Everything else is decided by the token alone. */ export declare function kindOf(token: Token, before: readonly Token[]): HighlightKind; //# sourceMappingURL=kinds.d.ts.map