UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

38 lines (37 loc) 1.78 kB
import type Parser from 'web-tree-sitter'; import type { InvalidationEvent, InvalidationEventReceiver } from '../cache/flowr-cache'; import type { FlowrAnalyzerContext } from './flowr-analyzer-context'; import type { FilePath } from './flowr-file'; import type { ParseStepOutput } from '../../r-bridge/parser'; export interface ReadOnlyFlowrAnalyzerIncrementalAnalysisContext { /** * The name of this context. */ readonly name: string; getOldParseResultOf(filePath: FilePath): Parser.Tree | undefined; getOldContentOf(filePath: FilePath): string | undefined; } /** * Information to carry over for future incremental builds */ export declare class FlowrAnalyzerIncrementalAnalysisContext implements ReadOnlyFlowrAnalyzerIncrementalAnalysisContext, InvalidationEventReceiver { readonly name = "flowr-analyzer-incremental-analysis-context"; private readonly context; /** * The files that have been changed since the last analysis mapping to their old content. */ private changedFilesWithOldContent; private oldParseResults; private readonly lastKnownMtime; constructor(context: FlowrAnalyzerContext); reset(): void; handleFileInvalidate(filePath: FilePath, oldContent: string | undefined): void; handleShouldReparse(filePath: FilePath, ctx: FlowrAnalyzerContext): boolean; receive(event: InvalidationEvent): void; storeOldParseResults(parseStepOutput: ParseStepOutput<Parser.Tree>): void; getOldParseResultOf(filePath: FilePath): Parser.Tree | undefined; getOldContentOf(filePath: FilePath): string | undefined; deleteOldContentOf(filePath: FilePath): void; getLastKnownMtime(filePath: FilePath): number | undefined; setLastKnownMtime(filePath: FilePath, mtimeMs: number): void; }