bolt/src/treegen/ast.dts.template

30 lines
839 B
Text
Raw Normal View History

import { Type } from "./types"
import { Diagnostic } from "./diagnostics"
import { Package } from "./common"
import { TextSpan } from "./text"
export function setParents(node: Syntax): void;
export type SyntaxRange = [Syntax, Syntax];
export function isSyntax(value: any): value is Syntax;
2020-05-26 20:59:44 +02:00
interface SyntaxBase {
id: number;
2020-05-26 20:59:44 +02:00
kind: SyntaxKind;
type?: Type;
errors: Diagnostic[]
parentNode: Syntax | null;
span: TextSpan | null;
2020-05-26 20:59:44 +02:00
visit(visitors: NodeVisitor[]): void;
preorder(): IterableIterator<Syntax>;
2020-05-26 20:59:44 +02:00
getParentOfKind<K1 extends SyntaxKind>(kind: K1): ResolveSyntaxKind<K1> | null;
getChildNodes(): IterableIterator<Syntax>,
findAllChildrenOfKind<K1 extends SyntaxKind>(kind: K1): IterableIterator<ResolveSyntaxKind<K1>>;
}
export type ResolveSyntaxKind<K extends SyntaxKind> = Extract<Syntax, { kind: K }>;