@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
19 lines (18 loc) • 956 B
TypeScript
import type { AstIdMap } from './decorate';
import type { DataflowGraph } from '../../../../../dataflow/graph/graph';
/** The type of the id assigned to each node. Branded to avoid problematic usages with other string or numeric types. */
export type NodeId<T extends string | number = string | number> = T & {
__brand?: 'node-id';
};
/** used so that we do not have to store strings for the default numeric ids */
export declare function normalizeIdToNumberIfPossible(id: NodeId): NodeId;
/**
* Recovers the lexeme of a {@link RNode|node} from its id in the {@link AstIdMap|id map}.
*
* @see {@link recoverContent} - to recover the content of a node
*/
export declare function recoverName(id: NodeId, idMap?: AstIdMap): string | undefined;
/**
* Recovers the content of a {@link RNode|node} from its id in the {@link DataflowGraph|dataflow graph}.
*/
export declare function recoverContent(id: NodeId, graph: DataflowGraph): string | undefined;