@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
33 lines (32 loc) • 1.49 kB
TypeScript
/**
* This module has one goal (and is to be rewritten soon to achieve that goal,
* as the file itself is way too long). See {@link reconstructToCode}.
* @module
*/
import type { NormalizedAst } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
import { type AutoSelectPredicate } from './auto-select/auto-select-defaults';
interface Selection {
/**
* The set of node ids to be reconstructed.
*/
nodes: ReadonlySet<NodeId>;
/**
* @see {@link ReconstructRequiredInput#reconstructFiles}
*/
reconstructFiles?: 'all' | number[];
}
export declare const reconstructLogger: import("tslog").Logger<import("tslog").ILogObj>;
export interface ReconstructionResult {
/** Returns the reconstructed code as string or array of code reconstructions (corresponding to the desired file indices in the {@link Selection}) */
code: string | string[];
/** number of lines that contain nodes that triggered the `autoSelectIf` predicate {@link reconstructToCode} */
linesWithAutoSelected: number;
}
export declare function reconstructToCode(ast: NormalizedAst, selection: Selection & {
reconstructFiles?: [number] | undefined;
}, autoSelectIf?: AutoSelectPredicate): ReconstructionResult & {
code: string;
};
export declare function reconstructToCode(ast: NormalizedAst, selection: Selection, autoSelectIf?: AutoSelectPredicate): ReconstructionResult;
export {};