@eagleoutice/flowr 2.8.5 → 2.8.7
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 +14 -14
- package/abstract-interpretation/absint-visitor.d.ts +20 -68
- package/abstract-interpretation/absint-visitor.js +44 -54
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +0 -9
- package/abstract-interpretation/data-frame/dataframe-domain.js +1 -14
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +1 -1
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +2 -0
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +5 -2
- package/abstract-interpretation/data-frame/shape-inference.d.ts +15 -7
- package/abstract-interpretation/data-frame/shape-inference.js +20 -17
- package/abstract-interpretation/domains/abstract-domain.d.ts +1 -1
- package/abstract-interpretation/domains/abstract-domain.js +1 -2
- package/abstract-interpretation/domains/product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/product-domain.js +1 -1
- package/abstract-interpretation/domains/set-range-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-range-domain.js +1 -1
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +3 -1
- package/abstract-interpretation/domains/state-abstract-domain.js +6 -0
- package/abstract-interpretation/normalized-ast-fold.d.ts +2 -1
- package/abstract-interpretation/normalized-ast-fold.js +8 -1
- package/cli/flowr.js +2 -0
- package/cli/repl/commands/repl-execute.js +1 -1
- package/cli/repl/commands/repl-query.js +7 -9
- package/cli/wiki.d.ts +2 -1
- package/cli/wiki.js +2 -0
- package/control-flow/cfg-dead-code.js +3 -0
- package/control-flow/extract-cfg.js +27 -7
- package/control-flow/semantic-cfg-guided-visitor.d.ts +57 -4
- package/control-flow/semantic-cfg-guided-visitor.js +89 -28
- package/control-flow/useless-loop.d.ts +2 -1
- package/control-flow/useless-loop.js +13 -6
- package/dataflow/environments/built-in-config.d.ts +6 -5
- package/dataflow/environments/built-in.d.ts +107 -34
- package/dataflow/environments/built-in.js +115 -39
- package/dataflow/environments/default-builtin-config.d.ts +113 -67
- package/dataflow/environments/default-builtin-config.js +71 -66
- package/dataflow/environments/diff.js +2 -2
- package/dataflow/environments/environment.js +7 -7
- package/dataflow/environments/identifier.d.ts +4 -2
- package/dataflow/environments/identifier.js +2 -0
- package/dataflow/environments/reference-to-maybe.d.ts +2 -2
- package/dataflow/environments/reference-to-maybe.js +11 -11
- package/dataflow/environments/resolve-by-name.js +17 -6
- package/dataflow/eval/resolve/alias-tracking.js +1 -1
- package/dataflow/eval/resolve/resolve.js +6 -6
- package/dataflow/eval/values/intervals/interval-constants.js +3 -3
- package/dataflow/eval/values/scalar/{scalar-consatnts.d.ts → scalar-constants.d.ts} +2 -2
- package/dataflow/eval/values/scalar/{scalar-consatnts.js → scalar-constants.js} +3 -3
- package/dataflow/eval/values/sets/set-constants.d.ts +4 -2
- package/dataflow/eval/values/sets/set-constants.js +4 -2
- package/dataflow/extractor.js +1 -1
- package/dataflow/fn/exceptions-of-function.d.ts +1 -1
- package/dataflow/fn/exceptions-of-function.js +3 -3
- package/dataflow/graph/call-graph.js +2 -2
- package/dataflow/graph/dataflowgraph-builder.d.ts +4 -4
- package/dataflow/graph/dataflowgraph-builder.js +14 -14
- package/dataflow/graph/diff-dataflow-graph.js +3 -3
- package/dataflow/graph/graph.d.ts +1 -1
- package/dataflow/graph/graph.js +4 -4
- package/dataflow/graph/vertex.d.ts +3 -3
- package/dataflow/info.d.ts +3 -3
- package/dataflow/info.js +11 -11
- package/dataflow/internal/linker.d.ts +9 -0
- package/dataflow/internal/linker.js +33 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +16 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +11 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +20 -17
- 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 +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +9 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.d.ts +5 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +11 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +0 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +39 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +12 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +36 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +18 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +67 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +11 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +7 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +18 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +103 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +8 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +13 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +7 -6
- package/dataflow/internal/process/functions/call/common.js +7 -7
- package/dataflow/internal/process/functions/call/known-call-handling.js +7 -8
- package/dataflow/internal/process/functions/call/unnamed-call-handling.d.ts +1 -2
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +6 -6
- package/dataflow/internal/process/functions/process-argument.js +2 -2
- package/dataflow/internal/process/functions/process-parameter.js +3 -3
- package/dataflow/internal/process/process-symbol.js +3 -3
- package/dataflow/internal/process/process-uninteresting-leaf.d.ts +3 -1
- package/dataflow/internal/process/process-uninteresting-leaf.js +3 -1
- package/dataflow/internal/process/process-value.d.ts +1 -1
- package/dataflow/internal/process/process-value.js +4 -4
- package/dataflow/origin/dfg-get-symbol-refs.js +1 -1
- package/dataflow/processor.d.ts +1 -1
- package/documentation/doc-util/doc-structure.js +1 -1
- package/documentation/doc-util/doc-types.d.ts +10 -3
- package/documentation/doc-util/doc-types.js +110 -33
- package/documentation/wiki-absint.d.ts +6 -0
- package/documentation/wiki-absint.js +149 -0
- package/documentation/wiki-analyzer.js +1 -1
- package/documentation/wiki-dataflow-graph.js +12 -11
- package/documentation/wiki-interface.js +2 -1
- package/documentation/wiki-mk/doc-context.d.ts +3 -3
- package/documentation/wiki-mk/doc-context.js +2 -2
- package/documentation/wiki-mk/doc-maker.js +2 -2
- package/documentation/wiki-normalized-ast.d.ts +9 -0
- package/documentation/wiki-normalized-ast.js +40 -52
- package/linter/linter-rules.d.ts +1 -1
- package/linter/rules/seeded-randomness.js +5 -4
- package/linter/rules/useless-loop.d.ts +3 -3
- package/package.json +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +9 -4
- package/queries/catalog/control-flow-query/control-flow-query-executor.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +4 -0
- package/queries/catalog/dependencies-query/dependencies-query-format.js +5 -0
- package/queries/catalog/dependencies-query/function-info/test-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/test-functions.js +82 -0
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +3 -2
- package/queries/catalog/df-shape-query/df-shape-query-format.js +3 -3
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +1 -1
- package/r-bridge/data/data.d.ts +6 -1
- package/r-bridge/data/data.js +8 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +7 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +19 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +4 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +7 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +2 -1
- package/r-bridge/lang-4.x/convert-values.d.ts +5 -0
- package/search/flowr-search-filters.d.ts +2 -2
- package/slicing/static/static-slicer.js +2 -2
- package/util/mermaid/cfg.d.ts +10 -3
- package/util/mermaid/cfg.js +39 -10
- package/util/mermaid/dfg.js +5 -5
- package/util/simple-df/dfg-view.js +1 -1
- package/util/text/ansi.d.ts +4 -0
- package/util/text/ansi.js +7 -0
- package/util/version.js +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BuiltIns = exports.BuiltInEvalHandlerMapper = exports.BuiltInProcessorMapper = void 0;
|
|
3
|
+
exports.BuiltIns = exports.BuiltInEvalHandlerMapper = exports.BuiltInProcessorMapper = exports.BuiltInProcName = void 0;
|
|
4
4
|
exports.builtInId = builtInId;
|
|
5
5
|
exports.isBuiltIn = isBuiltIn;
|
|
6
6
|
exports.dropBuiltInPrefix = dropBuiltInPrefix;
|
|
@@ -36,6 +36,8 @@ const resolve_1 = require("../eval/resolve/resolve");
|
|
|
36
36
|
const built_in_stop_if_not_1 = require("../internal/process/functions/call/built-in/built-in-stop-if-not");
|
|
37
37
|
const built_in_try_catch_1 = require("../internal/process/functions/call/built-in/built-in-try-catch");
|
|
38
38
|
const built_in_register_hook_1 = require("../internal/process/functions/call/built-in/built-in-register-hook");
|
|
39
|
+
const built_in_local_1 = require("../internal/process/functions/call/built-in/built-in-local");
|
|
40
|
+
const built_in_s_three_dispatch_1 = require("../internal/process/functions/call/built-in/built-in-s-three-dispatch");
|
|
39
41
|
/**
|
|
40
42
|
* Generate a built-in id for the given name
|
|
41
43
|
*/
|
|
@@ -56,7 +58,7 @@ function dropBuiltInPrefix(name) {
|
|
|
56
58
|
return name.slice(builtInPrefixLength);
|
|
57
59
|
}
|
|
58
60
|
function defaultBuiltInProcessor(name, args, rootId, data, { returnsNthArgument, useAsProcessor, forceArgs, readAllArguments, cfg, hasUnknownSideEffects, treatAsFnCall }) {
|
|
59
|
-
const activeProcessor = useAsProcessor ??
|
|
61
|
+
const activeProcessor = useAsProcessor ?? BuiltInProcName.Default;
|
|
60
62
|
const { information: res, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs, origin: activeProcessor });
|
|
61
63
|
if (returnsNthArgument !== undefined) {
|
|
62
64
|
const arg = returnsNthArgument === 'last' ? processedArguments[args.length - 1] : processedArguments[returnsNthArgument];
|
|
@@ -72,11 +74,11 @@ function defaultBuiltInProcessor(name, args, rootId, data, { returnsNthArgument,
|
|
|
72
74
|
}
|
|
73
75
|
}
|
|
74
76
|
if (hasUnknownSideEffects) {
|
|
75
|
-
if (typeof hasUnknownSideEffects
|
|
76
|
-
(0, unknown_side_effect_1.handleUnknownSideEffect)(res.graph, res.environment, rootId
|
|
77
|
+
if (typeof hasUnknownSideEffects === 'boolean') {
|
|
78
|
+
(0, unknown_side_effect_1.handleUnknownSideEffect)(res.graph, res.environment, rootId);
|
|
77
79
|
}
|
|
78
80
|
else {
|
|
79
|
-
(0, unknown_side_effect_1.handleUnknownSideEffect)(res.graph, res.environment, rootId);
|
|
81
|
+
(0, unknown_side_effect_1.handleUnknownSideEffect)(res.graph, res.environment, rootId, hasUnknownSideEffects);
|
|
80
82
|
}
|
|
81
83
|
}
|
|
82
84
|
const fnCallNames = treatAsFnCall?.[name.content];
|
|
@@ -104,43 +106,117 @@ function defaultBuiltInProcessor(name, args, rootId, data, { returnsNthArgument,
|
|
|
104
106
|
args: [],
|
|
105
107
|
environment: data.environment,
|
|
106
108
|
onlyBuiltin: false,
|
|
107
|
-
|
|
109
|
+
cds: data.cds,
|
|
108
110
|
origin: [activeProcessor]
|
|
109
111
|
});
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
114
|
}
|
|
113
115
|
if (cfg !== undefined) {
|
|
114
|
-
res.exitPoints.push({ type: cfg, nodeId: rootId,
|
|
116
|
+
res.exitPoints.push({ type: cfg, nodeId: rootId, cds: data.cds });
|
|
115
117
|
}
|
|
116
118
|
return res;
|
|
117
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* This contains all names of built-in function handlers and origins
|
|
122
|
+
*/
|
|
123
|
+
var BuiltInProcName;
|
|
124
|
+
(function (BuiltInProcName) {
|
|
125
|
+
/** for subsetting operations, see {@link processAccess} */
|
|
126
|
+
BuiltInProcName["Access"] = "builtin:access";
|
|
127
|
+
/** for the `*apply` family, see {@link processApply} */
|
|
128
|
+
BuiltInProcName["Apply"] = "builtin:apply";
|
|
129
|
+
/** for assignments like `<-` and `=`, see {@link processAssignment} */
|
|
130
|
+
BuiltInProcName["Assignment"] = "builtin:assignment";
|
|
131
|
+
/** for assignment like functions that may do additional work, see {@link processAssignmentLike} */
|
|
132
|
+
BuiltInProcName["AssignmentLike"] = "builtin:assignment-like";
|
|
133
|
+
/** for `break` calls */
|
|
134
|
+
BuiltInProcName["Break"] = "builtin:break";
|
|
135
|
+
/** the default built-in processor, see {@link defaultBuiltInProcessor} */
|
|
136
|
+
BuiltInProcName["Default"] = "builtin:default";
|
|
137
|
+
/** for `eval` calls, see {@link processEvalCall} */
|
|
138
|
+
BuiltInProcName["Eval"] = "builtin:eval";
|
|
139
|
+
/** for expression lists, see {@link processExpressionList} */
|
|
140
|
+
BuiltInProcName["ExpressionList"] = "builtin:expression-list";
|
|
141
|
+
/** for `for` loops, see {@link processForLoop} */
|
|
142
|
+
BuiltInProcName["ForLoop"] = "builtin:for-loop";
|
|
143
|
+
/** We resolved a function call, similar to {@link BuiltInProcName#Default} */
|
|
144
|
+
BuiltInProcName["Function"] = "function";
|
|
145
|
+
/** for function definitions, see {@link processFunctionDefinition} */
|
|
146
|
+
BuiltInProcName["FunctionDefinition"] = "builtin:function-definition";
|
|
147
|
+
/** for `get` calls, see {@link processGet} */
|
|
148
|
+
BuiltInProcName["Get"] = "builtin:get";
|
|
149
|
+
/** for `if-then-else` constructs, see {@link processIfThenElse} */
|
|
150
|
+
BuiltInProcName["IfThenElse"] = "builtin:if-then-else";
|
|
151
|
+
/** for `library` and `require` calls, see {@link processLibrary} */
|
|
152
|
+
BuiltInProcName["Library"] = "builtin:library";
|
|
153
|
+
/** for `list` calls, see {@link processList} */
|
|
154
|
+
BuiltInProcName["List"] = "builtin:list";
|
|
155
|
+
/** for `local` calls, see {@link processLocal} */
|
|
156
|
+
BuiltInProcName["Local"] = "builtin:local";
|
|
157
|
+
/** for the pipe operators, see {@link processPipe} */
|
|
158
|
+
BuiltInProcName["Pipe"] = "builtin:pipe";
|
|
159
|
+
/** for `quote`, and other substituting calls, see {@link processQuote} */
|
|
160
|
+
BuiltInProcName["Quote"] = "builtin:quote";
|
|
161
|
+
/** for `on.exìt` and other hooks, see {@link processRegisterHook} */
|
|
162
|
+
BuiltInProcName["RegisterHook"] = "builtin:register-hook";
|
|
163
|
+
/** for `repeat` loops, see {@link processRepeatLoop} */
|
|
164
|
+
BuiltInProcName["RepeatLoop"] = "builtin:repeat-loop";
|
|
165
|
+
/** for replacement functions like `names<-`, see {@link processReplacementFunction} */
|
|
166
|
+
BuiltInProcName["Replacement"] = "builtin:replacement";
|
|
167
|
+
/** for `return` calls */
|
|
168
|
+
BuiltInProcName["Return"] = "builtin:return";
|
|
169
|
+
/** for `rm` calls, see {@link processRm} */
|
|
170
|
+
BuiltInProcName["Rm"] = "builtin:rm";
|
|
171
|
+
/** for `UseMethod` calls, see {@link processS3Dispatch} */
|
|
172
|
+
BuiltInProcName["S3Dispatch"] = "builtin:s3-dispatch";
|
|
173
|
+
/** for `source` calls, see {@link processSourceCall} */
|
|
174
|
+
BuiltInProcName["Source"] = "builtin:source";
|
|
175
|
+
/** for special binary operators like `%x%`, see {@link processSpecialBinOp} */
|
|
176
|
+
BuiltInProcName["SpecialBinOp"] = "builtin:special-bin-op";
|
|
177
|
+
/** for `stop` calls */
|
|
178
|
+
BuiltInProcName["Stop"] = "builtin:stop";
|
|
179
|
+
/** for `stopifnot` calls, see {@link processStopIfNot} */
|
|
180
|
+
BuiltInProcName["StopIfNot"] = "builtin:stopifnot";
|
|
181
|
+
/** support for `:=` in subsetting assignments, see {@link processAccess} */
|
|
182
|
+
BuiltInProcName["TableAssignment"] = "table:assign";
|
|
183
|
+
/** for `try` calls, see {@link processTryCatch} */
|
|
184
|
+
BuiltInProcName["Try"] = "builtin:try";
|
|
185
|
+
/** for unnamed directly-linked function calls */
|
|
186
|
+
BuiltInProcName["Unnamed"] = "unnamed";
|
|
187
|
+
/** for vector construction calls, see {@link processVector} */
|
|
188
|
+
BuiltInProcName["Vector"] = "builtin:vector";
|
|
189
|
+
/** for `while` loops, see {@link processWhileLoop} */
|
|
190
|
+
BuiltInProcName["WhileLoop"] = "builtin:while-loop";
|
|
191
|
+
})(BuiltInProcName || (exports.BuiltInProcName = BuiltInProcName = {}));
|
|
118
192
|
exports.BuiltInProcessorMapper = {
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
193
|
+
[BuiltInProcName.Access]: built_in_access_1.processAccess,
|
|
194
|
+
[BuiltInProcName.Apply]: built_in_apply_1.processApply,
|
|
195
|
+
[BuiltInProcName.Assignment]: built_in_assignment_1.processAssignment,
|
|
196
|
+
[BuiltInProcName.AssignmentLike]: built_in_assignment_1.processAssignmentLike,
|
|
197
|
+
[BuiltInProcName.Default]: defaultBuiltInProcessor,
|
|
198
|
+
[BuiltInProcName.Eval]: built_in_eval_1.processEvalCall,
|
|
199
|
+
[BuiltInProcName.ExpressionList]: built_in_expression_list_1.processExpressionList,
|
|
200
|
+
[BuiltInProcName.ForLoop]: built_in_for_loop_1.processForLoop,
|
|
201
|
+
[BuiltInProcName.FunctionDefinition]: built_in_function_definition_1.processFunctionDefinition,
|
|
202
|
+
[BuiltInProcName.Get]: built_in_get_1.processGet,
|
|
203
|
+
[BuiltInProcName.IfThenElse]: built_in_if_then_else_1.processIfThenElse,
|
|
204
|
+
[BuiltInProcName.Library]: built_in_library_1.processLibrary,
|
|
205
|
+
[BuiltInProcName.List]: built_in_list_1.processList,
|
|
206
|
+
[BuiltInProcName.Local]: built_in_local_1.processLocal,
|
|
207
|
+
[BuiltInProcName.Pipe]: built_in_pipe_1.processPipe,
|
|
208
|
+
[BuiltInProcName.Quote]: built_in_quote_1.processQuote,
|
|
209
|
+
[BuiltInProcName.RegisterHook]: built_in_register_hook_1.processRegisterHook,
|
|
210
|
+
[BuiltInProcName.RepeatLoop]: built_in_repeat_loop_1.processRepeatLoop,
|
|
211
|
+
[BuiltInProcName.Replacement]: built_in_replacement_1.processReplacementFunction,
|
|
212
|
+
[BuiltInProcName.Rm]: built_in_rm_1.processRm,
|
|
213
|
+
[BuiltInProcName.S3Dispatch]: built_in_s_three_dispatch_1.processS3Dispatch,
|
|
214
|
+
[BuiltInProcName.Source]: built_in_source_1.processSourceCall,
|
|
215
|
+
[BuiltInProcName.SpecialBinOp]: built_in_special_bin_op_1.processSpecialBinOp,
|
|
216
|
+
[BuiltInProcName.StopIfNot]: built_in_stop_if_not_1.processStopIfNot,
|
|
217
|
+
[BuiltInProcName.Try]: built_in_try_catch_1.processTryCatch,
|
|
218
|
+
[BuiltInProcName.Vector]: built_in_vector_1.processVector,
|
|
219
|
+
[BuiltInProcName.WhileLoop]: built_in_while_loop_1.processWhileLoop,
|
|
144
220
|
};
|
|
145
221
|
exports.BuiltInEvalHandlerMapper = {
|
|
146
222
|
'built-in:c': resolve_1.resolveAsVector,
|
|
@@ -150,7 +226,7 @@ exports.BuiltInEvalHandlerMapper = {
|
|
|
150
226
|
};
|
|
151
227
|
class BuiltIns {
|
|
152
228
|
/**
|
|
153
|
-
* Register a built-in constant (like `NULL` or `TRUE`) to the given {@link
|
|
229
|
+
* Register a built-in constant (like `NULL` or `TRUE`) to the given {@link BuiltIns}
|
|
154
230
|
*/
|
|
155
231
|
registerBuiltInConstant({ names, value, assumePrimitive }) {
|
|
156
232
|
for (const name of names) {
|
|
@@ -158,7 +234,7 @@ class BuiltIns {
|
|
|
158
234
|
const d = [{
|
|
159
235
|
type: identifier_1.ReferenceType.BuiltInConstant,
|
|
160
236
|
definedAt: id,
|
|
161
|
-
|
|
237
|
+
cds: undefined,
|
|
162
238
|
value,
|
|
163
239
|
name,
|
|
164
240
|
nodeId: id
|
|
@@ -167,18 +243,18 @@ class BuiltIns {
|
|
|
167
243
|
}
|
|
168
244
|
}
|
|
169
245
|
/**
|
|
170
|
-
* Register a built-in function (like `print` or `c`) to the given {@link
|
|
246
|
+
* Register a built-in function (like `print` or `c`) to the given {@link BuiltIns}
|
|
171
247
|
*/
|
|
172
248
|
registerBuiltInFunctions({ names, processor, config, assumePrimitive }) {
|
|
249
|
+
(0, assert_1.guard)(processor !== undefined, () => `Processor for ${JSON.stringify(names)} is undefined, maybe you have an import loop? You may run 'npm run detect-circular-deps' - although by far not all are bad`);
|
|
173
250
|
const mappedProcessor = exports.BuiltInProcessorMapper[processor];
|
|
174
251
|
(0, assert_1.guard)(mappedProcessor !== undefined, () => `Processor for ${processor} is undefined! Please pass a valid builtin name ${JSON.stringify(Object.keys(exports.BuiltInProcessorMapper))}!`);
|
|
175
252
|
for (const name of names) {
|
|
176
|
-
(0, assert_1.guard)(processor !== undefined, `Processor for ${name} is undefined, maybe you have an import loop? You may run 'npm run detect-circular-deps' - although by far not all are bad`);
|
|
177
253
|
const id = builtInId(name);
|
|
178
254
|
const d = [{
|
|
179
255
|
type: identifier_1.ReferenceType.BuiltInFunction,
|
|
180
256
|
definedAt: id,
|
|
181
|
-
|
|
257
|
+
cds: undefined,
|
|
182
258
|
/* eslint-disable-next-line @typescript-eslint/no-explicit-any,@typescript-eslint/no-unsafe-argument */
|
|
183
259
|
processor: (name, args, rootId, data) => mappedProcessor(name, args, rootId, data, config),
|
|
184
260
|
config,
|
|
@@ -208,7 +284,7 @@ class BuiltIns {
|
|
|
208
284
|
makeMaybe: true
|
|
209
285
|
},
|
|
210
286
|
name: effectiveName,
|
|
211
|
-
|
|
287
|
+
cds: undefined,
|
|
212
288
|
nodeId: id
|
|
213
289
|
}];
|
|
214
290
|
this.set(effectiveName, d, assumePrimitive);
|
|
@@ -216,7 +292,7 @@ class BuiltIns {
|
|
|
216
292
|
}
|
|
217
293
|
}
|
|
218
294
|
/**
|
|
219
|
-
* Register a single {@link BuiltInDefinition} to the given memories in {@link
|
|
295
|
+
* Register a single {@link BuiltInDefinition} to the given memories in {@link BuiltIns}
|
|
220
296
|
*/
|
|
221
297
|
registerBuiltInDefinition(definition) {
|
|
222
298
|
switch (definition.type) {
|