treegen: Fix snippets
This commit is contained in:
parent
87717b7156
commit
02e7cb5664
2 changed files with 5 additions and 6 deletions
9
treegen/snippets/ast-before.d.ts
vendored
9
treegen/snippets/ast-before.d.ts
vendored
|
@ -1,19 +1,18 @@
|
||||||
|
|
||||||
import { TypeRef } from "./types"
|
|
||||||
import { Diagnostic } from "./diagnostics"
|
import { Diagnostic } from "./diagnostics"
|
||||||
import { Package } from "./common"
|
|
||||||
import { TextSpan } from "./text"
|
import { TextSpan } from "./text"
|
||||||
|
|
||||||
export function setParents(node: Syntax): void;
|
import { Package } from "./package"
|
||||||
|
import { Type } from "./types"
|
||||||
|
|
||||||
export type SyntaxRange = [Syntax, Syntax];
|
export function setParents(node: Syntax): void;
|
||||||
|
|
||||||
export function isSyntax(value: any): value is Syntax;
|
export function isSyntax(value: any): value is Syntax;
|
||||||
|
|
||||||
interface SyntaxBase {
|
interface SyntaxBase {
|
||||||
id: number;
|
id: number;
|
||||||
kind: SyntaxKind;
|
kind: SyntaxKind;
|
||||||
type?: TypeRef;
|
type?: Type;
|
||||||
errors: Diagnostic[]
|
errors: Diagnostic[]
|
||||||
parentNode: Syntax | null;
|
parentNode: Syntax | null;
|
||||||
span: TextSpan | null;
|
span: TextSpan | null;
|
||||||
|
|
|
@ -103,7 +103,7 @@ class SyntaxBase {
|
||||||
export function isSyntax(value) {
|
export function isSyntax(value) {
|
||||||
return typeof value === 'object'
|
return typeof value === 'object'
|
||||||
&& value !== null
|
&& value !== null
|
||||||
&& value.__NODE_TYPE !== undefined;
|
&& value instanceof SyntaxBase;
|
||||||
}
|
}
|
||||||
|
|
||||||
export function setParents(node, parentNode = null) {
|
export function setParents(node, parentNode = null) {
|
||||||
|
|
Loading…
Reference in a new issue