UNPKG

@eagleoutice/flowr-dev

Version:

Static Dataflow Analyzer and Program Slicer for the R Programming Language

40 lines (39 loc) 2.65 kB
import type { DataflowProcessorInformation } from '../../../../../processor'; import type { DataflowInformation } from '../../../../../info'; import { type PotentiallyEmptyRArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call'; import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate'; import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol'; import type { NodeId } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id'; import type { MergeableRecord } from '../../../../../../util/objects'; import { type Identifier } from '../../../../../environments/identifier'; import type { RNode } from '../../../../../../r-bridge/lang-4.x/ast/model/model'; /** the function reference extracted from an argument passed to a higher-order call */ export interface ResolvedFunctionArgument { readonly functionId: NodeId; readonly functionName: Identifier; readonly anonymous: boolean; readonly asString: boolean; } /** Resolve the function an argument stands for: a string literal, a symbol, or an inline definition; `undefined` if none. */ export declare function resolveFunctionArgument<OtherInfo>(val: RNode<OtherInfo & ParentInformation>, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, opts: { readonly unquoteFunction?: boolean; readonly resolveValue?: boolean; }): ResolvedFunctionArgument | undefined; export interface BuiltInApplyConfiguration extends MergeableRecord { /** the 0-based index of the argument which is the actual function passed, defaults to 1 */ readonly indexOfFunction?: number; /** does the argument have a name that it can be given by as well? */ readonly nameOfFunctionArgument?: string; /** Should we unquote the function if it is given as a string? */ readonly unquoteFunction?: boolean; /** Should the function be resolved in the global environment? */ readonly resolveInEnvironment?: 'global' | 'local'; /** Should the value of the function be resolved? */ readonly resolveValue?: boolean; /** the call reaches beyond what we can see even when the callee resolves, like `rlang::exec` */ readonly hasUnknownSideEffects?: boolean; } /** * Process an apply call like `vapply` or `mapply`. */ export declare function processApply<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, config: BuiltInApplyConfiguration): DataflowInformation;