@eagleoutice/flowr 2.9.13 → 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 +22 -10
- 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/cli/repl/commands/repl-dataflow.js +5 -5
- 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.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 +8 -8
- 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 +1 -0
- package/dataflow/environments/identifier.js +1 -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 +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 +6 -1
- 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 +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 +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 +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/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-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 +1 -0
- package/documentation/wiki-normalized-ast.js +5 -4
- package/documentation/wiki-query.js +28 -3
- package/linter/linter-rules.d.ts +24 -1
- package/linter/linter-rules.js +3 -1
- 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 +1 -1
- 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/does-call-query/does-call-query-executor.js +2 -2
- 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-higher-order-query/inspect-higher-order-query-executor.js +3 -3
- package/queries/catalog/location-map-query/location-map-query-executor.js +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/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 +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 +9 -1
- package/queries/query.js +2 -0
- package/r-bridge/lang-4.x/ast/model/model.d.ts +6 -0
- package/r-bridge/lang-4.x/ast/model/model.js +7 -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/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/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/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
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BuiltIns = exports.BuiltInEvalHandlerMapper = exports.BuiltInProcessorMapper =
|
|
3
|
+
exports.BuiltIns = exports.BuiltInEvalHandlerMapper = exports.BuiltInProcessorMapper = void 0;
|
|
4
4
|
const known_call_handling_1 = require("../internal/process/functions/call/known-call-handling");
|
|
5
5
|
const built_in_access_1 = require("../internal/process/functions/call/built-in/built-in-access");
|
|
6
6
|
const built_in_if_then_else_1 = require("../internal/process/functions/call/built-in/built-in-if-then-else");
|
|
@@ -40,7 +40,8 @@ const built_in_recall_1 = require("../internal/process/functions/call/built-in/b
|
|
|
40
40
|
const built_in_s_seven_new_generic_1 = require("../internal/process/functions/call/built-in/built-in-s-seven-new-generic");
|
|
41
41
|
const built_in_s_seven_dispatch_1 = require("../internal/process/functions/call/built-in/built-in-s-seven-dispatch");
|
|
42
42
|
const r_string_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
43
|
-
|
|
43
|
+
const built_in_proc_name_1 = require("./built-in-proc-name");
|
|
44
|
+
function defaultBuiltInProcessor(name, args, rootId, data, { returnsNthArgument, useAsProcessor = built_in_proc_name_1.BuiltInProcName.Default, forceArgs, readAllArguments, cfg, hasUnknownSideEffects, treatAsFnCall }) {
|
|
44
45
|
const { information: res, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs, origin: useAsProcessor });
|
|
45
46
|
if (returnsNthArgument !== undefined) {
|
|
46
47
|
const arg = returnsNthArgument === 'last' ? processedArguments.at(-1) : processedArguments[returnsNthArgument];
|
|
@@ -99,7 +100,7 @@ function defaultBuiltInProcessor(name, args, rootId, data, { returnsNthArgument,
|
|
|
99
100
|
}
|
|
100
101
|
return res;
|
|
101
102
|
}
|
|
102
|
-
function defaultBuiltInProcessorReadallArgs(name, args, rootId, data, { useAsProcessor = BuiltInProcName.Default, forceArgs }) {
|
|
103
|
+
function defaultBuiltInProcessorReadallArgs(name, args, rootId, data, { useAsProcessor = built_in_proc_name_1.BuiltInProcName.Default, forceArgs }) {
|
|
103
104
|
const { information, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs, origin: useAsProcessor });
|
|
104
105
|
const g = information.graph;
|
|
105
106
|
for (const arg of processedArguments) {
|
|
@@ -109,122 +110,38 @@ function defaultBuiltInProcessorReadallArgs(name, args, rootId, data, { useAsPro
|
|
|
109
110
|
}
|
|
110
111
|
return information;
|
|
111
112
|
}
|
|
112
|
-
/**
|
|
113
|
-
* This contains all names of built-in function handlers and origins
|
|
114
|
-
*/
|
|
115
|
-
var BuiltInProcName;
|
|
116
|
-
(function (BuiltInProcName) {
|
|
117
|
-
/** for subsetting operations, see {@link processAccess} */
|
|
118
|
-
BuiltInProcName["Access"] = "builtin:access";
|
|
119
|
-
/** for the `*apply` family, see {@link processApply} */
|
|
120
|
-
BuiltInProcName["Apply"] = "builtin:apply";
|
|
121
|
-
/** for assignments like `<-` and `=`, see {@link processAssignment} */
|
|
122
|
-
BuiltInProcName["Assignment"] = "builtin:assignment";
|
|
123
|
-
/** for assignment like functions that may do additional work, see {@link processAssignmentLike} */
|
|
124
|
-
BuiltInProcName["AssignmentLike"] = "builtin:assignment-like";
|
|
125
|
-
/** for `break` calls */
|
|
126
|
-
BuiltInProcName["Break"] = "builtin:break";
|
|
127
|
-
/** the default built-in processor, see {@link defaultBuiltInProcessor} */
|
|
128
|
-
BuiltInProcName["Default"] = "builtin:default";
|
|
129
|
-
/** Just a more performant variant of the default processor for built-ins that need to read all their arguments, see {@link defaultBuiltInProcessor}, this will still produce the origin `BuiltIn.Default` */
|
|
130
|
-
BuiltInProcName["DefaultReadAllArgs"] = "builtin:default-read-all-args";
|
|
131
|
-
/** for `eval` calls, see {@link processEvalCall} */
|
|
132
|
-
BuiltInProcName["Eval"] = "builtin:eval";
|
|
133
|
-
/** for expression lists, see {@link processExpressionList} */
|
|
134
|
-
BuiltInProcName["ExpressionList"] = "builtin:expression-list";
|
|
135
|
-
/** for `for` loops, see {@link processForLoop} */
|
|
136
|
-
BuiltInProcName["ForLoop"] = "builtin:for-loop";
|
|
137
|
-
/** We resolved a function call, similar to {@link BuiltInProcName#Default} */
|
|
138
|
-
BuiltInProcName["Function"] = "function";
|
|
139
|
-
/** for function definitions, see {@link processFunctionDefinition} */
|
|
140
|
-
BuiltInProcName["FunctionDefinition"] = "builtin:function-definition";
|
|
141
|
-
/** for `get` calls, see {@link processGet} */
|
|
142
|
-
BuiltInProcName["Get"] = "builtin:get";
|
|
143
|
-
/** for `if-then-else` constructs, see {@link processIfThenElse} */
|
|
144
|
-
BuiltInProcName["IfThenElse"] = "builtin:if-then-else";
|
|
145
|
-
/** for `library` and `require` calls, see {@link processLibrary} */
|
|
146
|
-
BuiltInProcName["Library"] = "builtin:library";
|
|
147
|
-
/** for `list` calls, see {@link processList} */
|
|
148
|
-
BuiltInProcName["List"] = "builtin:list";
|
|
149
|
-
/** for `local` calls, see {@link processLocal} */
|
|
150
|
-
BuiltInProcName["Local"] = "builtin:local";
|
|
151
|
-
/** for the pipe operators, see {@link processPipe} */
|
|
152
|
-
BuiltInProcName["Pipe"] = "builtin:pipe";
|
|
153
|
-
/** for `quote`, and other substituting calls, see {@link processQuote} */
|
|
154
|
-
BuiltInProcName["Quote"] = "builtin:quote";
|
|
155
|
-
/**
|
|
156
|
-
* for `recall` calls, see {@link processRecall}
|
|
157
|
-
*/
|
|
158
|
-
BuiltInProcName["Recall"] = "builtin:recall";
|
|
159
|
-
/** for `on.exìt` and other hooks, see {@link processRegisterHook} */
|
|
160
|
-
BuiltInProcName["RegisterHook"] = "builtin:register-hook";
|
|
161
|
-
/** for `repeat` loops, see {@link processRepeatLoop} */
|
|
162
|
-
BuiltInProcName["RepeatLoop"] = "builtin:repeat-loop";
|
|
163
|
-
/** for replacement functions like `names<-`, see {@link processReplacementFunction} */
|
|
164
|
-
BuiltInProcName["Replacement"] = "builtin:replacement";
|
|
165
|
-
/** for `return` calls */
|
|
166
|
-
BuiltInProcName["Return"] = "builtin:return";
|
|
167
|
-
/** for `rm` calls, see {@link processRm} */
|
|
168
|
-
BuiltInProcName["Rm"] = "builtin:rm";
|
|
169
|
-
/** for `UseMethod` calls, see {@link processS3Dispatch} */
|
|
170
|
-
BuiltInProcName["S3Dispatch"] = "builtin:s3-dispatch";
|
|
171
|
-
/** for `NextMethod` calls, see {@link processS3Dispatch} */
|
|
172
|
-
BuiltInProcName["S3DispatchNext"] = "builtin:s3-dispatch-next";
|
|
173
|
-
/** for `new.generic` calls, see {@link processS7NewGeneric} */
|
|
174
|
-
BuiltInProcName["S7NewGeneric"] = "builtin:s7-new-generic";
|
|
175
|
-
/** for `S7_dispatch` calls (and their implicit creations), see {@link processS7Dispatch} */
|
|
176
|
-
BuiltInProcName["S7Dispatch"] = "builtin:s7-dispatch";
|
|
177
|
-
/** for `source` calls, see {@link processSourceCall} */
|
|
178
|
-
BuiltInProcName["Source"] = "builtin:source";
|
|
179
|
-
/** for special binary operators like `%x%`, see {@link processSpecialBinOp} */
|
|
180
|
-
BuiltInProcName["SpecialBinOp"] = "builtin:special-bin-op";
|
|
181
|
-
/** for `stop` calls */
|
|
182
|
-
BuiltInProcName["Stop"] = "builtin:stop";
|
|
183
|
-
/** for `stopifnot` calls, see {@link processStopIfNot} */
|
|
184
|
-
BuiltInProcName["StopIfNot"] = "builtin:stopifnot";
|
|
185
|
-
/** support for `:=` in subsetting assignments, see {@link processAccess} */
|
|
186
|
-
BuiltInProcName["TableAssignment"] = "table:assign";
|
|
187
|
-
/** for `try` calls, see {@link processTryCatch} */
|
|
188
|
-
BuiltInProcName["Try"] = "builtin:try";
|
|
189
|
-
/** for unnamed directly-linked function calls */
|
|
190
|
-
BuiltInProcName["Unnamed"] = "unnamed";
|
|
191
|
-
/** for vector construction calls, see {@link processVector} */
|
|
192
|
-
BuiltInProcName["Vector"] = "builtin:vector";
|
|
193
|
-
/** for `while` loops, see {@link processWhileLoop} */
|
|
194
|
-
BuiltInProcName["WhileLoop"] = "builtin:while-loop";
|
|
195
|
-
})(BuiltInProcName || (exports.BuiltInProcName = BuiltInProcName = {}));
|
|
196
113
|
exports.BuiltInProcessorMapper = {
|
|
197
|
-
[BuiltInProcName.Access]: built_in_access_1.processAccess,
|
|
198
|
-
[BuiltInProcName.Apply]: built_in_apply_1.processApply,
|
|
199
|
-
[BuiltInProcName.Assignment]: built_in_assignment_1.processAssignment,
|
|
200
|
-
[BuiltInProcName.AssignmentLike]: built_in_assignment_1.processAssignmentLike,
|
|
201
|
-
[BuiltInProcName.Default]: defaultBuiltInProcessor,
|
|
202
|
-
[BuiltInProcName.DefaultReadAllArgs]: defaultBuiltInProcessorReadallArgs,
|
|
203
|
-
[BuiltInProcName.Eval]: built_in_eval_1.processEvalCall,
|
|
204
|
-
[BuiltInProcName.ExpressionList]: built_in_expression_list_1.processExpressionList,
|
|
205
|
-
[BuiltInProcName.ForLoop]: built_in_for_loop_1.processForLoop,
|
|
206
|
-
[BuiltInProcName.FunctionDefinition]: built_in_function_definition_1.processFunctionDefinition,
|
|
207
|
-
[BuiltInProcName.Get]: built_in_get_1.processGet,
|
|
208
|
-
[BuiltInProcName.IfThenElse]: built_in_if_then_else_1.processIfThenElse,
|
|
209
|
-
[BuiltInProcName.Library]: built_in_library_1.processLibrary,
|
|
210
|
-
[BuiltInProcName.List]: built_in_list_1.processList,
|
|
211
|
-
[BuiltInProcName.Local]: built_in_local_1.processLocal,
|
|
212
|
-
[BuiltInProcName.Pipe]: built_in_pipe_1.processPipe,
|
|
213
|
-
[BuiltInProcName.Quote]: built_in_quote_1.processQuote,
|
|
214
|
-
[BuiltInProcName.Recall]: built_in_recall_1.processRecall,
|
|
215
|
-
[BuiltInProcName.RegisterHook]: built_in_register_hook_1.processRegisterHook,
|
|
216
|
-
[BuiltInProcName.RepeatLoop]: built_in_repeat_loop_1.processRepeatLoop,
|
|
217
|
-
[BuiltInProcName.Replacement]: built_in_replacement_1.processReplacementFunction,
|
|
218
|
-
[BuiltInProcName.Rm]: built_in_rm_1.processRm,
|
|
219
|
-
[BuiltInProcName.S3Dispatch]: built_in_s_three_dispatch_1.processS3Dispatch,
|
|
220
|
-
[BuiltInProcName.S7NewGeneric]: built_in_s_seven_new_generic_1.processS7NewGeneric,
|
|
221
|
-
[BuiltInProcName.S7Dispatch]: built_in_s_seven_dispatch_1.processS7Dispatch,
|
|
222
|
-
[BuiltInProcName.Source]: built_in_source_1.processSourceCall,
|
|
223
|
-
[BuiltInProcName.SpecialBinOp]: built_in_special_bin_op_1.processSpecialBinOp,
|
|
224
|
-
[BuiltInProcName.StopIfNot]: built_in_stop_if_not_1.processStopIfNot,
|
|
225
|
-
[BuiltInProcName.Try]: built_in_try_catch_1.processTryCatch,
|
|
226
|
-
[BuiltInProcName.Vector]: built_in_vector_1.processVector,
|
|
227
|
-
[BuiltInProcName.WhileLoop]: built_in_while_loop_1.processWhileLoop,
|
|
114
|
+
[built_in_proc_name_1.BuiltInProcName.Access]: built_in_access_1.processAccess,
|
|
115
|
+
[built_in_proc_name_1.BuiltInProcName.Apply]: built_in_apply_1.processApply,
|
|
116
|
+
[built_in_proc_name_1.BuiltInProcName.Assignment]: built_in_assignment_1.processAssignment,
|
|
117
|
+
[built_in_proc_name_1.BuiltInProcName.AssignmentLike]: built_in_assignment_1.processAssignmentLike,
|
|
118
|
+
[built_in_proc_name_1.BuiltInProcName.Default]: defaultBuiltInProcessor,
|
|
119
|
+
[built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs]: defaultBuiltInProcessorReadallArgs,
|
|
120
|
+
[built_in_proc_name_1.BuiltInProcName.Eval]: built_in_eval_1.processEvalCall,
|
|
121
|
+
[built_in_proc_name_1.BuiltInProcName.ExpressionList]: built_in_expression_list_1.processExpressionList,
|
|
122
|
+
[built_in_proc_name_1.BuiltInProcName.ForLoop]: built_in_for_loop_1.processForLoop,
|
|
123
|
+
[built_in_proc_name_1.BuiltInProcName.FunctionDefinition]: built_in_function_definition_1.processFunctionDefinition,
|
|
124
|
+
[built_in_proc_name_1.BuiltInProcName.Get]: built_in_get_1.processGet,
|
|
125
|
+
[built_in_proc_name_1.BuiltInProcName.IfThenElse]: built_in_if_then_else_1.processIfThenElse,
|
|
126
|
+
[built_in_proc_name_1.BuiltInProcName.Library]: built_in_library_1.processLibrary,
|
|
127
|
+
[built_in_proc_name_1.BuiltInProcName.List]: built_in_list_1.processList,
|
|
128
|
+
[built_in_proc_name_1.BuiltInProcName.Local]: built_in_local_1.processLocal,
|
|
129
|
+
[built_in_proc_name_1.BuiltInProcName.Pipe]: built_in_pipe_1.processPipe,
|
|
130
|
+
[built_in_proc_name_1.BuiltInProcName.Quote]: built_in_quote_1.processQuote,
|
|
131
|
+
[built_in_proc_name_1.BuiltInProcName.Recall]: built_in_recall_1.processRecall,
|
|
132
|
+
[built_in_proc_name_1.BuiltInProcName.RegisterHook]: built_in_register_hook_1.processRegisterHook,
|
|
133
|
+
[built_in_proc_name_1.BuiltInProcName.RepeatLoop]: built_in_repeat_loop_1.processRepeatLoop,
|
|
134
|
+
[built_in_proc_name_1.BuiltInProcName.Replacement]: built_in_replacement_1.processReplacementFunction,
|
|
135
|
+
[built_in_proc_name_1.BuiltInProcName.Rm]: built_in_rm_1.processRm,
|
|
136
|
+
[built_in_proc_name_1.BuiltInProcName.S3Dispatch]: built_in_s_three_dispatch_1.processS3Dispatch,
|
|
137
|
+
[built_in_proc_name_1.BuiltInProcName.S7NewGeneric]: built_in_s_seven_new_generic_1.processS7NewGeneric,
|
|
138
|
+
[built_in_proc_name_1.BuiltInProcName.S7Dispatch]: built_in_s_seven_dispatch_1.processS7Dispatch,
|
|
139
|
+
[built_in_proc_name_1.BuiltInProcName.Source]: built_in_source_1.processSourceCall,
|
|
140
|
+
[built_in_proc_name_1.BuiltInProcName.SpecialBinOp]: built_in_special_bin_op_1.processSpecialBinOp,
|
|
141
|
+
[built_in_proc_name_1.BuiltInProcName.StopIfNot]: built_in_stop_if_not_1.processStopIfNot,
|
|
142
|
+
[built_in_proc_name_1.BuiltInProcName.Try]: built_in_try_catch_1.processTryCatch,
|
|
143
|
+
[built_in_proc_name_1.BuiltInProcName.Vector]: built_in_vector_1.processVector,
|
|
144
|
+
[built_in_proc_name_1.BuiltInProcName.WhileLoop]: built_in_while_loop_1.processWhileLoop,
|
|
228
145
|
};
|
|
229
146
|
exports.BuiltInEvalHandlerMapper = {
|
|
230
147
|
'built-in:c': resolve_1.resolveAsVector,
|
|
@@ -278,8 +195,8 @@ class BuiltIns {
|
|
|
278
195
|
* Registers all combinations of replacements
|
|
279
196
|
*/
|
|
280
197
|
registerReplacementFunctions({ names, suffixes, assumePrimitive, config }) {
|
|
281
|
-
const replacer = exports.BuiltInProcessorMapper[BuiltInProcName.Replacement];
|
|
282
|
-
(0, assert_1.guard)(replacer !== undefined, () => `Processor for ${BuiltInProcName.Replacement} is undefined!`);
|
|
198
|
+
const replacer = exports.BuiltInProcessorMapper[built_in_proc_name_1.BuiltInProcName.Replacement];
|
|
199
|
+
(0, assert_1.guard)(replacer !== undefined, () => `Processor for ${built_in_proc_name_1.BuiltInProcName.Replacement} is undefined!`);
|
|
283
200
|
for (const assignment of names) {
|
|
284
201
|
for (const suffix of suffixes) {
|
|
285
202
|
const effectiveName = `${identifier_1.Identifier.getName(assignment)}${suffix}`;
|
|
@@ -3,9 +3,9 @@ import type { DataflowGraph } from '../graph/graph';
|
|
|
3
3
|
import type { DataflowGraphVertexFunctionCall } from '../graph/vertex';
|
|
4
4
|
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
5
5
|
import { CascadeAction } from '../../queries/catalog/call-context-query/cascade-action';
|
|
6
|
-
import { BuiltInProcName } from './built-in';
|
|
7
6
|
import { KnownHooks } from '../hooks';
|
|
8
7
|
import { Identifier } from './identifier';
|
|
8
|
+
import { BuiltInProcName } from './built-in-proc-name';
|
|
9
9
|
export declare const GgPlotCreate: readonly ["ggplot", "ggplotly", "ggMarginal", "ggcorrplot", "ggseasonplot", "ggdendrogram", "qmap", "qplot", "quickplot", "autoplot", "grid.arrange", "fviz_pca_biplot", "fviz_pca", "fviz_pca_ind", "fviz_pca_var", "fviz_screeplot", "fviz_mca_biplot", "fviz_mca", "fviz_mca_ind", "fviz_mca_var", "fviz_cluster", "fviz_dend", "ggsurvplot"];
|
|
10
10
|
export declare const TinyPlotCrate: readonly ["tinyplot", "plt"];
|
|
11
11
|
export declare const GraphicsPlotCreate: string[];
|
|
@@ -5,10 +5,10 @@ exports.getDefaultProcessor = getDefaultProcessor;
|
|
|
5
5
|
const identify_link_to_last_call_relation_1 = require("../../queries/catalog/call-context-query/identify-link-to-last-call-relation");
|
|
6
6
|
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
7
7
|
const cascade_action_1 = require("../../queries/catalog/call-context-query/cascade-action");
|
|
8
|
-
const built_in_1 = require("./built-in");
|
|
9
8
|
const unnamed_call_handling_1 = require("../internal/process/functions/call/unnamed-call-handling");
|
|
10
9
|
const hooks_1 = require("../hooks");
|
|
11
10
|
const identifier_1 = require("./identifier");
|
|
11
|
+
const built_in_proc_name_1 = require("./built-in-proc-name");
|
|
12
12
|
exports.GgPlotCreate = [
|
|
13
13
|
'ggplot', 'ggplotly', 'ggMarginal', 'ggcorrplot', 'ggseasonplot', 'ggdendrogram', 'qmap', 'qplot', 'quickplot', 'autoplot', 'grid.arrange',
|
|
14
14
|
'fviz_pca_biplot', 'fviz_pca', 'fviz_pca_ind', 'fviz_pca_var', 'fviz_screeplot', 'fviz_mca_biplot', 'fviz_mca', 'fviz_mca_ind', 'fviz_mca_var', 'fviz_cluster', 'fviz_dend',
|
|
@@ -112,7 +112,7 @@ exports.DefaultBuiltinConfig = [
|
|
|
112
112
|
'pdf', 'jpeg', 'png', 'windows', 'postscript', 'xfig', 'bitmap', 'pictex', 'cairo_pdf', 'svg', 'bmp', 'tiff', 'X11', 'quartz',
|
|
113
113
|
'jitter'
|
|
114
114
|
],
|
|
115
|
-
processor:
|
|
115
|
+
processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
|
|
116
116
|
config: {},
|
|
117
117
|
assumePrimitive: true
|
|
118
118
|
},
|
|
@@ -121,20 +121,20 @@ exports.DefaultBuiltinConfig = [
|
|
|
121
121
|
names: [
|
|
122
122
|
't', 'aperm' /* transpose function, permutation generation */
|
|
123
123
|
],
|
|
124
|
-
processor:
|
|
124
|
+
processor: built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs,
|
|
125
125
|
config: {},
|
|
126
126
|
assumePrimitive: false
|
|
127
127
|
},
|
|
128
|
-
{ type: 'function', names: ['rm'], processor:
|
|
129
|
-
{ type: 'function', names: ['options'], processor:
|
|
130
|
-
{ type: 'function', names: ['mapply', 'Mapply'], processor:
|
|
131
|
-
{ type: 'function', names: ['lapply', 'sapply', 'vapply'], processor:
|
|
132
|
-
{ type: 'function', names: ['Lapply', 'Sapply', 'Vapply'], processor:
|
|
133
|
-
{ type: 'function', names: ['apply', 'tapply', 'Tapply'], processor:
|
|
134
|
-
{ type: 'function', names: ['print', 'message', 'warning', 'warn', 'info'], processor:
|
|
128
|
+
{ type: 'function', names: ['rm'], processor: built_in_proc_name_1.BuiltInProcName.Rm, config: {}, assumePrimitive: true },
|
|
129
|
+
{ type: 'function', names: ['options'], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: 'all' }, assumePrimitive: false },
|
|
130
|
+
{ type: 'function', names: ['mapply', 'Mapply'], processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, nameOfFunctionArgument: 'FUN' }, assumePrimitive: false },
|
|
131
|
+
{ type: 'function', names: ['lapply', 'sapply', 'vapply'], processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 1, nameOfFunctionArgument: 'FUN' }, assumePrimitive: false },
|
|
132
|
+
{ type: 'function', names: ['Lapply', 'Sapply', 'Vapply'], processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 1, nameOfFunctionArgument: 'FUN' }, assumePrimitive: false }, /* functool wrappers */
|
|
133
|
+
{ type: 'function', names: ['apply', 'tapply', 'Tapply'], processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 2, nameOfFunctionArgument: 'FUN' }, assumePrimitive: false },
|
|
134
|
+
{ type: 'function', names: ['print', 'message', 'warning', 'warn', 'info'], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { returnsNthArgument: 0, forceArgs: 'all', hasUnknownSideEffects: { type: 'link-to-last-call', callName: /^sink$/ } }, assumePrimitive: false },
|
|
135
135
|
// graphics base
|
|
136
136
|
{ type: 'function', names: exports.PlotCreate,
|
|
137
|
-
processor:
|
|
137
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
138
138
|
config: {
|
|
139
139
|
forceArgs: 'all',
|
|
140
140
|
hasUnknownSideEffects: {
|
|
@@ -151,7 +151,7 @@ exports.DefaultBuiltinConfig = [
|
|
|
151
151
|
}, assumePrimitive: true },
|
|
152
152
|
// graphics addons
|
|
153
153
|
{ type: 'function', names: PlotAddons,
|
|
154
|
-
processor:
|
|
154
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default, config: {
|
|
155
155
|
forceArgs: 'all',
|
|
156
156
|
treatAsFnCall: {
|
|
157
157
|
'facet_grid': ['labeller']
|
|
@@ -180,7 +180,7 @@ exports.DefaultBuiltinConfig = [
|
|
|
180
180
|
{
|
|
181
181
|
type: 'function',
|
|
182
182
|
names: exports.GgPlotAddons,
|
|
183
|
-
processor:
|
|
183
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
184
184
|
config: {
|
|
185
185
|
libFn: true,
|
|
186
186
|
forceArgs: 'all',
|
|
@@ -193,7 +193,7 @@ exports.DefaultBuiltinConfig = [
|
|
|
193
193
|
{
|
|
194
194
|
type: 'function',
|
|
195
195
|
names: exports.TinyPlotAddons,
|
|
196
|
-
processor:
|
|
196
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
197
197
|
config: {
|
|
198
198
|
libFn: true,
|
|
199
199
|
forceArgs: 'all',
|
|
@@ -206,7 +206,7 @@ exports.DefaultBuiltinConfig = [
|
|
|
206
206
|
{
|
|
207
207
|
type: 'function',
|
|
208
208
|
names: ['image_write', 'image_capture', 'dev.capture', 'dev.off'],
|
|
209
|
-
processor:
|
|
209
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
210
210
|
config: {
|
|
211
211
|
libFn: true,
|
|
212
212
|
forceArgs: 'all',
|
|
@@ -216,12 +216,12 @@ exports.DefaultBuiltinConfig = [
|
|
|
216
216
|
}
|
|
217
217
|
}, assumePrimitive: true
|
|
218
218
|
},
|
|
219
|
-
{ type: 'function', names: ['('], processor:
|
|
220
|
-
{ type: 'function', names: ['load', 'load_all', 'setwd', 'set.seed'], processor:
|
|
221
|
-
{ type: 'function', names: ['body', 'formals', 'environment'], processor:
|
|
219
|
+
{ type: 'function', names: ['('], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { returnsNthArgument: 0 }, assumePrimitive: true },
|
|
220
|
+
{ type: 'function', names: ['load', 'load_all', 'setwd', 'set.seed'], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: [true] }, assumePrimitive: false },
|
|
221
|
+
{ type: 'function', names: ['body', 'formals', 'environment'], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { hasUnknownSideEffects: true, forceArgs: [true] }, assumePrimitive: true },
|
|
222
222
|
{ type: 'function',
|
|
223
223
|
names: ['.Call', '.External', '.C', '.Fortran'],
|
|
224
|
-
processor:
|
|
224
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
225
225
|
config: { hasUnknownSideEffects: true, forceArgs: [true],
|
|
226
226
|
treatAsFnCall: {
|
|
227
227
|
'.Call': ['.NAME'],
|
|
@@ -230,64 +230,64 @@ exports.DefaultBuiltinConfig = [
|
|
|
230
230
|
'.Fortran': ['.NAME']
|
|
231
231
|
}
|
|
232
232
|
}, assumePrimitive: true },
|
|
233
|
-
{ type: 'function', names: ['eval'], processor:
|
|
234
|
-
{ type: 'function', names: ['cat'], processor:
|
|
235
|
-
{ type: 'function', names: ['switch'], processor:
|
|
236
|
-
{ type: 'function', names: ['return'], processor:
|
|
233
|
+
{ type: 'function', names: ['eval'], processor: built_in_proc_name_1.BuiltInProcName.Eval, config: { includeFunctionCall: true }, assumePrimitive: true },
|
|
234
|
+
{ type: 'function', names: ['cat'], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: 'all', hasUnknownSideEffects: { type: 'link-to-last-call', callName: /^sink$/ } }, assumePrimitive: false },
|
|
235
|
+
{ type: 'function', names: ['switch'], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { forceArgs: [true] }, assumePrimitive: false },
|
|
236
|
+
{ type: 'function', names: ['return'], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { returnsNthArgument: 0, cfg: 1 /* ExitPointType.Return */, useAsProcessor: built_in_proc_name_1.BuiltInProcName.Return }, assumePrimitive: true },
|
|
237
237
|
{
|
|
238
238
|
type: 'function',
|
|
239
239
|
names: ['stop', 'abort', 'cli_abort', 'throw', 'stop_bad_type', 'stop_bad_element_type', 'stop_bad_element_length'],
|
|
240
|
-
processor:
|
|
241
|
-
config: { useAsProcessor:
|
|
240
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
241
|
+
config: { useAsProcessor: built_in_proc_name_1.BuiltInProcName.Stop, cfg: 4 /* ExitPointType.Error */, forceArgs: ['all'] },
|
|
242
242
|
assumePrimitive: false
|
|
243
243
|
},
|
|
244
|
-
{ type: 'function', names: ['try'], processor:
|
|
245
|
-
{ type: 'function', names: ['tryCatch', 'tryCatchLog'], processor:
|
|
246
|
-
{ type: 'function', names: ['stopifnot', 'assert_that'], processor:
|
|
247
|
-
{ type: 'function', names: ['break'], processor:
|
|
248
|
-
{ type: 'function', names: ['next'], processor:
|
|
249
|
-
{ type: 'function', names: ['{'], processor:
|
|
250
|
-
{ type: 'function', names: ['source'], processor:
|
|
251
|
-
{ type: 'function', names: ['[', '[['], processor:
|
|
252
|
-
{ type: 'function', names: ['$', '@'], processor:
|
|
253
|
-
{ type: 'function', names: ['if'], processor:
|
|
254
|
-
{ type: 'function', names: ['ifelse', 'fifelse', 'IfElse'], processor:
|
|
255
|
-
{ type: 'function', names: ['if_else'], processor:
|
|
256
|
-
{ type: 'function', names: ['get'], processor:
|
|
257
|
-
{ type: 'function', names: [identifier_1.Identifier.make('library', 'base'), identifier_1.Identifier.make('require', 'base')], processor:
|
|
258
|
-
{ type: 'function', names: ['<-', '='], processor:
|
|
259
|
-
{ type: 'function', names: [':='], processor:
|
|
260
|
-
{ type: 'function', names: ['assign', 'setValidity'], processor:
|
|
261
|
-
{ type: 'function', names: ['setMethod'], processor:
|
|
262
|
-
{ type: 'function', names: ['delayedAssign'], processor:
|
|
263
|
-
{ type: 'function', names: ['<<-'], processor:
|
|
264
|
-
{ type: 'function', names: ['->'], processor:
|
|
265
|
-
{ type: 'function', names: ['->>'], processor:
|
|
266
|
-
{ type: 'function', names: ['&&', '&'], processor:
|
|
267
|
-
{ type: 'function', names: ['||', '|'], processor:
|
|
268
|
-
{ type: 'function', names: ['|>', '%>%'], processor:
|
|
269
|
-
{ type: 'function', names: ['function', '\\'], processor:
|
|
270
|
-
{ type: 'function', names: ['quote', 'substitute', 'bquote'], processor:
|
|
271
|
-
{ type: 'function', names: ['local'], processor:
|
|
272
|
-
{ type: 'function', names: ['for'], processor:
|
|
273
|
-
{ type: 'function', names: ['repeat'], processor:
|
|
274
|
-
{ type: 'function', names: ['while'], processor:
|
|
275
|
-
{ type: 'function', names: ['do.call'], processor:
|
|
276
|
-
{ type: 'function', names: ['UseMethod'], processor:
|
|
277
|
-
{ type: 'function', names: ['NextMethod'], processor:
|
|
278
|
-
{ type: 'function', names: ['new_generic'], processor:
|
|
279
|
-
{ type: 'function', names: ['setGeneric'], processor:
|
|
280
|
-
{ type: 'function', names: ['S7_dispatch'], processor:
|
|
281
|
-
{ type: 'function', names: ['.Primitive', '.Internal'], processor:
|
|
282
|
-
{ type: 'function', names: ['interference'], processor:
|
|
283
|
-
{ type: 'function', names: ['ddply'], processor:
|
|
284
|
-
{ type: 'function', names: ['list'], processor:
|
|
285
|
-
{ type: 'function', names: ['Recall'], processor:
|
|
286
|
-
{ type: 'function', names: ['c'], processor:
|
|
244
|
+
{ type: 'function', names: ['try'], processor: built_in_proc_name_1.BuiltInProcName.Try, config: { block: 'expr', handlers: {} }, assumePrimitive: true },
|
|
245
|
+
{ type: 'function', names: ['tryCatch', 'tryCatchLog'], processor: built_in_proc_name_1.BuiltInProcName.Try, config: { block: 'expr', handlers: { error: 'error', finally: 'finally' } }, assumePrimitive: true },
|
|
246
|
+
{ type: 'function', names: ['stopifnot', 'assert_that'], processor: built_in_proc_name_1.BuiltInProcName.StopIfNot, config: {}, assumePrimitive: false },
|
|
247
|
+
{ type: 'function', names: ['break'], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { useAsProcessor: built_in_proc_name_1.BuiltInProcName.Break, cfg: 2 /* ExitPointType.Break */ }, assumePrimitive: false },
|
|
248
|
+
{ type: 'function', names: ['next'], processor: built_in_proc_name_1.BuiltInProcName.Default, config: { cfg: 3 /* ExitPointType.Next */ }, assumePrimitive: false },
|
|
249
|
+
{ type: 'function', names: ['{'], processor: built_in_proc_name_1.BuiltInProcName.ExpressionList, config: {}, assumePrimitive: true },
|
|
250
|
+
{ type: 'function', names: ['source'], processor: built_in_proc_name_1.BuiltInProcName.Source, config: { includeFunctionCall: true, forceFollow: false }, assumePrimitive: false },
|
|
251
|
+
{ type: 'function', names: ['[', '[['], processor: built_in_proc_name_1.BuiltInProcName.Access, config: { treatIndicesAsString: false }, assumePrimitive: true },
|
|
252
|
+
{ type: 'function', names: ['$', '@'], processor: built_in_proc_name_1.BuiltInProcName.Access, config: { treatIndicesAsString: true }, assumePrimitive: true },
|
|
253
|
+
{ type: 'function', names: ['if'], processor: built_in_proc_name_1.BuiltInProcName.IfThenElse, config: {}, assumePrimitive: true },
|
|
254
|
+
{ type: 'function', names: ['ifelse', 'fifelse', 'IfElse'], processor: built_in_proc_name_1.BuiltInProcName.IfThenElse, config: { args: { cond: 'test', yes: 'yes', no: 'no' } }, assumePrimitive: true },
|
|
255
|
+
{ type: 'function', names: ['if_else'], processor: built_in_proc_name_1.BuiltInProcName.IfThenElse, config: { args: { cond: 'condition', yes: 'true', no: 'false' } }, assumePrimitive: true },
|
|
256
|
+
{ type: 'function', names: ['get'], processor: built_in_proc_name_1.BuiltInProcName.Get, config: {}, assumePrimitive: false },
|
|
257
|
+
{ type: 'function', names: [identifier_1.Identifier.make('library', 'base'), identifier_1.Identifier.make('require', 'base')], processor: built_in_proc_name_1.BuiltInProcName.Library, config: {}, assumePrimitive: false },
|
|
258
|
+
{ type: 'function', names: ['<-', '='], processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { canBeReplacement: true }, assumePrimitive: true },
|
|
259
|
+
{ type: 'function', names: [':='], processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: {}, assumePrimitive: true },
|
|
260
|
+
{ type: 'function', names: ['assign', 'setValidity'], processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { targetVariable: true, mayHaveMoreArgs: true }, assumePrimitive: true },
|
|
261
|
+
{ type: 'function', names: ['setMethod'], processor: built_in_proc_name_1.BuiltInProcName.AssignmentLike, config: { targetVariable: true, canBeReplacement: false, target: { idx: 0, name: 'f' }, source: { idx: 2, name: 'definition' }, modesForFn: ['s4'] }, assumePrimitive: true },
|
|
262
|
+
{ type: 'function', names: ['delayedAssign'], processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { quoteSource: true, targetVariable: true }, assumePrimitive: true },
|
|
263
|
+
{ type: 'function', names: ['<<-'], processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { superAssignment: true, canBeReplacement: true }, assumePrimitive: true },
|
|
264
|
+
{ type: 'function', names: ['->'], processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { swapSourceAndTarget: true, canBeReplacement: true }, assumePrimitive: true },
|
|
265
|
+
{ type: 'function', names: ['->>'], processor: built_in_proc_name_1.BuiltInProcName.Assignment, config: { superAssignment: true, swapSourceAndTarget: true, canBeReplacement: true }, assumePrimitive: true },
|
|
266
|
+
{ type: 'function', names: ['&&', '&'], processor: built_in_proc_name_1.BuiltInProcName.SpecialBinOp, config: { lazy: true, evalRhsWhen: true }, assumePrimitive: true },
|
|
267
|
+
{ type: 'function', names: ['||', '|'], processor: built_in_proc_name_1.BuiltInProcName.SpecialBinOp, config: { lazy: true, evalRhsWhen: false }, assumePrimitive: true },
|
|
268
|
+
{ type: 'function', names: ['|>', '%>%'], processor: built_in_proc_name_1.BuiltInProcName.Pipe, config: {}, assumePrimitive: true },
|
|
269
|
+
{ type: 'function', names: ['function', '\\'], processor: built_in_proc_name_1.BuiltInProcName.FunctionDefinition, config: {}, assumePrimitive: true },
|
|
270
|
+
{ type: 'function', names: ['quote', 'substitute', 'bquote'], processor: built_in_proc_name_1.BuiltInProcName.Quote, config: { quoteArgumentsWithIndex: 0 }, assumePrimitive: true },
|
|
271
|
+
{ type: 'function', names: ['local'], processor: built_in_proc_name_1.BuiltInProcName.Local, config: { args: { env: 'envir', expr: 'expr' } }, assumePrimitive: false },
|
|
272
|
+
{ type: 'function', names: ['for'], processor: built_in_proc_name_1.BuiltInProcName.ForLoop, config: {}, assumePrimitive: true },
|
|
273
|
+
{ type: 'function', names: ['repeat'], processor: built_in_proc_name_1.BuiltInProcName.RepeatLoop, config: {}, assumePrimitive: true },
|
|
274
|
+
{ type: 'function', names: ['while'], processor: built_in_proc_name_1.BuiltInProcName.WhileLoop, config: {}, assumePrimitive: true },
|
|
275
|
+
{ type: 'function', names: ['do.call'], processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, unquoteFunction: true }, assumePrimitive: true },
|
|
276
|
+
{ type: 'function', names: ['UseMethod'], processor: built_in_proc_name_1.BuiltInProcName.S3Dispatch, config: { args: { generic: 'generic', object: 'object' } }, assumePrimitive: true },
|
|
277
|
+
{ type: 'function', names: ['NextMethod'], processor: built_in_proc_name_1.BuiltInProcName.S3Dispatch, config: { args: { generic: 'generic', object: 'object' }, inferFromClosure: true }, assumePrimitive: true },
|
|
278
|
+
{ type: 'function', names: ['new_generic'], processor: built_in_proc_name_1.BuiltInProcName.S7NewGeneric, config: { args: { name: 'name', dispatchArg: 'dispatch_args', fun: 'fun' } }, assumePrimitive: true },
|
|
279
|
+
{ type: 'function', names: ['setGeneric'], processor: built_in_proc_name_1.BuiltInProcName.S7NewGeneric, config: { args: { name: 'name', dispatchArg: undefined, fun: 'fun' } }, assumePrimitive: true },
|
|
280
|
+
{ type: 'function', names: ['S7_dispatch'], processor: built_in_proc_name_1.BuiltInProcName.S7Dispatch, config: { libFn: true }, assumePrimitive: true },
|
|
281
|
+
{ type: 'function', names: ['.Primitive', '.Internal'], processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { indexOfFunction: 0, unquoteFunction: true, resolveInEnvironment: 'global' }, assumePrimitive: true },
|
|
282
|
+
{ type: 'function', names: ['interference'], processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { unquoteFunction: true, nameOfFunctionArgument: 'propensity_integrand', libFn: true }, assumePrimitive: false },
|
|
283
|
+
{ type: 'function', names: ['ddply'], processor: built_in_proc_name_1.BuiltInProcName.Apply, config: { unquoteFunction: true, indexOfFunction: 2, nameOfFunctionArgument: '.fun', libFn: true }, assumePrimitive: false },
|
|
284
|
+
{ type: 'function', names: ['list'], processor: built_in_proc_name_1.BuiltInProcName.List, config: {}, assumePrimitive: true },
|
|
285
|
+
{ type: 'function', names: ['Recall'], processor: built_in_proc_name_1.BuiltInProcName.Recall, config: { libFn: true }, assumePrimitive: false },
|
|
286
|
+
{ type: 'function', names: ['c'], processor: built_in_proc_name_1.BuiltInProcName.Vector, config: {}, assumePrimitive: true, evalHandler: 'built-in:c' },
|
|
287
287
|
{
|
|
288
288
|
type: 'function',
|
|
289
289
|
names: ['setnames', 'setNames', 'setkey', 'setkeyv', 'setindex', 'setindexv', 'setattr'],
|
|
290
|
-
processor:
|
|
290
|
+
processor: built_in_proc_name_1.BuiltInProcName.Assignment,
|
|
291
291
|
config: {
|
|
292
292
|
canBeReplacement: false,
|
|
293
293
|
targetVariable: false,
|
|
@@ -306,7 +306,7 @@ exports.DefaultBuiltinConfig = [
|
|
|
306
306
|
/* file creation/removal */
|
|
307
307
|
'dir.create', 'dir_create', 'Sys.chmod', 'unlink', 'file.remove', 'file.rename', 'file.copy', 'file.link', 'file.append', 'Sys.junction'
|
|
308
308
|
],
|
|
309
|
-
processor:
|
|
309
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
310
310
|
config: { hasUnknownSideEffects: true },
|
|
311
311
|
assumePrimitive: false
|
|
312
312
|
},
|
|
@@ -317,14 +317,14 @@ exports.DefaultBuiltinConfig = [
|
|
|
317
317
|
/* downloader and installer functions (R, devtools, BiocManager) */
|
|
318
318
|
'library.dynam', 'install.packages', 'install', 'install_github', 'install_gitlab', 'install_bitbucket', 'install_url', 'install_git', 'install_svn', 'install_local', 'install_version', 'update_packages',
|
|
319
319
|
],
|
|
320
|
-
processor:
|
|
320
|
+
processor: built_in_proc_name_1.BuiltInProcName.Default,
|
|
321
321
|
config: { hasUnknownSideEffects: true, libFn: true },
|
|
322
322
|
assumePrimitive: false
|
|
323
323
|
},
|
|
324
324
|
{
|
|
325
325
|
type: 'function',
|
|
326
326
|
names: ['on.exit'],
|
|
327
|
-
processor:
|
|
327
|
+
processor: built_in_proc_name_1.BuiltInProcName.RegisterHook,
|
|
328
328
|
config: {
|
|
329
329
|
hook: hooks_1.KnownHooks.OnFnExit,
|
|
330
330
|
args: {
|
|
@@ -367,13 +367,13 @@ exports.DefaultBuiltinConfig = [
|
|
|
367
367
|
*/
|
|
368
368
|
function getDefaultProcessor(name) {
|
|
369
369
|
if (name.startsWith(unnamed_call_handling_1.UnnamedFunctionCallPrefix)) {
|
|
370
|
-
return
|
|
370
|
+
return built_in_proc_name_1.BuiltInProcName.Unnamed;
|
|
371
371
|
}
|
|
372
372
|
const fn = exports.DefaultBuiltinConfig.find(def => (def.names.includes(name) && def.type !== 'constant')
|
|
373
373
|
|| (def.type === 'replacement' && def.suffixes.flatMap(d => def.names.map(n => `${n}${d}`)).includes(name)));
|
|
374
374
|
if (fn?.type === 'replacement') {
|
|
375
|
-
return
|
|
375
|
+
return built_in_proc_name_1.BuiltInProcName.Replacement;
|
|
376
376
|
}
|
|
377
|
-
return fn?.processor ===
|
|
377
|
+
return fn?.processor === built_in_proc_name_1.BuiltInProcName.DefaultReadAllArgs ? built_in_proc_name_1.BuiltInProcName.Default : fn?.processor;
|
|
378
378
|
}
|
|
379
379
|
//# sourceMappingURL=default-builtin-config.js.map
|
|
@@ -33,6 +33,7 @@ export type Identifier = BrandedIdentifier | [id: BrandedIdentifier, namespace:
|
|
|
33
33
|
* ```
|
|
34
34
|
*/
|
|
35
35
|
export declare const Identifier: {
|
|
36
|
+
readonly name: "Identifier";
|
|
36
37
|
/**
|
|
37
38
|
* Create an identifier from its name and optional namespace.
|
|
38
39
|
* Please note that for `internal` to count, a namespace must be provided!
|
|
@@ -9,7 +9,6 @@ const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-
|
|
|
9
9
|
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
10
10
|
const r_value_1 = require("../../../util/r-value");
|
|
11
11
|
const built_in_1 = require("../../environments/built-in");
|
|
12
|
-
const dfg_get_origin_1 = require("../../origin/dfg-get-origin");
|
|
13
12
|
const interval_constants_1 = require("../values/intervals/interval-constants");
|
|
14
13
|
const logical_constants_1 = require("../values/logical/logical-constants");
|
|
15
14
|
const r_value_2 = require("../values/r-value");
|
|
@@ -19,6 +18,7 @@ const alias_tracking_1 = require("./alias-tracking");
|
|
|
19
18
|
const scalar_constants_1 = require("../values/scalar/scalar-constants");
|
|
20
19
|
const identifier_1 = require("../../environments/identifier");
|
|
21
20
|
const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
21
|
+
const df_helper_1 = require("../../graph/df-helper");
|
|
22
22
|
/**
|
|
23
23
|
* Helper function used by {@link resolveIdToValue}, please use that instead, if
|
|
24
24
|
* you want to resolve the value of an identifier / node
|
|
@@ -42,7 +42,7 @@ function resolveNode({ resolve, node, ctx, blocked, environment, graph, idMap })
|
|
|
42
42
|
return { type: 'function-definition' };
|
|
43
43
|
}
|
|
44
44
|
else if ((nt === type_1.RType.FunctionCall || nt === type_1.RType.BinaryOp || nt === type_1.RType.UnaryOp) && graph) {
|
|
45
|
-
const origin =
|
|
45
|
+
const origin = df_helper_1.Dataflow.origin(graph, node.info.id)?.[0];
|
|
46
46
|
if (origin === undefined || origin.type !== 3 /* OriginType.BuiltInFunctionOrigin */) {
|
|
47
47
|
return r_value_2.Top;
|
|
48
48
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
2
|
-
import type { CallGraph } from '../graph/call-graph';
|
|
3
2
|
import type { ControlDependency } from '../info';
|
|
3
|
+
import type { CallGraph } from '../graph/call-graph';
|
|
4
4
|
export interface ExceptionPoint {
|
|
5
5
|
id: NodeId;
|
|
6
6
|
cds?: readonly ControlDependency[];
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.calculateExceptionsOfFunction = calculateExceptionsOfFunction;
|
|
4
4
|
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
5
5
|
const vertex_1 = require("../graph/vertex");
|
|
6
|
-
const
|
|
7
|
-
const CatchHandlers = new Set([
|
|
6
|
+
const built_in_proc_name_1 = require("../environments/built-in-proc-name");
|
|
7
|
+
const CatchHandlers = new Set([built_in_proc_name_1.BuiltInProcName.Try]);
|
|
8
8
|
/**
|
|
9
9
|
* Collect exception sources of a function in the call graph.
|
|
10
10
|
* This returns the `NodeId`s of functions that may throw exceptions when called by the given function.
|