UNPKG

@eagleoutice/flowr

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

25 lines (24 loc) 1.21 kB
import Parser from 'web-tree-sitter'; import type { RParseRequest } from '../../retriever'; import type { SyncParser } from '../../parser'; export declare const DEFAULT_TREE_SITTER_R_WASM_PATH: string; export declare const DEFAULT_TREE_SITTER_WASM_PATH: string; /** * Synchronous and (way) faster alternative to the {@link RShell} using tree-sitter. */ export declare class TreeSitterExecutor implements SyncParser<Parser.Tree> { readonly name = "tree-sitter"; readonly parser: Parser; private static language; /** * Initializes the underlying tree-sitter parser. This only needs to be called once globally. * @param overrideWasmPath - The path to the tree-sitter-r wasm file, which takes precedence over the config and default paths if set. * @param overrideTreeSitterWasmPath - The path to the tree-sitter wasm file, which takes precedence over the config and default paths if set. */ static initTreeSitter(overrideWasmPath?: string, overrideTreeSitterWasmPath?: string): Promise<void>; constructor(); rVersion(): Promise<string | 'unknown' | 'none'>; treeSitterVersion(): number; parse(request: RParseRequest): Parser.Tree; close(): void; }