Interface Reference<T>

A cross-reference in the AST. Cross-references may or may not be successfully resolved.

interface Reference<T> {
    $nodeDescription?: AstNodeDescription;
    $refNode?: CstNode;
    $refText: string;
    error?: LinkingError;
    ref?: T;
}

Type Parameters

Properties

$nodeDescription?: AstNodeDescription

The node description for the AstNode returned by ref

$refNode?: CstNode

The CST node from which the reference was parsed

$refText: string

The actual text used to look up in the surrounding scope

error?: LinkingError

If any problem occurred while resolving the reference, it is described by this property.

ref?: T

The target AST node of this reference. Accessing this property may trigger cross-reference resolution by the Linker in case it has not been done yet. If the reference cannot be resolved, the value is undefined.