@eagleoutice/flowr
Version:
Static Dataflow Analyzer and Program Slicer for the R Programming Language
23 lines (22 loc) • 976 B
TypeScript
import type { Tree } from 'web-tree-sitter';
import type { RProject } from '../ast/model/nodes/r-project';
import type { ParseStepOutputSingleFile } from '../../parser';
export interface TreeSitterInfo {
/** id of the tree-sitter node this AST node was created from, used for traceability and linking back to tree-sitter nodes */
tsId: number;
}
/**
* @param tree - The tree to normalize
* @param lax - Whether to use lax parsing (i.e., ignore errors) or strict parsing (i.e., fail on errors)
*/
export declare function normalizeTreeSitterTreeToAst(tree: ParseStepOutputSingleFile<Tree>[], lax?: boolean): RProject<TreeSitterInfo>;
/**
* Globally switch to lax parsing mode for tree-sitter normalization
* @see {@link makeTreeSitterStrict}
*/
export declare function makeTreeSitterLax(): void;
/**
* Globally switch to strict parsing mode for tree-sitter normalization
* @see {@link makeTreeSitterLax}
*/
export declare function makeTreeSitterStrict(): void;