@eagleoutice/flowr 2.13.2 → 2.13.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +45 -43
- package/abstract-interpretation/absint-visitor.js +2 -2
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +1 -0
- package/abstract-interpretation/data-frame/mappers/arguments.js +2 -2
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +1 -1
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +3 -0
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +1 -1
- package/abstract-interpretation/domains/state-domain-like.d.ts +1 -1
- package/abstract-interpretation/unsupported-functions.js +1 -1
- package/config.d.ts +8 -0
- package/config.js +9 -1
- package/control-flow/cfg-dead-code.js +72 -11
- package/control-flow/control-flow-graph.js +2 -1
- package/control-flow/extract-cfg.js +85 -8
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +2 -0
- package/core/steps/all/core/11-normalize-tree-sitter.d.ts +1 -1
- package/dataflow/environments/append.d.ts +1 -1
- package/dataflow/environments/built-in-proc-name.d.ts +4 -0
- package/dataflow/environments/built-in-proc-name.js +4 -0
- package/dataflow/environments/built-in.d.ts +5 -1
- package/dataflow/environments/built-in.js +5 -1
- package/dataflow/environments/clone.d.ts +1 -1
- package/dataflow/environments/default-builtin-config.d.ts +59 -4
- package/dataflow/environments/default-builtin-config.js +23 -11
- package/dataflow/environments/environment.d.ts +28 -4
- package/dataflow/environments/environment.js +66 -11
- package/dataflow/environments/identifier.d.ts +1 -0
- package/dataflow/environments/overwrite.d.ts +1 -1
- package/dataflow/eval/resolve/alias-tracking.d.ts +3 -1
- package/dataflow/eval/resolve/alias-tracking.js +8 -1
- package/dataflow/eval/resolve/resolve.d.ts +14 -0
- package/dataflow/eval/resolve/resolve.js +47 -0
- package/dataflow/fn/higher-order-function.js +3 -3
- package/dataflow/fn/recursive-function.js +1 -1
- package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
- package/dataflow/graph/df-helper.js +1 -1
- package/dataflow/graph/vertex.d.ts +32 -25
- package/dataflow/graph/vertex.js +40 -36
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +14 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +28 -29
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +41 -48
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +14 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +45 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +14 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +80 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +63 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +63 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +29 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +15 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +35 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +9 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +55 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +5 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.d.ts +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +24 -0
- package/dataflow/internal/process/functions/process-parameter.js +2 -1
- package/documentation/doc-readme.js +14 -12
- package/documentation/doc-util/doc-normalized-ast.d.ts +1 -1
- package/documentation/wiki-dataflow-graph.js +4 -24
- package/documentation/wiki-query.js +47 -0
- package/documentation/wiki-signature-database.js +3 -2
- package/linter/rules/absolute-path.js +1 -1
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/function-finder-util.js +1 -1
- package/linter/rules/no-leaked-credentials.js +1 -1
- package/linter/rules/undefined-symbol-util.js +3 -1
- package/linter/rules/undefined-symbol.js +4 -5
- package/linter/rules/unused-definition.js +15 -10
- package/linter/rules/useless-loop.js +1 -1
- package/package.json +21 -9
- package/project/context/flowr-analyzer-context.d.ts +4 -4
- package/project/context/flowr-analyzer-context.js +3 -3
- package/project/context/flowr-analyzer-dependencies-context.d.ts +11 -5
- package/project/context/flowr-analyzer-dependencies-context.js +8 -3
- package/project/context/flowr-analyzer-meta-context.d.ts +1 -0
- package/project/dependency-version-space.d.ts +118 -26
- package/project/dependency-version-space.js +343 -87
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +4 -0
- package/project/plugins/file-plugins/files/flowr-description-file.js +8 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.js +27 -25
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-sweave-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +2 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +4 -4
- package/project/plugins/package-version-plugins/package.d.ts +27 -10
- package/project/plugins/package-version-plugins/package.js +50 -25
- package/project/sigdb/reader.d.ts +26 -16
- package/project/sigdb/reader.js +52 -21
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +1 -1
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +2 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.js +2 -2
- package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -1
- package/queries/catalog/dependencies-query/function-info/write-functions.js +23 -24
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +1 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +39 -77
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +12 -0
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +53 -23
- package/queries/catalog/input-sources-query/input-source-functions.d.ts +14 -0
- package/queries/catalog/input-sources-query/input-source-functions.js +109 -20
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +45 -4
- package/queries/catalog/input-sources-query/input-sources-query-format.js +22 -3
- package/queries/catalog/input-sources-query/input-types.d.ts +58 -0
- package/queries/catalog/input-sources-query/input-types.js +64 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +76 -53
- package/queries/catalog/input-sources-query/simple-input-classifier.js +358 -101
- package/queries/catalog/project-query/project-query-executor.js +1 -1
- package/queries/catalog/signature-query/signature-query-executor.d.ts +7 -1
- package/queries/catalog/signature-query/signature-query-executor.js +112 -39
- package/queries/catalog/signature-query/signature-query-format.d.ts +5 -1
- package/queries/catalog/signature-query/signature-query-format.js +1 -1
- package/queries/catalog/signature-query/signature-query-render.js +8 -3
- package/r-bridge/data/data.d.ts +2 -2
- package/r-bridge/data/data.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/json/format.js +1 -1
- package/r-bridge/retriever.d.ts +1 -1
- package/reconstruct/inline/source-inline-map.js +1 -1
- package/search/flowr-search-printer.js +10 -8
- package/slicing/static/static-slicer.d.ts +2 -2
- package/util/mermaid/dfg.js +1 -1
- package/util/objects.js +6 -4
- package/util/r-base-packages.d.ts +2 -0
- package/util/r-base-packages.js +3 -0
- package/util/r-license.js +1 -4
- package/util/r-version.d.ts +12 -0
- package/util/r-version.js +16 -0
- package/util/range.d.ts +6 -2
- package/util/range.js +33 -15
- package/util/version.js +1 -1
|
@@ -1,60 +1,62 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
2
|
+
import { InputTraceType, InputType } from './input-types';
|
|
3
|
+
export { InputTraceType, InputType } from './input-types';
|
|
2
4
|
import type { DataflowGraph } from '../../../dataflow/graph/graph';
|
|
3
5
|
import type { MergeableRecord } from '../../../util/objects';
|
|
4
6
|
import { Identifier } from '../../../dataflow/environments/identifier';
|
|
5
7
|
import type { FlowrSearchLike } from '../../../search/flowr-search-builder';
|
|
6
8
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
9
|
+
* An object that a framework hands to its users without any visible definition, like the `input` of a
|
|
10
|
+
* shiny server function. Reads of such an object (and of its fields) are classified as its given type,
|
|
11
|
+
* so traces link up to the framework instead of stopping at an opaque parameter.
|
|
12
|
+
*/
|
|
13
|
+
export interface LinkedInputObject {
|
|
14
|
+
/** the name of the object, e.g. `input` */
|
|
15
|
+
readonly name: string;
|
|
16
|
+
/** how reads of the object (or of its fields) are to be classified */
|
|
17
|
+
readonly type: InputType;
|
|
18
|
+
/**
|
|
19
|
+
* If given, the object only counts as linked if the function binding it declares all of these parameters as well
|
|
20
|
+
* (e.g., shiny's `function(input, output, session)`). Without this, every `input` would be treated as the framework's.
|
|
21
|
+
*/
|
|
22
|
+
readonly withParams?: readonly string[];
|
|
23
|
+
/** the package that has to be attached for this object to exist, e.g. `shiny` */
|
|
24
|
+
readonly requires?: string;
|
|
25
|
+
/** if given, only these fields are inputs (`session$clientData` is, `session$userData` is not) and the object itself is none */
|
|
26
|
+
readonly fields?: readonly string[];
|
|
27
|
+
/** how the framework declares the entries of this object, so a read of `input$n` links to the `textInput("n", …)` defining it */
|
|
28
|
+
readonly declaredBy?: LinkedInputDeclaration;
|
|
29
|
+
}
|
|
30
|
+
/** The calls that declare the entries of a {@link LinkedInputObject}, and where they carry the entry's name. */
|
|
31
|
+
export interface LinkedInputDeclaration {
|
|
32
|
+
/** the declaring calls, e.g. shiny's `textInput`, `selectInput`, … */
|
|
33
|
+
readonly calls: readonly Identifier[];
|
|
34
|
+
/** the name of the argument holding the entry's name */
|
|
35
|
+
readonly argName: string;
|
|
36
|
+
/** the index of that argument when it is passed positionally */
|
|
37
|
+
readonly argIdx: number;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A call a framework is given a function through, binding its parameters *by position* - which is how R passes
|
|
41
|
+
* them, so this catches a `shinyApp(ui, function(i, o, s))` that no name-based rule can.
|
|
24
42
|
*/
|
|
25
|
-
export
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
/** Calls to .C / Fortran interfaces (foreign function interfaces) */
|
|
35
|
-
Ffi = "ffi",
|
|
36
|
-
/** Language objects (quote/substitute/etc.) */
|
|
37
|
-
Lang = "lang",
|
|
38
|
-
/** Global options / option accessors (options, getOption) */
|
|
39
|
-
Options = "options",
|
|
40
|
-
/** Interactive user input (file choosers, prompts, dialogs, menu selections) */
|
|
41
|
-
User = "user",
|
|
42
|
-
Constant = "const",
|
|
43
|
-
/** Read from environment/call scope */
|
|
44
|
-
Scope = "scope",
|
|
45
|
-
/** Pure calculations from constants that lead to a constant */
|
|
46
|
-
DerivedConstant = "dconst",
|
|
47
|
-
Unknown = "unknown"
|
|
43
|
+
export interface LinkedInputEntryPoint {
|
|
44
|
+
/** the call taking the function, e.g. `shiny::shinyApp` */
|
|
45
|
+
readonly call: Identifier;
|
|
46
|
+
/** the name of the argument holding the function */
|
|
47
|
+
readonly argName: string;
|
|
48
|
+
/** the index of that argument when it is passed positionally */
|
|
49
|
+
readonly argIdx: number;
|
|
50
|
+
/** which {@link LinkedInputObject} the framework binds to each parameter, by position; `undefined` leaves one alone */
|
|
51
|
+
readonly params: readonly (string | undefined)[];
|
|
48
52
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
/**
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
|
|
56
|
-
/** Not fully known origin */
|
|
57
|
-
Unknown = "unknown"
|
|
53
|
+
/** A function whose result is bounded by one argument (e.g. `match.arg` by its `choices`), classified by that argument alone. */
|
|
54
|
+
export interface NarrowingFunction {
|
|
55
|
+
readonly call: Identifier;
|
|
56
|
+
/** the name of the bounding argument; omit (with `argIdx`) for a result that is always a bounded, content-independent value */
|
|
57
|
+
readonly argName?: string;
|
|
58
|
+
/** the index of the bounding argument; omit (with `argName`) for an always-`DerivedConstant` result */
|
|
59
|
+
readonly argIdx?: number;
|
|
58
60
|
}
|
|
59
61
|
/**
|
|
60
62
|
* Scalar R constant values representable in TypeScript.
|
|
@@ -72,10 +74,15 @@ export interface InputSource extends MergeableRecord {
|
|
|
72
74
|
trace: InputTraceType;
|
|
73
75
|
/** if the trace is affected by control dependencies, they are classified too, this is a duplicate free array */
|
|
74
76
|
cds?: InputType[];
|
|
75
|
-
/**
|
|
77
|
+
/**
|
|
78
|
+
* Argument name when this source originates from a named argument of the criterion function call,
|
|
79
|
+
* or the accessed field when it originates from a {@link LinkedInputObject} (e.g. `n` for `input$n`).
|
|
80
|
+
*/
|
|
76
81
|
name?: string;
|
|
77
82
|
/** the concrete scalar value when the source is a constant or a pure alias of one */
|
|
78
83
|
value?: ConstantValue;
|
|
84
|
+
/** where the framework entry this source reads is declared, e.g. the `textInput("n", …)` behind an `input$n` */
|
|
85
|
+
declaredAt?: NodeId[];
|
|
79
86
|
}
|
|
80
87
|
/**
|
|
81
88
|
* Map of input sources, keyed by the node id of the input source. Each input source is classified with an {@link InputSource} object.
|
|
@@ -94,6 +101,21 @@ export interface InputClassifierConfig<Functions extends InputClassifierFunction
|
|
|
94
101
|
* Functions which are considered to be pure (i.e., deterministic, trusted, safe, idempotent on the lub of the input types)
|
|
95
102
|
*/
|
|
96
103
|
[InputTraceType.Pure]?: Functions;
|
|
104
|
+
/**
|
|
105
|
+
* Objects provided by a framework rather than by the code itself, like shiny's `input`.
|
|
106
|
+
* @see {@link LinkedInputObject}
|
|
107
|
+
*/
|
|
108
|
+
linkedObjects?: readonly LinkedInputObject[];
|
|
109
|
+
/**
|
|
110
|
+
* Calls that hand a function to a framework, which then binds {@link linkedObjects} to its parameters by position.
|
|
111
|
+
* @see {@link LinkedInputEntryPoint}
|
|
112
|
+
*/
|
|
113
|
+
linkedEntryPoints?: readonly LinkedInputEntryPoint[];
|
|
114
|
+
/**
|
|
115
|
+
* Functions whose result is bounded by one of their arguments (classified by that argument alone).
|
|
116
|
+
* @see {@link NarrowingFunction}
|
|
117
|
+
*/
|
|
118
|
+
narrowing?: readonly NarrowingFunction[];
|
|
97
119
|
}
|
|
98
120
|
/**
|
|
99
121
|
* Takes the given id which is expected to either be:
|
|
@@ -101,6 +123,7 @@ export interface InputClassifierConfig<Functions extends InputClassifierFunction
|
|
|
101
123
|
* - anything else - in that case the node itself is considered as an "input" - please note that in these scenarios the *return* value will only contain one mapping - that for the id you passed in.
|
|
102
124
|
*
|
|
103
125
|
* This method traces the dependencies in the dataflow graph using the specification of functions passed in.
|
|
104
|
-
* For the scope escape analysis, pass on the full, non-reduced DFG as `fullDfg
|
|
126
|
+
* For the scope escape analysis, pass on the full, non-reduced DFG as `fullDfg`, and the packages attached in the
|
|
127
|
+
* program as `packages` so that bare calls only match the entries of packages that are actually in scope.
|
|
105
128
|
*/
|
|
106
|
-
export declare function classifyInput(id: NodeId, dfg: DataflowGraph, config: InputClassifierConfig<InputClassifierFunctionIdentifiers>, fullDfg?: DataflowGraph): InputSources;
|
|
129
|
+
export declare function classifyInput(id: NodeId, dfg: DataflowGraph, config: InputClassifierConfig<InputClassifierFunctionIdentifiers>, fullDfg?: DataflowGraph, packages?: ReadonlySet<string>): InputSources;
|