@eagleoutice/flowr 2.9.12 → 2.9.14
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 +35 -23
- 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 +5 -3
- package/benchmark/slicer.js +26 -10
- package/benchmark/stats/print.js +12 -0
- package/benchmark/stats/stats.d.ts +3 -2
- package/benchmark/stats/stats.js +1 -1
- package/benchmark/summarizer/data.d.ts +1 -0
- package/benchmark/summarizer/second-phase/process.js +5 -0
- package/cli/benchmark-app.d.ts +1 -0
- package/cli/benchmark-app.js +1 -0
- package/cli/benchmark-helper-app.d.ts +2 -1
- package/cli/benchmark-helper-app.js +6 -3
- package/cli/common/options.d.ts +8 -0
- package/cli/common/options.js +3 -1
- package/cli/common/scripts-info.d.ts +8 -0
- package/cli/export-quads-app.js +1 -1
- package/cli/flowr.js +3 -3
- package/cli/repl/commands/repl-dataflow.js +5 -5
- package/cli/repl/core.d.ts +3 -3
- package/cli/repl/parser/slice-query-parser.d.ts +1 -1
- package/cli/repl/parser/slice-query-parser.js +2 -2
- package/cli/repl/server/connection.d.ts +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/cli/repl/server/server.d.ts +2 -2
- package/cli/script-core/statistics-core.d.ts +2 -2
- package/cli/script-core/statistics-helper-core.d.ts +2 -2
- package/cli/script-core/statistics-helper-core.js +1 -1
- package/cli/slicer-app.js +2 -2
- package/cli/statistics-app.js +1 -1
- package/cli/statistics-helper-app.js +1 -1
- package/cli/wiki.js +2 -2
- package/config.d.ts +65 -24
- package/config.js +197 -161
- package/control-flow/extract-cfg.js +7 -10
- 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/core/steps/pipeline-step.d.ts +2 -2
- 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 +1 -0
- package/dataflow/environments/identifier.js +1 -0
- package/dataflow/eval/resolve/alias-tracking.js +12 -15
- 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 +49 -19
- package/dataflow/graph/call-graph.js +117 -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 +132 -0
- package/dataflow/graph/df-helper.js +131 -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 +55 -0
- package/dataflow/graph/graph-helper.js +105 -0
- package/dataflow/graph/graph.d.ts +6 -1
- package/dataflow/graph/graph.js +14 -9
- package/dataflow/graph/vertex.d.ts +1 -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 +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +7 -6
- 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 +5 -5
- 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 +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +4 -4
- 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 +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +23 -12
- 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/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/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 -2
- 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-analyzer.js +7 -5
- package/documentation/wiki-core.js +6 -7
- package/documentation/wiki-dataflow-graph.js +15 -13
- package/documentation/wiki-interface.js +8 -6
- package/documentation/wiki-linter.js +6 -5
- package/documentation/wiki-mk/doc-context.js +3 -4
- package/documentation/wiki-normalized-ast.js +5 -4
- package/documentation/wiki-query.js +28 -3
- package/engines.d.ts +2 -2
- package/engines.js +4 -4
- package/linter/linter-rules.d.ts +24 -1
- package/linter/linter-rules.js +3 -1
- package/linter/rules/dataframe-access-validation.js +5 -5
- package/linter/rules/naming-convention.d.ts +1 -1
- package/linter/rules/naming-convention.js +7 -3
- 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 +3 -1
- package/project/cache/flowr-analyzer-cache.d.ts +1 -1
- package/project/cache/flowr-analyzer-cache.js +1 -1
- package/project/context/flowr-analyzer-context.d.ts +6 -6
- package/project/context/flowr-analyzer-context.js +2 -2
- package/project/context/flowr-analyzer-files-context.d.ts +2 -2
- package/project/context/flowr-analyzer-files-context.js +28 -8
- package/project/flowr-analyzer-builder.d.ts +13 -6
- package/project/flowr-analyzer-builder.js +12 -3
- package/project/flowr-analyzer.d.ts +4 -4
- 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/config-query/config-query-format.d.ts +5 -5
- 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 +2 -2
- 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/files-query/files-query-format.d.ts +3 -3
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +1 -1
- 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/linter-query/linter-query-format.d.ts +3 -3
- 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 +1 -1
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +2 -2
- package/queries/catalog/provenance-query/provenance-query-executor.d.ts +9 -0
- package/queries/catalog/provenance-query/provenance-query-executor.js +37 -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 +4 -4
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -0
- 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 +4 -4
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -3
- package/queries/query.d.ts +27 -19
- package/queries/query.js +2 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +13 -2
- package/r-bridge/lang-4.x/ast/model/model.js +20 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +8 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +13 -0
- package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +2 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +6 -2
- 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 +40 -16
- package/slicing/criterion/parse.js +67 -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 +9 -12
- package/statistics/statistics.d.ts +2 -2
- 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 +46 -31
- package/util/mermaid/mermaid.d.ts +57 -12
- package/util/mermaid/mermaid.js +74 -67
- package/util/objects.d.ts +12 -0
- package/util/objects.js +28 -0
- 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/summarizer.js +1 -1
- 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
|
@@ -14,8 +14,8 @@ const general_1 = require("../../../../../eval/values/general");
|
|
|
14
14
|
const r_value_1 = require("../../../../../eval/values/r-value");
|
|
15
15
|
const log_1 = require("../../../../../../util/log");
|
|
16
16
|
const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
17
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
18
17
|
const r_string_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
18
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
19
19
|
/**
|
|
20
20
|
* Process an apply call like `vapply` or `mapply`.
|
|
21
21
|
*/
|
|
@@ -25,7 +25,7 @@ function processApply(name, args, rootId, data, config) {
|
|
|
25
25
|
const forceArgsMask = new Array(indexOfFunction).fill(false);
|
|
26
26
|
forceArgsMask.push(true);
|
|
27
27
|
const resFn = (0, known_call_handling_1.processKnownFunctionCall)({
|
|
28
|
-
name, args, rootId, data, forceArgs: forceArgsMask, origin:
|
|
28
|
+
name, args, rootId, data, forceArgs: forceArgsMask, origin: built_in_proc_name_1.BuiltInProcName.Apply
|
|
29
29
|
});
|
|
30
30
|
let information = resFn.information;
|
|
31
31
|
const processedArguments = resFn.processedArguments;
|
|
@@ -119,7 +119,7 @@ function processApply(name, args, rootId, data, config) {
|
|
|
119
119
|
onlyBuiltin: false,
|
|
120
120
|
cds: data.cds,
|
|
121
121
|
args: allOtherArguments, // same reference
|
|
122
|
-
origin: [
|
|
122
|
+
origin: [built_in_proc_name_1.BuiltInProcName.Function]
|
|
123
123
|
}, data.ctx.env.makeCleanEnv());
|
|
124
124
|
information.graph.addEdge(rootId, rootFnId, edge_1.EdgeType.Calls | edge_1.EdgeType.Reads);
|
|
125
125
|
information.graph.addEdge(rootId, functionId, edge_1.EdgeType.Calls | edge_1.EdgeType.Argument);
|
|
@@ -168,7 +168,7 @@ function processApply(name, args, rootId, data, config) {
|
|
|
168
168
|
environment: resolveInEnvironment === 'global' ? undefined : data.environment,
|
|
169
169
|
onlyBuiltin: resolveInEnvironment === 'global',
|
|
170
170
|
cds: data.cds,
|
|
171
|
-
origin: [
|
|
171
|
+
origin: [built_in_proc_name_1.BuiltInProcName.Function]
|
|
172
172
|
});
|
|
173
173
|
}
|
|
174
174
|
for (const arg of processedArguments) {
|
|
@@ -23,6 +23,7 @@ const built_in_1 = require("../../../../../environments/built-in");
|
|
|
23
23
|
const unknown_side_effect_1 = require("../../../../../graph/unknown-side-effect");
|
|
24
24
|
const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
25
25
|
const r_value_1 = require("../../../../../eval/values/r-value");
|
|
26
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
26
27
|
function toReplacementSymbol(target, prefix, superAssignment) {
|
|
27
28
|
return {
|
|
28
29
|
type: type_1.RType.Symbol,
|
|
@@ -54,7 +55,7 @@ function tryReplacement(rootId, functionName, data, name, args) {
|
|
|
54
55
|
if (resolved.length !== 1 || resolved[0].type !== identifier_1.ReferenceType.BuiltInFunction) {
|
|
55
56
|
return (0, process_named_call_1.processAsNamedCall)(functionName, data, name, args);
|
|
56
57
|
}
|
|
57
|
-
const info = built_in_1.BuiltInProcessorMapper[
|
|
58
|
+
const info = built_in_1.BuiltInProcessorMapper[built_in_proc_name_1.BuiltInProcName.Replacement]({
|
|
58
59
|
type: type_1.RType.Symbol,
|
|
59
60
|
info: functionName.info,
|
|
60
61
|
content: name,
|
|
@@ -119,7 +120,7 @@ args, rootId, data, config) {
|
|
|
119
120
|
data,
|
|
120
121
|
reverseOrder: !config.swapSourceAndTarget,
|
|
121
122
|
forceArgs: config.forceArgs,
|
|
122
|
-
origin:
|
|
123
|
+
origin: built_in_proc_name_1.BuiltInProcName.Assignment
|
|
123
124
|
});
|
|
124
125
|
return processAssignmentToSymbol({
|
|
125
126
|
...config,
|
|
@@ -145,7 +146,7 @@ args, rootId, data, config) {
|
|
|
145
146
|
data,
|
|
146
147
|
reverseOrder: !config.swapSourceAndTarget,
|
|
147
148
|
forceArgs: config.forceArgs,
|
|
148
|
-
origin:
|
|
149
|
+
origin: built_in_proc_name_1.BuiltInProcName.Assignment
|
|
149
150
|
});
|
|
150
151
|
return processAssignmentToSymbol({
|
|
151
152
|
...config,
|
|
@@ -183,7 +184,7 @@ args, rootId, data, config) {
|
|
|
183
184
|
data,
|
|
184
185
|
reverseOrder: !config.swapSourceAndTarget,
|
|
185
186
|
forceArgs: config.forceArgs,
|
|
186
|
-
origin:
|
|
187
|
+
origin: built_in_proc_name_1.BuiltInProcName.Assignment
|
|
187
188
|
});
|
|
188
189
|
return processAssignmentToSymbol({
|
|
189
190
|
...config,
|
|
@@ -203,7 +204,7 @@ args, rootId, data, config) {
|
|
|
203
204
|
logger_1.dataflowLogger.warn(`Assignment ${identifier_1.Identifier.toString(name.content)} has an unknown target type ${target.type} => unknown impact`);
|
|
204
205
|
const info = (0, known_call_handling_1.processKnownFunctionCall)({
|
|
205
206
|
name, args: effectiveArgs, rootId, data, forceArgs: config.forceArgs,
|
|
206
|
-
origin:
|
|
207
|
+
origin: built_in_proc_name_1.BuiltInProcName.Assignment
|
|
207
208
|
}).information;
|
|
208
209
|
(0, unknown_side_effect_1.handleUnknownSideEffect)(info.graph, info.environment, rootId);
|
|
209
210
|
return info;
|
|
@@ -252,7 +253,7 @@ function processAssignmentToString(target, args, name, rootId, data, config, sou
|
|
|
252
253
|
data,
|
|
253
254
|
reverseOrder: !config.swapSourceAndTarget,
|
|
254
255
|
forceArgs: config.forceArgs,
|
|
255
|
-
origin:
|
|
256
|
+
origin: built_in_proc_name_1.BuiltInProcName.Assignment
|
|
256
257
|
});
|
|
257
258
|
return processAssignmentToSymbol({
|
|
258
259
|
...config,
|
|
@@ -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';
|
|
@@ -18,8 +18,8 @@ const string_constants_1 = require("../../../../../eval/values/string/string-con
|
|
|
18
18
|
const unknown_side_effect_1 = require("../../../../../graph/unknown-side-effect");
|
|
19
19
|
const alias_tracking_1 = require("../../../../../eval/resolve/alias-tracking");
|
|
20
20
|
const arrays_1 = require("../../../../../../util/collections/arrays");
|
|
21
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
22
21
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
22
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
23
23
|
/**
|
|
24
24
|
* Process a call to `eval()`, trying to resolve the code being evaluated if possible.
|
|
25
25
|
*/
|
|
@@ -29,8 +29,8 @@ function processEvalCall(name, args, rootId, data, config) {
|
|
|
29
29
|
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
|
|
30
30
|
}
|
|
31
31
|
const information = config.includeFunctionCall ?
|
|
32
|
-
(0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: [true], origin:
|
|
33
|
-
:
|
|
32
|
+
(0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: [true], origin: built_in_proc_name_1.BuiltInProcName.Eval }).information
|
|
33
|
+
: info_1.DataflowInformation.initialize(rootId, data);
|
|
34
34
|
const evalArgument = args[0];
|
|
35
35
|
if (config.includeFunctionCall) {
|
|
36
36
|
information.graph.addEdge(rootId, args[0].value.info.id, edge_1.EdgeType.Returns);
|
|
@@ -45,13 +45,13 @@ function processEvalCall(name, args, rootId, data, config) {
|
|
|
45
45
|
const idGenerator = (0, decorate_1.sourcedDeterministicCountingIdGenerator)(name.lexeme + '::' + rootId, name.location);
|
|
46
46
|
data = {
|
|
47
47
|
...data,
|
|
48
|
-
cds: [...(data.cds ?? []), { id: rootId, when: true }]
|
|
48
|
+
cds: code.length > 1 ? [...(data.cds ?? []), { id: rootId, when: true }] : data.cds
|
|
49
49
|
};
|
|
50
50
|
const originalInfo = { ...information };
|
|
51
51
|
const result = [];
|
|
52
52
|
for (const c of code) {
|
|
53
53
|
const codeRequest = (0, retriever_1.requestFromInput)(c);
|
|
54
|
-
const r = (0, built_in_source_1.sourceRequest)(rootId, codeRequest, data, originalInfo, idGenerator);
|
|
54
|
+
const r = (0, built_in_source_1.sourceRequest)(rootId, codeRequest, data, originalInfo, code.length > 1, idGenerator);
|
|
55
55
|
result.push(r);
|
|
56
56
|
// add a returns edge from the eval to the result
|
|
57
57
|
for (const e of r.exitPoints) {
|
|
@@ -14,11 +14,11 @@ const resolve_by_name_1 = require("../../../../../environments/resolve-by-name")
|
|
|
14
14
|
const edge_1 = require("../../../../../graph/edge");
|
|
15
15
|
const vertex_1 = require("../../../../../graph/vertex");
|
|
16
16
|
const scoping_1 = require("../../../../../environments/scoping");
|
|
17
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
18
17
|
const overwrite_1 = require("../../../../../environments/overwrite");
|
|
19
18
|
const logger_1 = require("../../../../../logger");
|
|
20
19
|
const log_1 = require("../../../../../../util/log");
|
|
21
20
|
const reference_to_maybe_1 = require("../../../../../environments/reference-to-maybe");
|
|
21
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
22
22
|
function linkReadNameToWriteIfPossible(read, environments, listEnvironments, remainingRead, nextGraph) {
|
|
23
23
|
const readName = read.name && identifier_1.Identifier.isDotDotDotAccess(read.name) ? identifier_1.Identifier.dotdotdot() : read.name;
|
|
24
24
|
const probableTarget = readName ? (0, resolve_by_name_1.resolveByName)(readName, environments, read.type) : undefined;
|
|
@@ -178,7 +178,7 @@ function processExpressionList(name, args, rootId, data) {
|
|
|
178
178
|
name,
|
|
179
179
|
data,
|
|
180
180
|
argumentProcessResult: processedExpressions,
|
|
181
|
-
origin:
|
|
181
|
+
origin: built_in_proc_name_1.BuiltInProcName.ExpressionList
|
|
182
182
|
});
|
|
183
183
|
nextGraph.addEdge(rootId, node_id_1.NodeId.toBuiltIn('{'), edge_1.EdgeType.Reads | edge_1.EdgeType.Calls);
|
|
184
184
|
// process all exit points as potential returns:
|
|
@@ -15,7 +15,7 @@ const append_1 = require("../../../../../environments/append");
|
|
|
15
15
|
const edge_1 = require("../../../../../graph/edge");
|
|
16
16
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
17
17
|
const reference_to_maybe_1 = require("../../../../../environments/reference-to-maybe");
|
|
18
|
-
const
|
|
18
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
19
19
|
/**
|
|
20
20
|
* Processes a for-loop call: `for(<variable> in <vector>) <body>`
|
|
21
21
|
* desugared as:
|
|
@@ -72,7 +72,7 @@ function processForLoop(name, args, rootId, data) {
|
|
|
72
72
|
name,
|
|
73
73
|
data: { ...data, cds: originalDependency },
|
|
74
74
|
argumentProcessResult: [variable, vector, body],
|
|
75
|
-
origin:
|
|
75
|
+
origin: built_in_proc_name_1.BuiltInProcName.ForLoop
|
|
76
76
|
});
|
|
77
77
|
/* mark the last argument as nse */
|
|
78
78
|
nextGraph.addEdge(rootId, body.entryPoint, edge_1.EdgeType.NonStandardEvaluation);
|
|
@@ -20,9 +20,9 @@ const scoping_1 = require("../../../../../environments/scoping");
|
|
|
20
20
|
const resolve_by_name_1 = require("../../../../../environments/resolve-by-name");
|
|
21
21
|
const edge_1 = require("../../../../../graph/edge");
|
|
22
22
|
const log_1 = require("../../../../../../util/log");
|
|
23
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
24
23
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
25
24
|
const hooks_1 = require("../../../../../hooks");
|
|
25
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
26
26
|
/**
|
|
27
27
|
* Process a function definition, i.e., `function(a, b) { ... }`
|
|
28
28
|
*/
|
|
@@ -173,7 +173,7 @@ function retrieveActiveEnvironment(callerEnvironment, baseEnvironment, ctx) {
|
|
|
173
173
|
}
|
|
174
174
|
function updateDispatches(graph, myArgs) {
|
|
175
175
|
for (const [, info] of graph.vertices(false)) {
|
|
176
|
-
if (info.tag !== vertex_1.VertexType.FunctionCall || (!info.origin.includes(
|
|
176
|
+
if (info.tag !== vertex_1.VertexType.FunctionCall || (!info.origin.includes(built_in_proc_name_1.BuiltInProcName.S3Dispatch) && !info.origin.includes(built_in_proc_name_1.BuiltInProcName.S7Dispatch))) {
|
|
177
177
|
continue;
|
|
178
178
|
}
|
|
179
179
|
if (info.args.length === 0) {
|
|
@@ -247,7 +247,7 @@ function updateNestedFunctionCalls(graph, outEnvironment) {
|
|
|
247
247
|
}
|
|
248
248
|
const targets = new Set((0, linker_1.getAllFunctionCallTargets)(id, graph, effectiveEnvironment));
|
|
249
249
|
const collectedNextMethods = new Set();
|
|
250
|
-
const treatAsS3 = origin.includes(
|
|
250
|
+
const treatAsS3 = origin.includes(built_in_proc_name_1.BuiltInProcName.S3Dispatch);
|
|
251
251
|
for (const target of targets) {
|
|
252
252
|
if (node_id_1.NodeId.isBuiltIn(target)) {
|
|
253
253
|
graph.addEdge(id, target, edge_1.EdgeType.Calls);
|
|
@@ -274,7 +274,7 @@ function updateNestedFunctionCalls(graph, outEnvironment) {
|
|
|
274
274
|
// collect all next method calls to link them to the same targets!
|
|
275
275
|
for (const s of targetVertex.subflow.graph) {
|
|
276
276
|
const v = graph.getVertex(s);
|
|
277
|
-
if (v?.tag === vertex_1.VertexType.FunctionCall && v.origin.includes(
|
|
277
|
+
if (v?.tag === vertex_1.VertexType.FunctionCall && v.origin.includes(built_in_proc_name_1.BuiltInProcName.S3DispatchNext)) {
|
|
278
278
|
collectedNextMethods.add(v.id);
|
|
279
279
|
}
|
|
280
280
|
}
|
|
@@ -8,8 +8,8 @@ const logger_1 = require("../../../../../logger");
|
|
|
8
8
|
const retriever_1 = require("../../../../../../r-bridge/retriever");
|
|
9
9
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
10
10
|
const edge_1 = require("../../../../../graph/edge");
|
|
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
|
* Processes a built-in 'get' function call.
|
|
15
15
|
*/
|
|
@@ -35,7 +35,7 @@ function processGet(name, args, rootId, data) {
|
|
|
35
35
|
args: (0, make_argument_1.wrapArgumentsUnnamed)([treatTargetAsSymbol], data.completeAst.idMap),
|
|
36
36
|
rootId,
|
|
37
37
|
data,
|
|
38
|
-
origin:
|
|
38
|
+
origin: built_in_proc_name_1.BuiltInProcName.Get
|
|
39
39
|
});
|
|
40
40
|
const firstArg = processedArguments[0];
|
|
41
41
|
if (firstArg) {
|
|
@@ -14,8 +14,8 @@ 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
16
|
const linker_1 = require("../../../../linker");
|
|
17
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
18
17
|
const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
18
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
19
19
|
function getArguments(config, args) {
|
|
20
20
|
let condArg;
|
|
21
21
|
let thenArg;
|
|
@@ -27,7 +27,7 @@ function getArguments(config, args) {
|
|
|
27
27
|
[config.args.no]: 'no',
|
|
28
28
|
'...': '...'
|
|
29
29
|
};
|
|
30
|
-
const argMaps = (0, linker_1.
|
|
30
|
+
const argMaps = (0, linker_1.pMatch)((0, common_1.convertFnArguments)(args), params);
|
|
31
31
|
condArg = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('cond')?.[0]));
|
|
32
32
|
thenArg = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('yes')?.[0]));
|
|
33
33
|
otherwiseArg = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('no')?.[0]));
|
|
@@ -113,7 +113,7 @@ function processIfThenElse(name, args, rootId, data, config) {
|
|
|
113
113
|
name,
|
|
114
114
|
data: { ...data, cds: originalDependency },
|
|
115
115
|
argumentProcessResult: [cond, then, otherwise],
|
|
116
|
-
origin:
|
|
116
|
+
origin: built_in_proc_name_1.BuiltInProcName.IfThenElse
|
|
117
117
|
});
|
|
118
118
|
// as an if always evaluates its condition, we add a 'reads'-edge
|
|
119
119
|
nextGraph.addEdge(rootId, cond.entryPoint, edge_1.EdgeType.Reads);
|
|
@@ -6,8 +6,8 @@ const logger_1 = require("../../../../../logger");
|
|
|
6
6
|
const unpack_argument_1 = require("../argument/unpack-argument");
|
|
7
7
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
8
8
|
const make_argument_1 = require("../argument/make-argument");
|
|
9
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
10
9
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
10
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
11
11
|
/**
|
|
12
12
|
* Process a library call like `library` or `require`
|
|
13
13
|
*/
|
|
@@ -39,7 +39,7 @@ function processLibrary(name, args, rootId, data) {
|
|
|
39
39
|
return (0, known_call_handling_1.processKnownFunctionCall)({
|
|
40
40
|
name, args: (0, make_argument_1.wrapArgumentsUnnamed)([newArg], data.completeAst.idMap), rootId, data,
|
|
41
41
|
hasUnknownSideEffect: true,
|
|
42
|
-
origin:
|
|
42
|
+
origin: built_in_proc_name_1.BuiltInProcName.Library
|
|
43
43
|
}).information;
|
|
44
44
|
}
|
|
45
45
|
//# sourceMappingURL=built-in-library.js.map
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processList = processList;
|
|
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 list call.
|
|
8
8
|
*
|
|
@@ -12,6 +12,6 @@ const built_in_1 = require("../../../../../environments/built-in");
|
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
function processList(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.List }).information;
|
|
16
16
|
}
|
|
17
17
|
//# sourceMappingURL=built-in-list.js.map
|
|
@@ -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';
|
|
@@ -8,9 +8,9 @@ const linker_1 = require("../../../../linker");
|
|
|
8
8
|
const common_1 = require("../common");
|
|
9
9
|
const unpack_argument_1 = require("../argument/unpack-argument");
|
|
10
10
|
const scoping_1 = require("../../../../../environments/scoping");
|
|
11
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
12
11
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
13
12
|
const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
13
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
14
14
|
/**
|
|
15
15
|
* Processes a built-in 'local' function call.
|
|
16
16
|
*/
|
|
@@ -23,13 +23,13 @@ function processLocal(name, args, rootId, data, config) {
|
|
|
23
23
|
[config.args.env]: 'env',
|
|
24
24
|
'...': '...'
|
|
25
25
|
};
|
|
26
|
-
const argMaps = (0, linker_1.
|
|
26
|
+
const argMaps = (0, linker_1.pMatch)((0, common_1.convertFnArguments)(args), params);
|
|
27
27
|
const env = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('env')?.[0]));
|
|
28
28
|
const expr = (0, unpack_argument_1.unpackArg)(r_argument_1.RArgument.getWithId(args, argMaps.get('expr')?.[0]));
|
|
29
29
|
if (!expr) {
|
|
30
30
|
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: 'default' }).information;
|
|
31
31
|
}
|
|
32
|
-
const dfEnv = env ? (0, processor_1.processDataflowFor)(env, data) :
|
|
32
|
+
const dfEnv = env ? (0, processor_1.processDataflowFor)(env, data) : info_1.DataflowInformation.initialize(rootId, data);
|
|
33
33
|
if ((0, info_1.alwaysExits)(dfEnv)) {
|
|
34
34
|
(0, common_1.patchFunctionCall)({
|
|
35
35
|
nextGraph: dfEnv.graph,
|
|
@@ -37,7 +37,7 @@ function processLocal(name, args, rootId, data, config) {
|
|
|
37
37
|
name,
|
|
38
38
|
data,
|
|
39
39
|
argumentProcessResult: [dfEnv],
|
|
40
|
-
origin:
|
|
40
|
+
origin: built_in_proc_name_1.BuiltInProcName.Local
|
|
41
41
|
});
|
|
42
42
|
return dfEnv;
|
|
43
43
|
}
|
|
@@ -49,7 +49,7 @@ function processLocal(name, args, rootId, data, config) {
|
|
|
49
49
|
name,
|
|
50
50
|
data,
|
|
51
51
|
argumentProcessResult: [dfExpr, dfEnv],
|
|
52
|
-
origin:
|
|
52
|
+
origin: built_in_proc_name_1.BuiltInProcName.Local
|
|
53
53
|
});
|
|
54
54
|
const ingoing = dfEnv.in.concat(dfExpr.in, dfEnv.unknownReferences, dfExpr.unknownReferences);
|
|
55
55
|
ingoing.push({ nodeId: rootId, name: name.content, cds: data.cds, type: identifier_1.ReferenceType.Function });
|
|
@@ -9,12 +9,12 @@ const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
|
9
9
|
const vertex_1 = require("../../../../../graph/vertex");
|
|
10
10
|
const edge_1 = require("../../../../../graph/edge");
|
|
11
11
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
12
|
-
const
|
|
12
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
13
13
|
/**
|
|
14
14
|
* Suport for R's pipe functions like `|>`.
|
|
15
15
|
*/
|
|
16
16
|
function processPipe(name, args, rootId, data) {
|
|
17
|
-
const { information, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin:
|
|
17
|
+
const { information, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, origin: built_in_proc_name_1.BuiltInProcName.Pipe });
|
|
18
18
|
if (args.length !== 2) {
|
|
19
19
|
logger_1.dataflowLogger.warn(`Pipe ${identifier_1.Identifier.toString(name.content)} has something else than 2 arguments, skipping`);
|
|
20
20
|
return information;
|
|
@@ -3,13 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.processQuote = processQuote;
|
|
4
4
|
const known_call_handling_1 = require("../known-call-handling");
|
|
5
5
|
const edge_1 = require("../../../../../graph/edge");
|
|
6
|
-
const
|
|
6
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
7
7
|
/**
|
|
8
8
|
* Process a call to `quote` or similar nse/substitution functions.
|
|
9
9
|
*/
|
|
10
10
|
function processQuote(name, args, rootId, data, config) {
|
|
11
11
|
const startEnv = data.environment;
|
|
12
|
-
const { information, processedArguments, fnRef } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin:
|
|
12
|
+
const { information, processedArguments, fnRef } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs, origin: built_in_proc_name_1.BuiltInProcName.Quote });
|
|
13
13
|
let inRefs = [fnRef];
|
|
14
14
|
let outRefs = [];
|
|
15
15
|
let unknownRefs = [];
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.processRecall = processRecall;
|
|
4
4
|
const known_call_handling_1 = require("../known-call-handling");
|
|
5
|
-
const built_in_1 = require("../../../../../environments/built-in");
|
|
6
5
|
const log_1 = require("../../../../../../util/log");
|
|
7
6
|
const edge_1 = require("../../../../../graph/edge");
|
|
8
7
|
const vertex_1 = require("../../../../../graph/vertex");
|
|
9
8
|
const unnamed_call_handling_1 = require("../unnamed-call-handling");
|
|
10
9
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
10
|
+
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
11
11
|
/**
|
|
12
12
|
* Processes a built-in 'Recall' function call, linking
|
|
13
13
|
* the recall to the enveloping function closure.
|
|
@@ -18,7 +18,7 @@ function processRecall(name, args, rootId, data) {
|
|
|
18
18
|
args,
|
|
19
19
|
rootId,
|
|
20
20
|
data,
|
|
21
|
-
origin:
|
|
21
|
+
origin: built_in_proc_name_1.BuiltInProcName.Recall
|
|
22
22
|
});
|
|
23
23
|
let cur = data.environment.current;
|
|
24
24
|
let closure;
|
|
@@ -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';
|