@eagleoutice/flowr 2.9.13 → 2.10.1
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 +52 -28
- package/abstract-interpretation/absint-visitor.d.ts +1 -1
- package/abstract-interpretation/absint-visitor.js +20 -20
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -2
- package/benchmark/slicer.d.ts +1 -1
- package/benchmark/slicer.js +7 -5
- package/benchmark/stats/stats.d.ts +2 -2
- package/cli/repl/commands/repl-dataflow.js +5 -5
- package/cli/repl/parser/slice-query-parser.d.ts +3 -3
- package/cli/repl/parser/slice-query-parser.js +2 -2
- package/cli/repl/server/connection.js +2 -2
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/repl/server/messages/message-slice.js +2 -2
- package/config.d.ts +12 -8
- package/config.js +5 -3
- package/control-flow/extract-cfg.js +2 -2
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +43 -43
- package/control-flow/useless-loop.d.ts +1 -1
- package/control-flow/useless-loop.js +3 -3
- package/core/print/dataflow-printer.d.ts +0 -14
- package/core/print/dataflow-printer.js +0 -21
- package/core/steps/all/core/20-dataflow.d.ts +3 -3
- package/core/steps/all/core/20-dataflow.js +3 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +2 -5
- package/core/steps/all/static-slicing/00-slice.js +6 -8
- package/core/steps/pipeline/default-pipelines.d.ts +89 -89
- package/dataflow/environments/built-in-proc-name.d.ts +83 -0
- package/dataflow/environments/built-in-proc-name.js +88 -0
- package/dataflow/environments/built-in.d.ts +1 -83
- package/dataflow/environments/built-in.js +37 -120
- package/dataflow/environments/default-builtin-config.d.ts +1 -1
- package/dataflow/environments/default-builtin-config.js +75 -75
- package/dataflow/environments/identifier.d.ts +5 -0
- package/dataflow/environments/identifier.js +18 -0
- package/dataflow/eval/resolve/resolve.js +2 -2
- package/dataflow/fn/exceptions-of-function.d.ts +1 -1
- package/dataflow/fn/exceptions-of-function.js +2 -2
- package/dataflow/graph/call-graph.d.ts +46 -19
- package/dataflow/graph/call-graph.js +95 -114
- package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
- package/dataflow/graph/dataflowgraph-builder.js +2 -2
- package/dataflow/graph/df-helper.d.ts +133 -0
- package/dataflow/graph/df-helper.js +138 -0
- package/dataflow/graph/diff-dataflow-graph.d.ts +5 -10
- package/dataflow/graph/diff-dataflow-graph.js +3 -28
- package/dataflow/graph/edge.d.ts +1 -0
- package/dataflow/graph/edge.js +1 -0
- package/dataflow/graph/graph-helper.d.ts +60 -0
- package/dataflow/graph/graph-helper.js +128 -0
- package/dataflow/graph/graph.d.ts +19 -3
- package/dataflow/graph/graph.js +32 -5
- package/dataflow/graph/vertex.d.ts +3 -1
- package/dataflow/info.d.ts +14 -4
- package/dataflow/info.js +28 -16
- package/dataflow/internal/linker.d.ts +14 -10
- package/dataflow/internal/linker.js +29 -32
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +8 -7
- 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-eval.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
- 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-s-three-dispatch.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +6 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +2 -2
- package/dataflow/internal/process/functions/call/common.js +2 -1
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -2
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
- package/dataflow/internal/process/functions/process-parameter.js +1 -1
- package/dataflow/internal/process/process-uninteresting-leaf.d.ts +1 -1
- package/dataflow/internal/process/process-uninteresting-leaf.js +1 -1
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-symbol-refs.js +6 -6
- package/documentation/doc-readme.js +2 -1
- package/documentation/doc-util/doc-dfg.d.ts +3 -0
- package/documentation/doc-util/doc-dfg.js +5 -7
- package/documentation/doc-util/doc-normalized-ast.d.ts +0 -6
- package/documentation/doc-util/doc-normalized-ast.js +0 -23
- package/documentation/doc-util/doc-structure.js +3 -3
- package/documentation/doc-util/doc-types.js +3 -3
- package/documentation/wiki-core.js +5 -4
- package/documentation/wiki-dataflow-graph.js +14 -12
- package/documentation/wiki-interface.js +3 -3
- package/documentation/wiki-linter.js +6 -0
- package/documentation/wiki-normalized-ast.js +5 -4
- package/documentation/wiki-query.js +28 -3
- package/linter/linter-rules.d.ts +49 -1
- package/linter/linter-rules.js +5 -1
- package/linter/rules/problematic-eval.d.ts +44 -0
- package/linter/rules/problematic-eval.js +83 -0
- package/linter/rules/seeded-randomness.js +2 -2
- package/linter/rules/stop-with-call-arg.d.ts +35 -0
- package/linter/rules/stop-with-call-arg.js +72 -0
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +7 -7
- package/project/cache/flowr-analyzer-cache.d.ts +1 -1
- package/project/cache/flowr-analyzer-cache.js +1 -1
- package/project/flowr-analyzer-builder.d.ts +3 -0
- package/project/flowr-analyzer.d.ts +1 -1
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +2 -2
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -2
- package/queries/catalog/cluster-query/cluster-query-format.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -2
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -2
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +3 -3
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -2
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +3 -3
- package/queries/catalog/input-sources-query/input-sources-query-executor.d.ts +6 -0
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +66 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +36 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +63 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +90 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.js +308 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +2 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -3
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -2
- package/queries/catalog/location-map-query/location-map-query-executor.js +2 -2
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +3 -3
- package/queries/catalog/provenance-query/provenance-query-executor.d.ts +6 -0
- package/queries/catalog/provenance-query/provenance-query-executor.js +34 -0
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +35 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +62 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
- package/queries/catalog/search-query/search-query-format.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -3
- package/queries/query.d.ts +17 -1
- package/queries/query.js +4 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +9 -0
- package/r-bridge/lang-4.x/ast/model/model.js +10 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +15 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +15 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +29 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +29 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +16 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +2 -0
- package/search/flowr-search-filters.d.ts +1 -1
- package/search/flowr-search-printer.js +3 -3
- package/search/search-executor/search-enrichers.js +2 -2
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/criterion/parse.d.ts +43 -18
- package/slicing/criterion/parse.js +68 -63
- package/slicing/static/slicer-types.d.ts +2 -3
- package/slicing/static/static-slicer.d.ts +3 -4
- package/slicing/static/static-slicer.js +32 -12
- package/util/collections/arrays.d.ts +4 -0
- package/util/collections/arrays.js +7 -0
- package/util/diff.d.ts +2 -2
- package/util/mermaid/ast.js +4 -4
- package/util/mermaid/cfg.js +5 -5
- package/util/mermaid/dfg.d.ts +33 -18
- package/util/mermaid/dfg.js +47 -31
- package/util/mermaid/mermaid.d.ts +57 -12
- package/util/mermaid/mermaid.js +74 -67
- package/util/range.d.ts +8 -0
- package/util/range.js +13 -1
- package/util/slice-direction.d.ts +7 -0
- package/util/slice-direction.js +12 -0
- package/util/version.js +1 -1
- package/dataflow/graph/invert-dfg.d.ts +0 -6
- package/dataflow/graph/invert-dfg.js +0 -20
- package/dataflow/graph/resolve-graph.d.ts +0 -8
- package/dataflow/graph/resolve-graph.js +0 -59
|
@@ -9,8 +9,8 @@ const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
|
9
9
|
const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
10
10
|
const general_1 = require("../../../../../eval/values/general");
|
|
11
11
|
const unknown_side_effect_1 = require("../../../../../graph/unknown-side-effect");
|
|
12
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
13
12
|
const range_1 = require("../../../../../../util/range");
|
|
13
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
14
14
|
/**
|
|
15
15
|
* Process a hook such as `on.exit`
|
|
16
16
|
*/
|
|
@@ -26,9 +26,9 @@ function processRegisterHook(name, args, rootId, data, config) {
|
|
|
26
26
|
}
|
|
27
27
|
params['...'] = '...';
|
|
28
28
|
const argMaps = (0, linker_1.pMatch)((0, common_1.convertFnArguments)(args), params);
|
|
29
|
-
const exprIds = new Set(argMaps.
|
|
30
|
-
const addIds = config.args.add ? new Set(
|
|
31
|
-
const afterIds = config.args.after ? new Set(
|
|
29
|
+
const exprIds = new Set(argMaps.get('expr'));
|
|
30
|
+
const addIds = config.args.add ? new Set(argMaps.get('add')) : new Set();
|
|
31
|
+
const afterIds = config.args.after ? new Set(argMaps.get('after')) : new Set();
|
|
32
32
|
const wrappedFunctions = new Set();
|
|
33
33
|
// we automatically transform the expr to a function definition that takes no arguments
|
|
34
34
|
const transformed = args.map(arg => {
|
|
@@ -60,7 +60,7 @@ function processRegisterHook(name, args, rootId, data, config) {
|
|
|
60
60
|
return arg;
|
|
61
61
|
}
|
|
62
62
|
});
|
|
63
|
-
const res = (0, known_call_handling_1.processKnownFunctionCall)({ name, args: transformed, rootId, data, origin:
|
|
63
|
+
const res = (0, known_call_handling_1.processKnownFunctionCall)({ name, args: transformed, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.RegisterHook });
|
|
64
64
|
const resolveArgs = {
|
|
65
65
|
graph: res.information.graph,
|
|
66
66
|
environment: res.information.environment,
|
|
@@ -8,8 +8,8 @@ const assert_1 = require("../../../../../../util/assert");
|
|
|
8
8
|
const unpack_argument_1 = require("../argument/unpack-argument");
|
|
9
9
|
const r_function_call_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
10
10
|
const logger_1 = require("../../../../../logger");
|
|
11
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
12
11
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
12
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
13
13
|
/**
|
|
14
14
|
* Process a built-in repeat loop function call like `repeat { ... }`.
|
|
15
15
|
* @param name - The name of the function being called.
|
|
@@ -37,7 +37,7 @@ function processRepeatLoop(name, args, rootId, data) {
|
|
|
37
37
|
return d;
|
|
38
38
|
},
|
|
39
39
|
markAsNSE: [0],
|
|
40
|
-
origin:
|
|
40
|
+
origin: built_in_proc_name_1.BuiltInProcName.RepeatLoop
|
|
41
41
|
});
|
|
42
42
|
const body = processedArguments[0];
|
|
43
43
|
(0, assert_1.guard)(body !== undefined, () => `Repeat-Loop ${identifier_1.Identifier.toString(name.content)} has no body, impossible!`);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
2
|
-
import {
|
|
2
|
+
import { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import { type ForceArguments } from '../common';
|
|
4
4
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
@@ -20,6 +20,7 @@ const make_argument_1 = require("../argument/make-argument");
|
|
|
20
20
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
21
21
|
const graph_1 = require("../../../../../graph/graph");
|
|
22
22
|
const range_1 = require("../../../../../../util/range");
|
|
23
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
23
24
|
/**
|
|
24
25
|
* Process a replacement function call like `<-`, `[[<-`, `$<-`, etc.
|
|
25
26
|
* These are automatically created when doing assignments like `x[y] <- value` or in general `fun(x) <- value` will call `fun<- (x, value)`.
|
|
@@ -49,14 +50,14 @@ args, rootId, data, config) {
|
|
|
49
50
|
}, data.completeAst.idMap);
|
|
50
51
|
}
|
|
51
52
|
/* we assign the first argument by the last for now and maybe mark as maybe!, we can keep the symbol as we now know we have an assignment */
|
|
52
|
-
let res = built_in_1.BuiltInProcessorMapper[
|
|
53
|
+
let res = built_in_1.BuiltInProcessorMapper[built_in_proc_name_1.BuiltInProcName.Assignment](name, [targetArg, args.at(-1)], rootId, data, {
|
|
53
54
|
superAssignment: config.assignmentOperator === '<<-',
|
|
54
55
|
makeMaybe: config.makeMaybe,
|
|
55
56
|
canBeReplacement: true
|
|
56
57
|
});
|
|
57
58
|
const createdVert = res.graph.getVertex(rootId);
|
|
58
59
|
if (createdVert?.tag === vertex_1.VertexType.FunctionCall) {
|
|
59
|
-
createdVert.origin = [
|
|
60
|
+
createdVert.origin = [built_in_proc_name_1.BuiltInProcName.Replacement];
|
|
60
61
|
}
|
|
61
62
|
const targetVert = res.graph.getVertex((0, unpack_argument_1.unpackArg)(args[0])?.info.id);
|
|
62
63
|
if (targetVert?.tag === vertex_1.VertexType.VariableDefinition) {
|
|
@@ -65,7 +66,7 @@ args, rootId, data, config) {
|
|
|
65
66
|
const convertedArgs = config.readIndices ? args.slice(1, -1) : (0, built_in_access_1.symbolArgumentsToStrings)(args.slice(1, -1), 0);
|
|
66
67
|
/* now, we soft-inject other arguments, so that calls like `x[y] <- 3` are linked correctly */
|
|
67
68
|
const { callArgs } = (0, common_1.processAllArguments)({
|
|
68
|
-
functionName:
|
|
69
|
+
functionName: info_1.DataflowInformation.initialize(rootId, data),
|
|
69
70
|
args: convertedArgs,
|
|
70
71
|
data,
|
|
71
72
|
functionRootId: rootId,
|
|
@@ -78,7 +79,7 @@ args, rootId, data, config) {
|
|
|
78
79
|
rootId,
|
|
79
80
|
name,
|
|
80
81
|
argumentProcessResult: args.map(a => a === r_function_call_1.EmptyArgument ? undefined : { entryPoint: (0, unpack_argument_1.unpackNonameArg)(a)?.info.id }),
|
|
81
|
-
origin:
|
|
82
|
+
origin: built_in_proc_name_1.BuiltInProcName.Replacement,
|
|
82
83
|
link: config.assignRootId ? { origin: [config.assignRootId] } : undefined
|
|
83
84
|
});
|
|
84
85
|
const firstArg = (0, unpack_argument_1.unpackNonameArg)(args[0]);
|
|
@@ -5,7 +5,7 @@ const known_call_handling_1 = require("../known-call-handling");
|
|
|
5
5
|
const r_function_call_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
6
6
|
const logger_1 = require("../../../../../logger");
|
|
7
7
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
8
|
-
const
|
|
8
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
9
9
|
/**
|
|
10
10
|
* Process an `rm` call.
|
|
11
11
|
*/
|
|
@@ -14,7 +14,7 @@ function processRm(name, args, rootId, data) {
|
|
|
14
14
|
logger_1.dataflowLogger.warn('empty rm, skipping');
|
|
15
15
|
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
|
|
16
16
|
}
|
|
17
|
-
const res = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin:
|
|
17
|
+
const res = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.Rm }).information;
|
|
18
18
|
const names = [];
|
|
19
19
|
for (const arg of args) {
|
|
20
20
|
if (arg === r_function_call_1.EmptyArgument) {
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.S7DispatchSeparator = void 0;
|
|
4
4
|
exports.processS7Dispatch = processS7Dispatch;
|
|
5
5
|
const known_call_handling_1 = require("../known-call-handling");
|
|
6
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
7
6
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
7
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
8
8
|
/** Used to separate S7 dispatch info in identifiers */
|
|
9
9
|
exports.S7DispatchSeparator = '﹕s3﹕';
|
|
10
10
|
/**
|
|
@@ -12,9 +12,9 @@ exports.S7DispatchSeparator = '﹕s3﹕';
|
|
|
12
12
|
*/
|
|
13
13
|
function processS7Dispatch(name, args, rootId, data) {
|
|
14
14
|
if (!('currentS7name' in data) || !Array.isArray(data.currentS7name)) {
|
|
15
|
-
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin:
|
|
15
|
+
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.S7Dispatch }).information;
|
|
16
16
|
}
|
|
17
|
-
const info = (0, known_call_handling_1.processKnownFunctionCall)({ name, forceArgs: 'all', args, rootId, data, origin:
|
|
17
|
+
const info = (0, known_call_handling_1.processKnownFunctionCall)({ name, forceArgs: 'all', args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.S7Dispatch }).information;
|
|
18
18
|
for (const id of data.currentS7name) {
|
|
19
19
|
if (typeof id === 'string') {
|
|
20
20
|
const newIn = info.in.slice();
|
|
@@ -7,7 +7,6 @@ const linker_1 = require("../../../../linker");
|
|
|
7
7
|
const common_1 = require("../common");
|
|
8
8
|
const unpack_argument_1 = require("../argument/unpack-argument");
|
|
9
9
|
const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
10
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
11
10
|
const edge_1 = require("../../../../../graph/edge");
|
|
12
11
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
13
12
|
const assert_1 = require("../../../../../../util/assert");
|
|
@@ -16,6 +15,7 @@ const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
|
16
15
|
const r_value_1 = require("../../../../../eval/values/r-value");
|
|
17
16
|
const vertex_1 = require("../../../../../graph/vertex");
|
|
18
17
|
const range_1 = require("../../../../../../util/range");
|
|
18
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
19
19
|
/**
|
|
20
20
|
* Process an S7 new generic dispatch call like `new_generic` or `setGeneric`.
|
|
21
21
|
*/
|
|
@@ -32,7 +32,7 @@ function processS7NewGeneric(name, args, rootId, data, config) {
|
|
|
32
32
|
}
|
|
33
33
|
params[config.args.fun] = 'fun';
|
|
34
34
|
params['...'] = '...';
|
|
35
|
-
const argMaps = (0, linker_1.
|
|
35
|
+
const argMaps = (0, linker_1.pMatch)((0, common_1.convertFnArguments)(args), params);
|
|
36
36
|
const genName = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('name')?.[0]));
|
|
37
37
|
if (!genName) {
|
|
38
38
|
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
|
|
@@ -60,7 +60,7 @@ function processS7NewGeneric(name, args, rootId, data, config) {
|
|
|
60
60
|
effectiveArgs.push(newFun[0]);
|
|
61
61
|
funArg = newFun[1];
|
|
62
62
|
}
|
|
63
|
-
const info = (0, known_call_handling_1.processKnownFunctionCall)({ name, forceArgs: 'all', args: effectiveArgs, rootId, data, origin:
|
|
63
|
+
const info = (0, known_call_handling_1.processKnownFunctionCall)({ name, forceArgs: 'all', args: effectiveArgs, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.S7NewGeneric }).information;
|
|
64
64
|
info.graph.addEdge(rootId, funArg, edge_1.EdgeType.Returns);
|
|
65
65
|
info.entryPoint = funArg;
|
|
66
66
|
const fArg = info.graph.getVertex(funArg);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../../processor';
|
|
2
|
-
import
|
|
2
|
+
import { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
4
|
import { type RFunctionArgument } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
@@ -5,7 +5,6 @@ const processor_1 = require("../../../../../processor");
|
|
|
5
5
|
const info_1 = require("../../../../../info");
|
|
6
6
|
const known_call_handling_1 = require("../known-call-handling");
|
|
7
7
|
const logger_1 = require("../../../../../logger");
|
|
8
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
9
8
|
const linker_1 = require("../../../../linker");
|
|
10
9
|
const common_1 = require("../common");
|
|
11
10
|
const unpack_argument_1 = require("../argument/unpack-argument");
|
|
@@ -15,6 +14,7 @@ const identifier_1 = require("../../../../../environments/identifier");
|
|
|
15
14
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
16
15
|
const range_1 = require("../../../../../../util/range");
|
|
17
16
|
const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
17
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
18
18
|
/**
|
|
19
19
|
* Process an S3 dispatch call like `UseMethod`.
|
|
20
20
|
*/
|
|
@@ -28,13 +28,13 @@ function processS3Dispatch(name, args, rootId, data, config) {
|
|
|
28
28
|
[config.args.object]: 'object',
|
|
29
29
|
'...': '...'
|
|
30
30
|
};
|
|
31
|
-
const argMaps = (0, linker_1.
|
|
31
|
+
const argMaps = (0, linker_1.pMatch)((0, common_1.convertFnArguments)(args), params);
|
|
32
32
|
const generic = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('generic')?.[0]));
|
|
33
33
|
if (!generic && !config.inferFromClosure) {
|
|
34
34
|
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
|
|
35
35
|
}
|
|
36
36
|
const obj = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('object')?.[0]));
|
|
37
|
-
const dfObj = obj ? (0, processor_1.processDataflowFor)(obj, data) :
|
|
37
|
+
const dfObj = obj ? (0, processor_1.processDataflowFor)(obj, data) : info_1.DataflowInformation.initialize(rootId, data);
|
|
38
38
|
if ((0, info_1.alwaysExits)(dfObj)) {
|
|
39
39
|
(0, common_1.patchFunctionCall)({
|
|
40
40
|
nextGraph: dfObj.graph,
|
|
@@ -42,7 +42,7 @@ function processS3Dispatch(name, args, rootId, data, config) {
|
|
|
42
42
|
name,
|
|
43
43
|
data,
|
|
44
44
|
argumentProcessResult: [dfObj],
|
|
45
|
-
origin:
|
|
45
|
+
origin: built_in_proc_name_1.BuiltInProcName.S3Dispatch
|
|
46
46
|
});
|
|
47
47
|
return dfObj;
|
|
48
48
|
}
|
|
@@ -53,7 +53,7 @@ function processS3Dispatch(name, args, rootId, data, config) {
|
|
|
53
53
|
name,
|
|
54
54
|
data,
|
|
55
55
|
argumentProcessResult: [dfObj],
|
|
56
|
-
origin:
|
|
56
|
+
origin: built_in_proc_name_1.BuiltInProcName.S3DispatchNext
|
|
57
57
|
});
|
|
58
58
|
const ingoing = dfObj.in.concat(dfObj.unknownReferences);
|
|
59
59
|
ingoing.push({ nodeId: rootId, name: name.content, cds: data.cds, type: identifier_1.ReferenceType.Function });
|
|
@@ -95,7 +95,7 @@ function processS3Dispatch(name, args, rootId, data, config) {
|
|
|
95
95
|
name: symbol,
|
|
96
96
|
data,
|
|
97
97
|
argumentProcessResult: [], // arguments will be attached by the accompanying enveloping function definition
|
|
98
|
-
origin:
|
|
98
|
+
origin: built_in_proc_name_1.BuiltInProcName.S3Dispatch
|
|
99
99
|
});
|
|
100
100
|
(0, common_1.patchFunctionCall)({
|
|
101
101
|
nextGraph: dfGeneric.graph,
|
|
@@ -103,7 +103,7 @@ function processS3Dispatch(name, args, rootId, data, config) {
|
|
|
103
103
|
name,
|
|
104
104
|
data,
|
|
105
105
|
argumentProcessResult: [dfGeneric, dfObj],
|
|
106
|
-
origin:
|
|
106
|
+
origin: built_in_proc_name_1.BuiltInProcName.Function
|
|
107
107
|
});
|
|
108
108
|
const ingoing = dfObj.in.concat(dfGeneric.in, dfObj.unknownReferences, dfGeneric.unknownReferences);
|
|
109
109
|
ingoing.push({ nodeId: rootId, name: name.content, cds: data.cds, type: identifier_1.ReferenceType.Function });
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type DataflowProcessorInformation } from '../../../../../processor';
|
|
2
|
-
import {
|
|
2
|
+
import { DataflowInformation } from '../../../../../info';
|
|
3
3
|
import { type FlowrLaxSourcingOptions, InferWorkingDirectory } from '../../../../../../config';
|
|
4
4
|
import { type RParseRequest } from '../../../../../../r-bridge/retriever';
|
|
5
5
|
import { type IdGenerator, type ParentInformation } from '../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
@@ -29,8 +29,8 @@ const general_1 = require("../../../../../eval/values/general");
|
|
|
29
29
|
const r_value_1 = require("../../../../../eval/values/r-value");
|
|
30
30
|
const unknown_side_effect_1 = require("../../../../../graph/unknown-side-effect");
|
|
31
31
|
const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
32
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
33
32
|
const edge_1 = require("../../../../../graph/edge");
|
|
33
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
34
34
|
/**
|
|
35
35
|
* Infers working directories based on the given option and reference chain
|
|
36
36
|
*/
|
|
@@ -137,8 +137,8 @@ function processSourceCall(name, args, rootId, data, config) {
|
|
|
137
137
|
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
|
|
138
138
|
}
|
|
139
139
|
const information = config.includeFunctionCall ?
|
|
140
|
-
(0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin:
|
|
141
|
-
:
|
|
140
|
+
(0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.Source }).information
|
|
141
|
+
: info_1.DataflowInformation.initialize(rootId, data);
|
|
142
142
|
const sourceFileArgument = args[0];
|
|
143
143
|
if (!config.forceFollow && data.ctx.config.ignoreSourceCalls) {
|
|
144
144
|
(0, log_1.expensiveTrace)(logger_1.dataflowLogger, () => `Skipping source call ${JSON.stringify(sourceFileArgument)} (disabled in config file)`);
|
|
@@ -4,8 +4,8 @@ exports.processSpecialBinOp = processSpecialBinOp;
|
|
|
4
4
|
const known_call_handling_1 = require("../known-call-handling");
|
|
5
5
|
const logger_1 = require("../../../../../logger");
|
|
6
6
|
const edge_1 = require("../../../../../graph/edge");
|
|
7
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
8
7
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
8
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
9
9
|
/**
|
|
10
10
|
* Process a special built-in binary operator, possibly lazily.
|
|
11
11
|
* For example, the logical AND `&&` and OR `||` operators only evaluate their right-hand side if necessary.
|
|
@@ -13,7 +13,7 @@ const identifier_1 = require("../../../../../environments/identifier");
|
|
|
13
13
|
*/
|
|
14
14
|
function processSpecialBinOp(name, args, rootId, data, config) {
|
|
15
15
|
if (!config.lazy) {
|
|
16
|
-
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin:
|
|
16
|
+
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.SpecialBinOp }).information;
|
|
17
17
|
}
|
|
18
18
|
else if (args.length != 2) {
|
|
19
19
|
logger_1.dataflowLogger.warn(`Logical bin-op ${identifier_1.Identifier.toString(name.content)} has something else than 2 arguments, skipping`);
|
|
@@ -26,7 +26,7 @@ function processSpecialBinOp(name, args, rootId, data, config) {
|
|
|
26
26
|
}
|
|
27
27
|
return d;
|
|
28
28
|
},
|
|
29
|
-
origin:
|
|
29
|
+
origin: built_in_proc_name_1.BuiltInProcName.SpecialBinOp
|
|
30
30
|
});
|
|
31
31
|
for (const arg of processedArguments) {
|
|
32
32
|
if (arg) {
|
|
@@ -9,8 +9,8 @@ const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
|
9
9
|
const general_1 = require("../../../../../eval/values/general");
|
|
10
10
|
const assert_1 = require("../../../../../../util/assert");
|
|
11
11
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
12
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
13
12
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
13
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
14
14
|
/**
|
|
15
15
|
* Processes a built-in 'stopifnot' function call.
|
|
16
16
|
* This is special in that it may take a number of boolean expressions either via `...` or
|
|
@@ -26,7 +26,7 @@ const identifier_1 = require("../../../../../environments/identifier");
|
|
|
26
26
|
* ```
|
|
27
27
|
*/
|
|
28
28
|
function processStopIfNot(name, args, rootId, data) {
|
|
29
|
-
const res = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin:
|
|
29
|
+
const res = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.StopIfNot }).information;
|
|
30
30
|
if (args.length === 0) {
|
|
31
31
|
logger_1.dataflowLogger.warn(`stopifnot (${identifier_1.Identifier.toString(name.content)}) has no argument, assuming trivially true and skipping`);
|
|
32
32
|
return res;
|
|
@@ -11,20 +11,17 @@ const unpack_argument_1 = require("../argument/unpack-argument");
|
|
|
11
11
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
12
12
|
const assert_1 = require("../../../../../../util/assert");
|
|
13
13
|
const edge_1 = require("../../../../../graph/edge");
|
|
14
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
15
14
|
const unnamed_call_handling_1 = require("../unnamed-call-handling");
|
|
16
15
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
17
16
|
const identifier_2 = require("../../../../../environments/identifier");
|
|
18
17
|
const resolve_by_name_1 = require("../../../../../environments/resolve-by-name");
|
|
19
18
|
const log_1 = require("../../../../../../util/log");
|
|
20
|
-
|
|
21
|
-
return new Set(argMaps.entries().filter(([, v]) => v === name).map(([k]) => k));
|
|
22
|
-
}
|
|
19
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
23
20
|
/**
|
|
24
21
|
* Process a built-in try-catch or similar handler.
|
|
25
22
|
*/
|
|
26
23
|
function processTryCatch(name, args, rootId, data, config) {
|
|
27
|
-
const res = (0, known_call_handling_1.processKnownFunctionCall)({ name, args: args.map(unpack_argument_1.tryUnpackNoNameArg), rootId, data, origin:
|
|
24
|
+
const res = (0, known_call_handling_1.processKnownFunctionCall)({ name, args: args.map(unpack_argument_1.tryUnpackNoNameArg), rootId, data, origin: built_in_proc_name_1.BuiltInProcName.Try, forceArgs: 'all' });
|
|
28
25
|
if (args.length < 1 || args[0] === r_function_call_1.EmptyArgument) {
|
|
29
26
|
logger_1.dataflowLogger.warn(`TryCatch Handler ${identifier_1.Identifier.toString(name.content)} does not have 1 argument, skipping`);
|
|
30
27
|
return res.information;
|
|
@@ -43,9 +40,9 @@ function processTryCatch(name, args, rootId, data, config) {
|
|
|
43
40
|
// only remove exit points from the block
|
|
44
41
|
const argMaps = (0, linker_1.pMatch)(res.callArgs, params);
|
|
45
42
|
const info = res.information;
|
|
46
|
-
const blockArg =
|
|
47
|
-
const errorArg =
|
|
48
|
-
const finallyArg =
|
|
43
|
+
const blockArg = new Set(argMaps.get('block'));
|
|
44
|
+
const errorArg = new Set(argMaps.get('error'));
|
|
45
|
+
const finallyArg = new Set(argMaps.get('finally'));
|
|
49
46
|
// only take those exit points from the block
|
|
50
47
|
// check whether blockArg has *always* happening exceptions, if so we do not constrain the error handler
|
|
51
48
|
const blockErrorExitPoints = [];
|
|
@@ -158,7 +155,7 @@ function promoteCallToFunction(call, arg, info, data) {
|
|
|
158
155
|
environment: data.environment,
|
|
159
156
|
onlyBuiltin: false,
|
|
160
157
|
cds: data.cds,
|
|
161
|
-
origin: [
|
|
158
|
+
origin: [built_in_proc_name_1.BuiltInProcName.Function]
|
|
162
159
|
});
|
|
163
160
|
return functionId;
|
|
164
161
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processVector = processVector;
|
|
4
4
|
const known_call_handling_1 = require("../known-call-handling");
|
|
5
|
-
const
|
|
5
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
6
6
|
/**
|
|
7
7
|
* Process a vector call.
|
|
8
8
|
*
|
|
@@ -12,6 +12,6 @@ const built_in_1 = require("../../../../../environments/built-in");
|
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
function processVector(name, args, rootId, data) {
|
|
15
|
-
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin:
|
|
15
|
+
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.Vector }).information;
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=built-in-vector.js.map
|
|
@@ -13,8 +13,8 @@ const identifier_1 = require("../../../../../environments/identifier");
|
|
|
13
13
|
const general_1 = require("../../../../../eval/values/general");
|
|
14
14
|
const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
15
15
|
const reference_to_maybe_1 = require("../../../../../environments/reference-to-maybe");
|
|
16
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
17
16
|
const append_1 = require("../../../../../environments/append");
|
|
17
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
18
18
|
/**
|
|
19
19
|
* Process a while loop like `while(cond) { ... }`.
|
|
20
20
|
*/
|
|
@@ -44,7 +44,7 @@ function processWhileLoop(name, args, rootId, data) {
|
|
|
44
44
|
rootId,
|
|
45
45
|
data,
|
|
46
46
|
markAsNSE: [1],
|
|
47
|
-
origin:
|
|
47
|
+
origin: built_in_proc_name_1.BuiltInProcName.WhileLoop
|
|
48
48
|
});
|
|
49
49
|
const [condition, body] = processedArguments;
|
|
50
50
|
// If the condition is always false, we don't include the body
|
|
@@ -69,6 +69,7 @@ function convertFnArgument(arg) {
|
|
|
69
69
|
else {
|
|
70
70
|
return {
|
|
71
71
|
nodeId: arg.info.id,
|
|
72
|
+
valueId: arg.value?.info.id,
|
|
72
73
|
name: arg.name.content,
|
|
73
74
|
cds: undefined,
|
|
74
75
|
type: identifier_1.ReferenceType.Argument
|
|
@@ -134,7 +135,7 @@ function processAllArguments({ functionName, args, data, finalGraph, functionRoo
|
|
|
134
135
|
callArgs.push({ nodeId: processed.entryPoint, cds: undefined, type: identifier_1.ReferenceType.Argument });
|
|
135
136
|
}
|
|
136
137
|
else {
|
|
137
|
-
callArgs.push({ nodeId: processed.entryPoint, name: arg.name.content, cds: undefined, type: identifier_1.ReferenceType.Argument });
|
|
138
|
+
callArgs.push({ nodeId: processed.entryPoint, valueId: arg.value?.info.id, name: arg.name.content, cds: undefined, type: identifier_1.ReferenceType.Argument });
|
|
138
139
|
}
|
|
139
140
|
finalGraph.addEdge(functionRootId, processed.entryPoint, edge_1.EdgeType.Argument);
|
|
140
141
|
}
|
|
@@ -10,7 +10,7 @@ const edge_1 = require("../../../../graph/edge");
|
|
|
10
10
|
const logger_1 = require("../../../../logger");
|
|
11
11
|
const vertex_1 = require("../../../../graph/vertex");
|
|
12
12
|
const unknown_side_effect_1 = require("../../../../graph/unknown-side-effect");
|
|
13
|
-
const
|
|
13
|
+
const built_in_proc_name_1 = require("../../../../environments/built-in-proc-name");
|
|
14
14
|
/**
|
|
15
15
|
* Marks the given arguments as being involved in R's non-standard evaluation.
|
|
16
16
|
*/
|
|
@@ -49,7 +49,7 @@ function processKnownFunctionCall({ name, args, rootId, data, reverseOrder = fal
|
|
|
49
49
|
onlyBuiltin: false,
|
|
50
50
|
cds: data.cds,
|
|
51
51
|
args: reverseOrder ? callArgs.toReversed() : callArgs,
|
|
52
|
-
origin: origin === 'default' ? [
|
|
52
|
+
origin: origin === 'default' ? [built_in_proc_name_1.BuiltInProcName.Function] : [origin]
|
|
53
53
|
}, data.ctx.env.makeCleanEnv());
|
|
54
54
|
if (hasUnknownSideEffect) {
|
|
55
55
|
(0, unknown_side_effect_1.handleUnknownSideEffect)(finalGraph, data.environment, rootId);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../../../../processor';
|
|
2
|
-
import {
|
|
2
|
+
import { DataflowInformation } from '../../../../info';
|
|
3
3
|
import type { ParentInformation } from '../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
4
|
import type { RFunctionArgument } from '../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
@@ -64,6 +64,6 @@ function processNamedCall(name, args, rootId, data) {
|
|
|
64
64
|
// mark the function call as built in only
|
|
65
65
|
markAsOnlyBuiltIn(information.graph, rootId);
|
|
66
66
|
}
|
|
67
|
-
return information ??
|
|
67
|
+
return information ?? info_1.DataflowInformation.initialize(rootId, data);
|
|
68
68
|
}
|
|
69
69
|
//# sourceMappingURL=named-call-handling.js.map
|
|
@@ -11,7 +11,7 @@ const vertex_1 = require("../../../../graph/vertex");
|
|
|
11
11
|
const type_1 = require("../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
12
12
|
const logger_1 = require("../../../../logger");
|
|
13
13
|
const identifier_1 = require("../../../../environments/identifier");
|
|
14
|
-
const
|
|
14
|
+
const built_in_proc_name_1 = require("../../../../environments/built-in-proc-name");
|
|
15
15
|
exports.UnnamedFunctionCallPrefix = 'unnamed-fc-';
|
|
16
16
|
/**
|
|
17
17
|
* Processes an unnamed function call.
|
|
@@ -45,7 +45,7 @@ function processUnnamedFunctionCall(functionCall, data) {
|
|
|
45
45
|
onlyBuiltin: false,
|
|
46
46
|
cds: data.cds,
|
|
47
47
|
args: callArgs, // same reference
|
|
48
|
-
origin: [
|
|
48
|
+
origin: [built_in_proc_name_1.BuiltInProcName.Unnamed]
|
|
49
49
|
}, data.ctx.env.makeCleanEnv());
|
|
50
50
|
let inIds = remainingReadInArgs;
|
|
51
51
|
inIds.push({ nodeId: functionRootId, name: functionCallName, cds: data.cds, type: identifier_1.ReferenceType.Function });
|
|
@@ -23,7 +23,7 @@ function processFunctionParameter(parameter, data) {
|
|
|
23
23
|
for (const writtenNode of writtenNodes) {
|
|
24
24
|
const wid = writtenNode.nodeId;
|
|
25
25
|
(0, log_1.expensiveTrace)(log_1.log, () => `parameter ${writtenNode.name} (${wid}) is defined at id ${writtenNode.definedAt} with ${defaultValue === undefined ? 'no default value' : ' a default value'}`);
|
|
26
|
-
graph.setDefinitionOfVertex(writtenNode);
|
|
26
|
+
graph.setDefinitionOfVertex(writtenNode, defaultValue?.entryPoint ? [defaultValue?.entryPoint] : []);
|
|
27
27
|
environment = (0, define_1.define)(writtenNode, false, environment);
|
|
28
28
|
if (defaultValue !== undefined) {
|
|
29
29
|
if (r_function_definition_1.RFunctionDefinition.is(parameter.defaultValue)) {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { DataflowInformation } from '../../info';
|
|
2
2
|
import type { DataflowProcessorInformation } from '../../processor';
|
|
3
3
|
import type { RNodeWithParent } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
4
|
/**
|
|
@@ -8,6 +8,6 @@ const info_1 = require("../../info");
|
|
|
8
8
|
* This can be used to ignore nodes that do not affect dataflow analysis.
|
|
9
9
|
*/
|
|
10
10
|
function processUninterestingLeaf(leaf, info) {
|
|
11
|
-
return
|
|
11
|
+
return info_1.DataflowInformation.initialize(leaf.info.id, info);
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=process-uninteresting-leaf.js.map
|
|
@@ -76,5 +76,5 @@ export type Origin = SimpleOrigin | FunctionCallOrigin | BuiltInFunctionOrigin;
|
|
|
76
76
|
*
|
|
77
77
|
* This returns undefined only if there is no dataflow correspondence (e.g. in case of unevaluated non-standard eval).
|
|
78
78
|
*/
|
|
79
|
-
export declare function getOriginInDfg(dfg: DataflowGraph, id: NodeId): Origin[] | undefined;
|
|
79
|
+
export declare function getOriginInDfg(this: void, dfg: DataflowGraph, id: NodeId): Origin[] | undefined;
|
|
80
80
|
export {};
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getAllRefsToSymbol = getAllRefsToSymbol;
|
|
4
4
|
const edge_1 = require("../graph/edge");
|
|
5
5
|
const info_1 = require("../info");
|
|
6
|
-
const
|
|
6
|
+
const df_helper_1 = require("../graph/df-helper");
|
|
7
7
|
/**
|
|
8
8
|
* Finds the definition of a variable and all other uses from that point on
|
|
9
9
|
*
|
|
@@ -22,7 +22,7 @@ const dfg_get_origin_1 = require("./dfg-get-origin");
|
|
|
22
22
|
*/
|
|
23
23
|
function getAllRefsToSymbol(graph, nodeId) {
|
|
24
24
|
// Get all origins and filter for ones that happen for sure
|
|
25
|
-
const origins =
|
|
25
|
+
const origins = df_helper_1.Dataflow.origin(graph, nodeId);
|
|
26
26
|
if (origins === undefined) {
|
|
27
27
|
return undefined;
|
|
28
28
|
}
|
|
@@ -32,13 +32,13 @@ function getAllRefsToSymbol(graph, nodeId) {
|
|
|
32
32
|
}
|
|
33
33
|
// Gather all the references
|
|
34
34
|
const res = new Set();
|
|
35
|
-
for (const
|
|
36
|
-
res.add(
|
|
37
|
-
graph.ingoingEdges(
|
|
35
|
+
for (const { id } of definitiveOrigins) {
|
|
36
|
+
res.add(id);
|
|
37
|
+
graph.ingoingEdges(id)
|
|
38
38
|
?.entries()
|
|
39
39
|
.filter(([_, edge]) => edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads))
|
|
40
40
|
.forEach(([node, _]) => res.add(node));
|
|
41
|
-
graph.outgoingEdges(
|
|
41
|
+
graph.outgoingEdges(id)
|
|
42
42
|
?.entries()
|
|
43
43
|
.filter(([_, edge]) => edge_1.DfEdge.includesType(edge, edge_1.EdgeType.DefinedByOnCall))
|
|
44
44
|
.forEach(([node, _]) => res.add(node));
|
|
@@ -282,7 +282,8 @@ We welcome every contribution! Please check out the ${ctx.linkPage('wiki/Onboard
|
|
|
282
282
|
|
|
283
283
|
*flowr* is actively developed by [Florian Sihler](https://eagleoutice.github.io/portfolio/) and (since October 1st 2025) [Oliver Gerstl](https://www.linkedin.com/in/oliver-gerstl) under the
|
|
284
284
|
[GPLv3 License](LICENSE).\\
|
|
285
|
-
It is partially supported by the German Research Foundation (DFG) under the grant [504226141](https://gepris.dfg.de/gepris/projekt/504226141) ("CodeInspector")
|
|
285
|
+
It is partially supported by the German Research Foundation (DFG) under the grant [504226141](https://gepris.dfg.de/gepris/projekt/504226141) ("CodeInspector")
|
|
286
|
+
and received an unrestricted gift from [Posit](https://posit.co/), the open-source data science company.
|
|
286
287
|
|
|
287
288
|
----
|
|
288
289
|
|
|
@@ -8,6 +8,9 @@ import type { MermaidMarkdownMark } from '../../util/mermaid/info';
|
|
|
8
8
|
* Please use this only for documentation purposes, for programmatic usage use {@link graphToMermaid} directly.
|
|
9
9
|
*/
|
|
10
10
|
export declare function printDfGraph(graph: DataflowGraph, mark?: ReadonlySet<MermaidMarkdownMark>, simplified?: boolean): string;
|
|
11
|
+
/**
|
|
12
|
+
* Options for {@link printDfGraphForCode}.
|
|
13
|
+
*/
|
|
11
14
|
export interface PrintDataflowGraphOptions {
|
|
12
15
|
readonly mark?: ReadonlySet<MermaidMarkdownMark>;
|
|
13
16
|
readonly showCode?: boolean;
|