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 { Package } from "./common"
|
||||
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;
|
||||
|
||||
interface SyntaxBase {
|
||||
id: number;
|
||||
kind: SyntaxKind;
|
||||
type?: TypeRef;
|
||||
type?: Type;
|
||||
errors: Diagnostic[]
|
||||
parentNode: Syntax | null;
|
||||
span: TextSpan | null;
|
||||
|
|
|
@ -103,7 +103,7 @@ class SyntaxBase {
|
|||
export function isSyntax(value) {
|
||||
return typeof value === 'object'
|
||||
&& value !== null
|
||||
&& value.__NODE_TYPE !== undefined;
|
||||
&& value instanceof SyntaxBase;
|
||||
}
|
||||
|
||||
export function setParents(node, parentNode = null) {
|
||||
|
|
Loading…
Reference in a new issue