ConstReadonlyargumentRoles: (The roles of several definitions' formals, sharing the built-in lookups.
Readonlycall: {What one call of a function means: what flowR states about it, how R binds its arguments, and which of them it does not simply evaluate.
Readonlyargument: {The same as FunctionSemantics.call.props, for one argument.
Readonlymask: (names: readonly (...)[]) => numberThe mask the given ArgProp member names stand for; see maskOfNames.
Readonlynames: Readonly<Record<(...), (...)>>the ArgProp bit to its name, in ascending bit order
Readonlywords: (props: (...) | (...)) => (...)[]What an argument is used for, as words; see wordsOf.
Readonlydeferred: {The ones it evaluates at a time flowR cannot pin down.
The reads that may be the one forcing binding: every read of it that no other read always precedes,
since an earlier read would already have forced it and cached the value.
Where each name is bound and read, built once and shared by every deferred expression in the graph.
Links the expression rooted at expr to the bindings it may meet when it is evaluated. Given the reads
that may force it, control flow rules out what no force can reach; without them every binding stays a
candidate.
Optionalforces: ForceSitesLinks the writes an expression performs to the uses that may observe them, for a call evaluating the
expression at a point control flow can pin down (eval). The reads are settled by the evaluating call
itself, against the environment in effect there, so only this direction is left open.
Optionalcfg: ControlFlowGraph<(...)>Readonlymatch: {R's argument matching -- exact, then partial, then positional.
Find all arguments of a function call that have a given argument property using the function signature.
The function arguments as the graph holds them.
The function signature whose names are the targets.
The ArgProps the function arguments should have.
The value ids of the matching arguments.
The formal names a call binds against, whichever of flowR's sources knows them; see formalsOf.
Binds a call's graph args to the params of the definition it calls and mutates graph, adding an
EdgeType.DefinesOnCall and a EdgeType.DefinedByOnCall edge per bound pair. It is the only
member here that writes anything.
The arguments as the graph holds them.
The parameters of the called definition, in order.
The graph the edges are added to.
The argument id to parameter id mapping the edges were drawn for.
Binds a call's arguments to the formals of whatever it calls, looking the formals up itself. It takes them
from the RFunctionDefinition the call resolves to in user code, and from the database signature at
the version the analysis assumes otherwise (see SignatureDb). undefined when it resolves to
neither, so fall back to a hardcoded list then.
graph is what says which definition a name reaches here, because scoping, shadowing and control flow
decide that and a name alone cannot. It therefore needs a finished graph rather than one under
construction. Cost is one Dataflow.origin lookup plus, for a package call, decoding that one
function.
The call whose arguments are to be bound.
The finished graph the call was analyzed into.
The analyzer context the database and the assumed versions come from.
Per formal name the argument bound to it, undefined if the formals could not be found.
Binds a call's AST args to the formal paramNames. An empty argument (f(1, ,3)) takes its formal but
never appears here. Arguments falling to ... share that key, so only the last survives; use
MatchArgs.toSpec to keep them all.
The arguments as they stand in the normalized AST.
The formals of the called function, in order.
Per formal name the argument bound to it.
RFunctionCall.matchArgsToParams - the implementation, kept there to avoid a load-time import cycle.
Binds a call's graph args against the formals, reading nothing from the graph, so it also serves a
function whose parameters are not in the AST at all. Name '...' in a specification unless the function
really has none, as that is what collects arguments finding no formal of their own.
The arguments as the graph holds them, see convertFnArguments.
Formal name to the target it stands for, or a signature whose names are the targets.
Per target the ids bound to it.
Readonlynse: {The arguments a call does not evaluate.
Drops the mask mark from names the caller binds to a value: while filter(d, k) is processed k has no
read yet. A name bound to a function keeps its mark, as filter(d, id > 2) next to id <- function(...)
still means the column. Hands back the masking call and the names it just unmarked, undefined when
name does not mask at all, so linkMasksToData need not ask a second time.
Links every name the data masks of calls supply to the data it comes from: id in filter(df, id > 2)
is a column of df, so it reads df. Run once every mark has settled, as adding the read makes
suppliedByMask false for the name; a call whose first argument is masked too has no data to link
against.
Whether the vertex is a name a data mask may supply, which is every name appearing in the mask.
Whether id is a name a data mask supplied, which the mark the masking call carries is what records.
Unlike suppliedByMask this survives linkMasksToData, so ask this one after the dataflow
is complete and that one while a call is still being processed.
Whether id is a name the data mask supplies, i.e. a use the caller does not bind itself.
Drops the non-standard-evaluation mark from the outgoing edges of id that which accepts, and reports them.
The ids an Unquote escape hands back to standard evaluation, the markers themselves excluded.
Readonlyprops: {What flowR states a call does (it reads a file, it asks the user, ...).
Keep only the properties in the stated properties that are in the property selector.
Whether stated properties carry every property of a selector.
Whether stated properties carry at least one property of a selector, or state anything about their behavior at all. ProvenanceProps do not count for the latter: where a definition comes from is not something it does, and a caller asking "does this state what it does" must not be answered by it.
Optionalselector: PropSelectorChecks whether a PropSelector is a bitfield of CallProps.
Checks whether a PropSelector is a SemanticCallTag.
Joins the CallProps and SemanticCallTags of two stated properties
Transforms a property selector into a unique string identifier.
Gets the string labels for stated properties CallPropLabels.
The PropMask the given CallProp/SemanticCallTag member names stand for, unknown ones ignored.
Gets the property names for a property selector.
The CallPropLabels words for a bare CallProps bitfield, as inferred functions carry one.
Readonlyquoted: {The expressions it quotes instead.
The expressions a capturing call holds on to.
ReadonlyevaluateIn: <Info>(Links every name in expr against environment and hands back what stays unresolved.
The finishing pass over a complete graph: it settles what a call really evaluates, which the call itself
could not know. A capture reaches the eval that forces it, a promise reaches the bindings it may be
forced against, and a masked name the caller binds after all loses its mark.
Every expression the value at id may hold, with the call that captured it. Several is normal.
Readonlysignature: {The formals a built-in declares.
Readonlyevery: FnSigA signature saying only that the call evaluates every argument; see ForcingEvery.
Readonlyforced: (this: void, sig: (...) | (...), count: number) => (...) | (...)Which of the first count arguments a call evaluates; see forcedArgs.
Readonlylayout: (this: void, sig: FnSig) => SigLayoutThe positional view of a signature; see sigLayout.
Readonlyonly: (this: void, index: number, name: string) => FnSigA signature saying only that the call evaluates one argument; see forcingOnly.
ReadonlyposWith: (this: void, layout: SigLayout, count: number, prop: number) => (...)[]The positions carrying any of the given roles; see argsWith.
ReadonlypropAt: (this: void, __namedParameters: SigLayout, index: number) => numberThe roles of the argument at a position; see argProp.
Readonlyunsupported: {The calls that change the environment in ways flowR cannot follow.
Checks whether a data flow graph vertex represents an unsupported (environment-changing) function call (e.g. eval, load, attach, rm, ...)
Readonlyclasses: {What the project declares as a class, and how those relate.
ReadonlyargFor: <Info>(The argument a class-declaring built-in's config names.
Readonlydeclared: (graph: DataflowGraph) => Map<string, DeclaredClass>Every class the graph declares, keyed by name.
Whether the vertex is a call that declares a class; its classDecl is then set.
Readonlyof: <Info>(The declaration a call states.
ReadonlysuperOf: (name: string, classes: ReadonlyMap<string, ClassDeclaration>) => string[]The transitive superclasses of a declared class.
ReadonlytoSig: (The signature-database records for a set of declared classes.
Readonlyexceptions: (The exceptions a definition may raise.
ReadonlyframeReflection: (The reflective argument bits of one definition.
ReadonlyisHigherOrder: (Whether one definition is higher-order, i.e. whether it calls what it is handed.
Readonlyname: "FunctionSemantics"Readonlyprops: (What several definitions and their formals do.
Readonlystrictness: (The strictness of several definitions, sharing the work between them.
FunctionSemantics.props(definitions, graph); // what the definitions do with what they get
FunctionSemantics.exceptions(definition, callGraph); // what they may raise
FunctionSemantics.strictness(definitions, graph); // which formals they force
FunctionSemantics.isHigherOrder(definition, graph); // whether they call what they are handed
FunctionSemantics.argumentRoles(definitions, graph); // what each formal is used as
FunctionSemantics.classes.declared(graph); // the classes the project declares
FunctionSemantics.call.props.hasAny(stated, CallProp.Scope); // what flowR states one call does
FunctionSemantics.call.match(call, formals); // how R binds its arguments
The one helper to ask what a function does: what it makes of its arguments, what it may raise, which formals it forces, and what it declares as a class. It replaces the seven single-purpose helper objects that used to sit one per file under
src/dataflow/fn/.