treegen: Fix snippets

This commit is contained in:
Sam Vervaeck 2020-05-30 16:06:59 +02:00
parent 87717b7156
commit 02e7cb5664
2 changed files with 5 additions and 6 deletions

View file

@ -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;

View file

@ -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) {