@eagleoutice/flowr 2.8.15 → 2.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -21
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +4 -3
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -3
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +2 -1
- package/abstract-interpretation/data-frame/mappers/arguments.js +2 -1
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +4 -3
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +13 -10
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +7 -6
- package/abstract-interpretation/data-frame/resolve-args.js +2 -1
- package/benchmark/slicer.d.ts +0 -16
- package/benchmark/slicer.js +1 -48
- package/benchmark/stats/print.js +0 -6
- package/benchmark/stats/stats.d.ts +0 -3
- package/benchmark/summarizer/first-phase/process.js +1 -1
- package/benchmark/summarizer/second-phase/process.js +0 -6
- package/cli/benchmark-app.d.ts +0 -1
- package/cli/benchmark-app.js +0 -1
- package/cli/benchmark-helper-app.d.ts +0 -1
- package/cli/benchmark-helper-app.js +1 -5
- package/cli/common/options.d.ts +0 -10
- package/cli/common/options.js +0 -2
- package/cli/common/scripts-info.d.ts +0 -10
- package/cli/repl/server/connection.js +1 -1
- package/config.d.ts +0 -15
- package/config.js +0 -21
- package/control-flow/cfg-dead-code.js +0 -3
- package/control-flow/extract-cfg.js +4 -0
- package/control-flow/semantic-cfg-guided-visitor.d.ts +32 -0
- package/control-flow/semantic-cfg-guided-visitor.js +36 -4
- package/dataflow/cluster.js +2 -2
- package/dataflow/environments/built-in-config.d.ts +1 -0
- package/dataflow/environments/built-in.d.ts +19 -3
- package/dataflow/environments/built-in.js +25 -7
- package/dataflow/environments/default-builtin-config.d.ts +59 -8
- package/dataflow/environments/default-builtin-config.js +20 -6
- package/dataflow/environments/define.d.ts +4 -11
- package/dataflow/environments/define.js +16 -96
- package/dataflow/environments/diff.js +3 -2
- package/dataflow/environments/environment.d.ts +17 -6
- package/dataflow/environments/environment.js +69 -18
- package/dataflow/environments/identifier.d.ts +95 -7
- package/dataflow/environments/identifier.js +161 -1
- package/dataflow/environments/resolve-by-name.d.ts +4 -4
- package/dataflow/environments/resolve-by-name.js +29 -10
- package/dataflow/eval/resolve/alias-tracking.js +8 -1
- package/dataflow/eval/resolve/resolve.d.ts +10 -6
- package/dataflow/eval/resolve/resolve.js +12 -7
- package/dataflow/eval/values/general.js +1 -1
- package/dataflow/eval/values/r-value.d.ts +4 -1
- package/dataflow/eval/values/r-value.js +2 -0
- package/dataflow/extractor.js +6 -3
- package/dataflow/fn/higher-order-function.js +4 -4
- package/dataflow/graph/call-graph.d.ts +1 -1
- package/dataflow/graph/call-graph.js +10 -8
- package/dataflow/graph/diff-dataflow-graph.js +6 -4
- package/dataflow/graph/edge.d.ts +48 -31
- package/dataflow/graph/edge.js +66 -60
- package/dataflow/graph/graph.d.ts +7 -7
- package/dataflow/graph/quads.js +1 -1
- package/dataflow/graph/resolve-graph.js +1 -1
- package/dataflow/graph/unknown-replacement.d.ts +2 -1
- package/dataflow/graph/vertex.d.ts +2 -103
- package/dataflow/graph/vertex.js +0 -44
- package/dataflow/internal/linker.d.ts +2 -2
- package/dataflow/internal/linker.js +35 -19
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +3 -65
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +4 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +18 -51
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +4 -4
- 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 +34 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +6 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +1 -69
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.d.ts +11 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +46 -0
- 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 +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +30 -72
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.d.ts +12 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +27 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +19 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +204 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +25 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +1 -60
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +3 -3
- package/dataflow/internal/process/functions/call/common.d.ts +3 -1
- package/dataflow/internal/process/functions/call/common.js +4 -16
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +6 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -3
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -0
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -0
- package/dataflow/internal/process/functions/call/unnamed-call-handling.d.ts +2 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -1
- package/dataflow/internal/process/functions/process-parameter.js +1 -1
- package/dataflow/internal/process/process-named-call.d.ts +2 -1
- package/dataflow/internal/process/process-named-call.js +0 -1
- package/dataflow/internal/process/process-symbol.d.ts +3 -1
- package/dataflow/internal/process/process-symbol.js +8 -5
- package/dataflow/origin/dfg-get-origin.d.ts +2 -2
- package/dataflow/origin/dfg-get-origin.js +4 -4
- package/dataflow/origin/dfg-get-symbol-refs.js +2 -2
- package/documentation/data/interface/doc-writing-code.d.ts +6 -0
- package/documentation/data/interface/doc-writing-code.js +175 -0
- package/documentation/doc-util/doc-types.d.ts +3 -1
- package/documentation/doc-util/doc-types.js +4 -2
- package/documentation/wiki-absint.js +2 -1
- package/documentation/wiki-analyzer.js +17 -2
- package/documentation/wiki-cfg.js +2 -2
- package/documentation/wiki-dataflow-graph.js +9 -8
- package/documentation/wiki-interface.js +8 -164
- package/documentation/wiki-mk/doc-context.d.ts +12 -1
- package/documentation/wiki-mk/doc-context.js +21 -4
- package/documentation/wiki-normalized-ast.js +5 -0
- package/linter/linter-rules.d.ts +3 -3
- package/linter/rules/absolute-path.js +23 -23
- package/linter/rules/dataframe-access-validation.js +2 -1
- package/linter/rules/deprecated-functions.d.ts +1 -1
- package/linter/rules/deprecated-functions.js +1 -1
- package/linter/rules/function-finder-util.d.ts +2 -2
- package/linter/rules/naming-convention.d.ts +9 -2
- package/linter/rules/naming-convention.js +38 -36
- package/linter/rules/network-functions.d.ts +1 -1
- package/linter/rules/seeded-randomness.d.ts +2 -2
- package/linter/rules/seeded-randomness.js +5 -4
- package/linter/rules/unused-definition.js +4 -4
- package/package.json +6 -5
- package/project/context/flowr-analyzer-context.d.ts +17 -1
- package/project/context/flowr-analyzer-context.js +17 -1
- package/project/context/flowr-analyzer-meta-context.d.ts +51 -0
- package/project/context/flowr-analyzer-meta-context.js +47 -0
- package/project/flowr-analyzer.d.ts +17 -1
- package/project/flowr-analyzer.js +18 -0
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +15 -0
- package/project/plugins/file-plugins/files/flowr-description-file.js +26 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +40 -3
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +352 -9
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-namespace-files-plugin.js +2 -2
- package/project/plugins/flowr-analyzer-plugin-defaults.js +2 -0
- package/project/plugins/loading-order-plugins/flowr-analyzer-loading-order-description-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.d.ts +12 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-meta-description-file-plugin.js +42 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +2 -2
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.d.ts +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +2 -2
- package/project/plugins/plugin-registry.d.ts +2 -1
- package/project/plugins/plugin-registry.js +2 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +6 -4
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +2 -1
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +3 -3
- package/queries/catalog/dependencies-query/dependencies-query-format.js +5 -3
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +2 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -1
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +1 -1
- package/r-bridge/data/data.d.ts +12 -7
- package/r-bridge/data/data.js +13 -7
- package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -12
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +2 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +2 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +7 -3
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +2 -1
- package/r-bridge/lang-4.x/ast/model/type.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/type.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +5 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +4 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-break.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-for.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-next.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +2 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/other/normalize-comment.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/other/normalize-line-directive.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.d.ts +1 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +13 -14
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +24 -31
- package/r-bridge/roxygen2/roxygen-parse.js +1 -1
- package/reconstruct/auto-select/magic-comments.js +1 -1
- package/reconstruct/reconstruct.js +6 -5
- package/search/flowr-search-filters.js +2 -1
- package/search/search-executor/search-enrichers.d.ts +1 -2
- package/search/search-executor/search-enrichers.js +2 -1
- package/slicing/static/slice-call.d.ts +1 -1
- package/slicing/static/slice-call.js +8 -8
- package/slicing/static/static-slicer.js +2 -2
- package/statistics/features/common-syntax-probability.js +3 -2
- package/statistics/features/supported/defined-functions/defined-functions.js +3 -3
- package/statistics/features/supported/used-functions/used-functions.js +3 -2
- package/util/mermaid/dfg.js +3 -3
- package/util/r-value.d.ts +3 -2
- package/util/r-value.js +3 -0
- package/util/simple-df/dfg-ascii.js +5 -5
- package/util/version.js +1 -1
- package/util/containers.d.ts +0 -66
- package/util/containers.js +0 -143
|
@@ -162,11 +162,6 @@ declare const _scripts: {
|
|
|
162
162
|
readonly type: BooleanConstructor;
|
|
163
163
|
readonly description: "Infer the shape of data frames using abstract interpretation (includes control flow graph extraction)";
|
|
164
164
|
readonly defaultValue: false;
|
|
165
|
-
}, {
|
|
166
|
-
readonly name: "enable-pointer-tracking";
|
|
167
|
-
readonly type: BooleanConstructor;
|
|
168
|
-
readonly description: "Run dataflow analysis with pointer tracking";
|
|
169
|
-
readonly defaultValue: false;
|
|
170
165
|
}, {
|
|
171
166
|
readonly name: "max-file-slices";
|
|
172
167
|
readonly type: NumberConstructor;
|
|
@@ -261,11 +256,6 @@ declare const _scripts: {
|
|
|
261
256
|
readonly type: BooleanConstructor;
|
|
262
257
|
readonly description: "Infer the shape of data frames using abstract interpretation (includes control flow graph extraction)";
|
|
263
258
|
readonly defaultValue: false;
|
|
264
|
-
}, {
|
|
265
|
-
readonly name: "enable-pointer-tracking";
|
|
266
|
-
readonly type: BooleanConstructor;
|
|
267
|
-
readonly description: "Run dataflow analysis with pointer tracking";
|
|
268
|
-
readonly defaultValue: false;
|
|
269
259
|
}, {
|
|
270
260
|
readonly name: "max-slices";
|
|
271
261
|
readonly type: NumberConstructor;
|
|
@@ -256,7 +256,7 @@ class FlowRServerConnection {
|
|
|
256
256
|
type: 'response-slice',
|
|
257
257
|
id: request.id,
|
|
258
258
|
results: Object.fromEntries(Object.entries(result)
|
|
259
|
-
.filter(([k
|
|
259
|
+
.filter(([k]) => default_pipelines_1.DEFAULT_SLICING_PIPELINE.steps.get(k)?.executed === 1 /* PipelineStepStage.OncePerRequest */))
|
|
260
260
|
});
|
|
261
261
|
}).catch(e => {
|
|
262
262
|
this.logger.error(`[${this.name}] Error while analyzing file for token ${request.filetoken}: ${String(e)}`);
|
package/config.d.ts
CHANGED
|
@@ -131,17 +131,6 @@ export interface FlowrConfigOptions extends MergeableRecord {
|
|
|
131
131
|
* Should we include eval(parse(text="...")) calls in the dataflow graph?
|
|
132
132
|
*/
|
|
133
133
|
readonly evalStrings: boolean;
|
|
134
|
-
/**
|
|
135
|
-
* Whether to track pointers in the dataflow graph,
|
|
136
|
-
* if not, the graph will be over-approximated wrt.
|
|
137
|
-
* containers and accesses
|
|
138
|
-
*/
|
|
139
|
-
readonly pointerTracking: boolean | {
|
|
140
|
-
/**
|
|
141
|
-
* The maximum number of indices tracked per obj with the pointer analysis (currently this focuses on initialization)
|
|
142
|
-
*/
|
|
143
|
-
readonly maxIndexCount: number;
|
|
144
|
-
};
|
|
145
134
|
/** These keys are only intended for use within code, allowing to instrument the dataflow analyzer! */
|
|
146
135
|
readonly instrument: {
|
|
147
136
|
/**
|
|
@@ -249,7 +238,3 @@ export declare function getConfig(configFile?: string, configWorkingDirectory?:
|
|
|
249
238
|
export declare function getEngineConfig<T extends EngineConfig['type']>(config: FlowrConfigOptions, engine: T): EngineConfig & {
|
|
250
239
|
type: T;
|
|
251
240
|
} | undefined;
|
|
252
|
-
/**
|
|
253
|
-
* Checks whether the given count is over the pointer analysis threshold configured in the config.
|
|
254
|
-
*/
|
|
255
|
-
export declare function isOverPointerAnalysisThreshold(config: FlowrConfigOptions, count: number): boolean;
|
package/config.js
CHANGED
|
@@ -9,7 +9,6 @@ exports.amendConfig = amendConfig;
|
|
|
9
9
|
exports.cloneConfig = cloneConfig;
|
|
10
10
|
exports.getConfig = getConfig;
|
|
11
11
|
exports.getEngineConfig = getEngineConfig;
|
|
12
|
-
exports.isOverPointerAnalysisThreshold = isOverPointerAnalysisThreshold;
|
|
13
12
|
const objects_1 = require("./util/objects");
|
|
14
13
|
const path_1 = __importDefault(require("path"));
|
|
15
14
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -77,7 +76,6 @@ exports.defaultConfigOptions = {
|
|
|
77
76
|
solver: {
|
|
78
77
|
variables: VariableResolve.Alias,
|
|
79
78
|
evalStrings: true,
|
|
80
|
-
pointerTracking: false,
|
|
81
79
|
resolveSource: {
|
|
82
80
|
dropPaths: DropPathsOption.No,
|
|
83
81
|
ignoreCapitalization: true,
|
|
@@ -133,9 +131,6 @@ exports.flowrConfigFileSchema = joi_1.default.object({
|
|
|
133
131
|
solver: joi_1.default.object({
|
|
134
132
|
variables: joi_1.default.string().valid(...Object.values(VariableResolve)).description('How to resolve variables and their values.'),
|
|
135
133
|
evalStrings: joi_1.default.boolean().description('Should we include eval(parse(text="...")) calls in the dataflow graph?'),
|
|
136
|
-
pointerTracking: joi_1.default.alternatives(joi_1.default.boolean(), joi_1.default.object({
|
|
137
|
-
maxIndexCount: joi_1.default.number().required().description('The maximum number of indices tracked per object with the pointer analysis.')
|
|
138
|
-
})).description('Whether to track pointers in the dataflow graph, if not, the graph will be over-approximated wrt. containers and accesses.'),
|
|
139
134
|
instrument: joi_1.default.object({
|
|
140
135
|
dataflowExtractors: joi_1.default.any().optional().description('These keys are only intended for use within code, allowing to instrument the dataflow analyzer!')
|
|
141
136
|
}),
|
|
@@ -221,22 +216,6 @@ function getEngineConfig(config, engine) {
|
|
|
221
216
|
return engines.find(e => e.type == engine);
|
|
222
217
|
}
|
|
223
218
|
}
|
|
224
|
-
function getPointerAnalysisThreshold(config) {
|
|
225
|
-
const pointerTracking = config.solver.pointerTracking;
|
|
226
|
-
if (typeof pointerTracking === 'object') {
|
|
227
|
-
return pointerTracking.maxIndexCount;
|
|
228
|
-
}
|
|
229
|
-
else {
|
|
230
|
-
return pointerTracking ? 'unlimited' : 'disabled';
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
/**
|
|
234
|
-
* Checks whether the given count is over the pointer analysis threshold configured in the config.
|
|
235
|
-
*/
|
|
236
|
-
function isOverPointerAnalysisThreshold(config, count) {
|
|
237
|
-
const threshold = getPointerAnalysisThreshold(config);
|
|
238
|
-
return threshold !== 'unlimited' && (threshold === 'disabled' || count > threshold);
|
|
239
|
-
}
|
|
240
219
|
function loadConfigFromFile(configFile, workingDirectory) {
|
|
241
220
|
if (configFile !== undefined) {
|
|
242
221
|
if (path_1.default.isAbsolute(configFile) && fs_1.default.existsSync(configFile)) {
|
|
@@ -107,9 +107,6 @@ class CfgConditionalDeadCodeRemoval extends semantic_cfg_guided_visitor_1.Semant
|
|
|
107
107
|
onWhileLoopCall(data) {
|
|
108
108
|
this.handleWithCondition(data);
|
|
109
109
|
}
|
|
110
|
-
onReturnCall(data) {
|
|
111
|
-
this.cachedStatements.set(data.call.id, true);
|
|
112
|
-
}
|
|
113
110
|
onStopCall(data) {
|
|
114
111
|
this.cachedStatements.set(data.call.id, true);
|
|
115
112
|
}
|
|
@@ -332,6 +332,10 @@ function cfgFunctionCall(call, name, args, exit = 'exit') {
|
|
|
332
332
|
for (const exit of lastArgExits) {
|
|
333
333
|
graph.addEdge(callId + '-exit', exit, { label: 0 /* CfgEdgeType.Fd */ });
|
|
334
334
|
}
|
|
335
|
+
if (call.named && call.functionName.content === 'return') {
|
|
336
|
+
info.returns.push(callId + '-exit');
|
|
337
|
+
info.exitPoints.length = 0;
|
|
338
|
+
}
|
|
335
339
|
// should not contain any breaks, nexts, or returns, (except for the body if something like 'break()')
|
|
336
340
|
return info;
|
|
337
341
|
}
|
|
@@ -496,11 +496,36 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
496
496
|
* This event triggers for every call to a function that performs an S3-like dispatch.
|
|
497
497
|
*
|
|
498
498
|
* For example, this triggers for `UseMethod` in `UseMethod("print")`.
|
|
499
|
+
* @see {@link SemanticCfgGuidedVisitor#onS3DispatchNextCall|`onS3DispatchNextCall`} for `NextMethod` calls.
|
|
499
500
|
* @protected
|
|
500
501
|
*/
|
|
501
502
|
protected onS3DispatchCall(_data: {
|
|
502
503
|
call: DataflowGraphVertexFunctionCall;
|
|
503
504
|
}): void;
|
|
505
|
+
/**
|
|
506
|
+
* This event triggers for every call to a function that performs an S3-like *next* dispatch.
|
|
507
|
+
*
|
|
508
|
+
* For example, this triggers for `NextMethod`.
|
|
509
|
+
* @see {@link SemanticCfgGuidedVisitor#onS3DispatchCall|`onS3DispatchCall`} for `UseMethod` calls.
|
|
510
|
+
* @protected
|
|
511
|
+
*/
|
|
512
|
+
protected onS3DispatchNextCall(_data: {
|
|
513
|
+
call: DataflowGraphVertexFunctionCall;
|
|
514
|
+
}): void;
|
|
515
|
+
/**
|
|
516
|
+
* This event triggers for every call to a function that creates a new S7 generic, such as `new_generic`.
|
|
517
|
+
* @protected
|
|
518
|
+
*/
|
|
519
|
+
protected onS7NewGenericCall(_data: {
|
|
520
|
+
call: DataflowGraphVertexFunctionCall;
|
|
521
|
+
}): void;
|
|
522
|
+
/**
|
|
523
|
+
* This event triggers for every call to a function that performs an S7 dispatch, such as `S7_dispatch`.
|
|
524
|
+
* @protected
|
|
525
|
+
*/
|
|
526
|
+
protected onS7DispatchCall(_data: {
|
|
527
|
+
call: DataflowGraphVertexFunctionCall;
|
|
528
|
+
}): void;
|
|
504
529
|
/**
|
|
505
530
|
* This event triggers for every call to a function that registers a hook, such as `on.exit`.
|
|
506
531
|
*
|
|
@@ -534,4 +559,11 @@ export declare class SemanticCfgGuidedVisitor<OtherInfo = NoInfo, ControlFlow ex
|
|
|
534
559
|
protected onReturnCall(_data: {
|
|
535
560
|
call: DataflowGraphVertexFunctionCall;
|
|
536
561
|
}): void;
|
|
562
|
+
/**
|
|
563
|
+
* This event triggers for every call to `Recall`, which is used to recall the function closure (usually in recursive functions).
|
|
564
|
+
* @protected
|
|
565
|
+
*/
|
|
566
|
+
protected onRecallCall(_data: {
|
|
567
|
+
call: DataflowGraphVertexFunctionCall;
|
|
568
|
+
}): void;
|
|
537
569
|
}
|
|
@@ -202,11 +202,11 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
202
202
|
case built_in_1.BuiltInProcName.TableAssignment: {
|
|
203
203
|
const outgoing = this.config.dfg.outgoingEdges(call.id);
|
|
204
204
|
if (outgoing) {
|
|
205
|
-
const target =
|
|
205
|
+
const target = outgoing.entries().filter(([, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.Returns)).toArray();
|
|
206
206
|
if (target.length === 1) {
|
|
207
207
|
const targetOut = this.config.dfg.outgoingEdges(target[0][0]);
|
|
208
208
|
if (targetOut) {
|
|
209
|
-
const source = [...targetOut.entries()].filter(([t, e]) =>
|
|
209
|
+
const source = [...targetOut.entries()].filter(([t, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.DefinedBy) && t !== call.id);
|
|
210
210
|
if (source.length === 1) {
|
|
211
211
|
return this.onAssignmentCall({ call, target: target[0][0], source: source[0][0] });
|
|
212
212
|
}
|
|
@@ -236,11 +236,11 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
236
236
|
case built_in_1.BuiltInProcName.Replacement: {
|
|
237
237
|
const outgoing = this.config.dfg.outgoingEdges(call.id);
|
|
238
238
|
if (outgoing) {
|
|
239
|
-
const target =
|
|
239
|
+
const target = outgoing.entries().filter(([, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.Returns)).toArray();
|
|
240
240
|
if (target.length === 1) {
|
|
241
241
|
const targetOut = this.config.dfg.outgoingEdges(target[0][0]);
|
|
242
242
|
if (targetOut) {
|
|
243
|
-
const source =
|
|
243
|
+
const source = targetOut.entries().filter(([t, e]) => edge_1.DfEdge.includesType(e, edge_1.EdgeType.DefinedBy) && t !== call.id).toArray();
|
|
244
244
|
if (source.length === 1) {
|
|
245
245
|
return this.onReplacementCall({ call, target: target[0][0], source: source[0][0] });
|
|
246
246
|
}
|
|
@@ -263,12 +263,20 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
263
263
|
return this.onLocalCall({ call });
|
|
264
264
|
case built_in_1.BuiltInProcName.S3Dispatch:
|
|
265
265
|
return this.onS3DispatchCall({ call });
|
|
266
|
+
case built_in_1.BuiltInProcName.S3DispatchNext:
|
|
267
|
+
return this.onS3DispatchNextCall({ call });
|
|
268
|
+
case built_in_1.BuiltInProcName.S7NewGeneric:
|
|
269
|
+
return this.onS7NewGenericCall({ call });
|
|
270
|
+
case built_in_1.BuiltInProcName.S7Dispatch:
|
|
271
|
+
return this.onS7DispatchCall({ call });
|
|
266
272
|
case built_in_1.BuiltInProcName.Break:
|
|
267
273
|
return this.onBreakCall({ call });
|
|
268
274
|
case built_in_1.BuiltInProcName.Return:
|
|
269
275
|
return this.onReturnCall({ call });
|
|
270
276
|
case built_in_1.BuiltInProcName.Unnamed:
|
|
271
277
|
return this.onUnnamedCall({ call });
|
|
278
|
+
case built_in_1.BuiltInProcName.Recall:
|
|
279
|
+
return this.onRecallCall({ call });
|
|
272
280
|
case built_in_1.BuiltInProcName.Default:
|
|
273
281
|
case built_in_1.BuiltInProcName.Function:
|
|
274
282
|
case built_in_1.BuiltInProcName.FunctionDefinition:
|
|
@@ -576,9 +584,28 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
576
584
|
* This event triggers for every call to a function that performs an S3-like dispatch.
|
|
577
585
|
*
|
|
578
586
|
* For example, this triggers for `UseMethod` in `UseMethod("print")`.
|
|
587
|
+
* @see {@link SemanticCfgGuidedVisitor#onS3DispatchNextCall|`onS3DispatchNextCall`} for `NextMethod` calls.
|
|
579
588
|
* @protected
|
|
580
589
|
*/
|
|
581
590
|
onS3DispatchCall(_data) { }
|
|
591
|
+
/**
|
|
592
|
+
* This event triggers for every call to a function that performs an S3-like *next* dispatch.
|
|
593
|
+
*
|
|
594
|
+
* For example, this triggers for `NextMethod`.
|
|
595
|
+
* @see {@link SemanticCfgGuidedVisitor#onS3DispatchCall|`onS3DispatchCall`} for `UseMethod` calls.
|
|
596
|
+
* @protected
|
|
597
|
+
*/
|
|
598
|
+
onS3DispatchNextCall(_data) { }
|
|
599
|
+
/**
|
|
600
|
+
* This event triggers for every call to a function that creates a new S7 generic, such as `new_generic`.
|
|
601
|
+
* @protected
|
|
602
|
+
*/
|
|
603
|
+
onS7NewGenericCall(_data) { }
|
|
604
|
+
/**
|
|
605
|
+
* This event triggers for every call to a function that performs an S7 dispatch, such as `S7_dispatch`.
|
|
606
|
+
* @protected
|
|
607
|
+
*/
|
|
608
|
+
onS7DispatchCall(_data) { }
|
|
582
609
|
/**
|
|
583
610
|
* This event triggers for every call to a function that registers a hook, such as `on.exit`.
|
|
584
611
|
*
|
|
@@ -606,6 +633,11 @@ class SemanticCfgGuidedVisitor extends dfg_cfg_guided_visitor_1.DataflowAwareCfg
|
|
|
606
633
|
* @protected
|
|
607
634
|
*/
|
|
608
635
|
onReturnCall(_data) { }
|
|
636
|
+
/**
|
|
637
|
+
* This event triggers for every call to `Recall`, which is used to recall the function closure (usually in recursive functions).
|
|
638
|
+
* @protected
|
|
639
|
+
*/
|
|
640
|
+
onRecallCall(_data) { }
|
|
609
641
|
}
|
|
610
642
|
exports.SemanticCfgGuidedVisitor = SemanticCfgGuidedVisitor;
|
|
611
643
|
//# sourceMappingURL=semantic-cfg-guided-visitor.js.map
|
package/dataflow/cluster.js
CHANGED
|
@@ -35,9 +35,9 @@ function makeCluster(graph, from, notReached) {
|
|
|
35
35
|
}
|
|
36
36
|
}
|
|
37
37
|
// cluster adjacent edges
|
|
38
|
-
for (const [dest,
|
|
38
|
+
for (const [dest, e] of [...graph.outgoingEdges(from) ?? [], ...graph.ingoingEdges(from) ?? []]) {
|
|
39
39
|
// don't cluster for function content if it isn't returned
|
|
40
|
-
if (
|
|
40
|
+
if (edge_1.DfEdge.doesNotIncludeType(e, edge_1.EdgeType.Returns) && info.onlyBuiltin && info.name == '{') {
|
|
41
41
|
continue;
|
|
42
42
|
}
|
|
43
43
|
if (notReached.delete(dest)) {
|
|
@@ -39,6 +39,7 @@ export interface BuiltInReplacementDefinition extends BaseBuiltInDefinition {
|
|
|
39
39
|
readonly suffixes: ('<<-' | '<-')[];
|
|
40
40
|
readonly config: {
|
|
41
41
|
readIndices: boolean;
|
|
42
|
+
constructName?: 's7';
|
|
42
43
|
};
|
|
43
44
|
}
|
|
44
45
|
export type BuiltInDefinition<T extends keyof typeof BuiltInProcessorMapper = keyof typeof BuiltInProcessorMapper> = BuiltInConstantDefinition<unknown> | BuiltInFunctionDefinition<T> | BuiltInReplacementDefinition;
|
|
@@ -8,7 +8,7 @@ import { processPipe } from '../internal/process/functions/call/built-in/built-i
|
|
|
8
8
|
import { processForLoop } from '../internal/process/functions/call/built-in/built-in-for-loop';
|
|
9
9
|
import { processRepeatLoop } from '../internal/process/functions/call/built-in/built-in-repeat-loop';
|
|
10
10
|
import { processWhileLoop } from '../internal/process/functions/call/built-in/built-in-while-loop';
|
|
11
|
-
import { type
|
|
11
|
+
import { type BrandedIdentifier, type IdentifierDefinition, type IdentifierReference, ReferenceType } from './identifier';
|
|
12
12
|
import { processReplacementFunction } from '../internal/process/functions/call/built-in/built-in-replacement';
|
|
13
13
|
import { processQuote } from '../internal/process/functions/call/built-in/built-in-quote';
|
|
14
14
|
import { processFunctionDefinition } from '../internal/process/functions/call/built-in/built-in-function-definition';
|
|
@@ -39,6 +39,9 @@ import { processTryCatch } from '../internal/process/functions/call/built-in/bui
|
|
|
39
39
|
import { processRegisterHook } from '../internal/process/functions/call/built-in/built-in-register-hook';
|
|
40
40
|
import { processLocal } from '../internal/process/functions/call/built-in/built-in-local';
|
|
41
41
|
import { processS3Dispatch } from '../internal/process/functions/call/built-in/built-in-s-three-dispatch';
|
|
42
|
+
import { processRecall } from '../internal/process/functions/call/built-in/built-in-recall';
|
|
43
|
+
import { processS7NewGeneric } from '../internal/process/functions/call/built-in/built-in-s-seven-new-generic';
|
|
44
|
+
import { processS7Dispatch } from '../internal/process/functions/call/built-in/built-in-s-seven-dispatch';
|
|
42
45
|
export type BuiltIn = `built-in:${string}`;
|
|
43
46
|
/**
|
|
44
47
|
* Generate a built-in id for the given name
|
|
@@ -122,6 +125,10 @@ export declare enum BuiltInProcName {
|
|
|
122
125
|
Pipe = "builtin:pipe",
|
|
123
126
|
/** for `quote`, and other substituting calls, see {@link processQuote} */
|
|
124
127
|
Quote = "builtin:quote",
|
|
128
|
+
/**
|
|
129
|
+
* for `recall` calls, see {@link processRecall}
|
|
130
|
+
*/
|
|
131
|
+
Recall = "builtin:recall",
|
|
125
132
|
/** for `on.exìt` and other hooks, see {@link processRegisterHook} */
|
|
126
133
|
RegisterHook = "builtin:register-hook",
|
|
127
134
|
/** for `repeat` loops, see {@link processRepeatLoop} */
|
|
@@ -134,6 +141,12 @@ export declare enum BuiltInProcName {
|
|
|
134
141
|
Rm = "builtin:rm",
|
|
135
142
|
/** for `UseMethod` calls, see {@link processS3Dispatch} */
|
|
136
143
|
S3Dispatch = "builtin:s3-dispatch",
|
|
144
|
+
/** for `NextMethod` calls, see {@link processS3Dispatch} */
|
|
145
|
+
S3DispatchNext = "builtin:s3-dispatch-next",
|
|
146
|
+
/** for `new.generic` calls, see {@link processS7NewGeneric} */
|
|
147
|
+
S7NewGeneric = "builtin:s7-new-generic",
|
|
148
|
+
/** for `S7_dispatch` calls (and their implicit creations), see {@link processS7Dispatch} */
|
|
149
|
+
S7Dispatch = "builtin:s7-dispatch",
|
|
137
150
|
/** for `source` calls, see {@link processSourceCall} */
|
|
138
151
|
Source = "builtin:source",
|
|
139
152
|
/** for special binary operators like `%x%`, see {@link processSpecialBinOp} */
|
|
@@ -170,11 +183,14 @@ export declare const BuiltInProcessorMapper: {
|
|
|
170
183
|
readonly "builtin:local": typeof processLocal;
|
|
171
184
|
readonly "builtin:pipe": typeof processPipe;
|
|
172
185
|
readonly "builtin:quote": typeof processQuote;
|
|
186
|
+
readonly "builtin:recall": typeof processRecall;
|
|
173
187
|
readonly "builtin:register-hook": typeof processRegisterHook;
|
|
174
188
|
readonly "builtin:repeat-loop": typeof processRepeatLoop;
|
|
175
189
|
readonly "builtin:replacement": typeof processReplacementFunction;
|
|
176
190
|
readonly "builtin:rm": typeof processRm;
|
|
177
191
|
readonly "builtin:s3-dispatch": typeof processS3Dispatch;
|
|
192
|
+
readonly "builtin:s7-new-generic": typeof processS7NewGeneric;
|
|
193
|
+
readonly "builtin:s7-dispatch": typeof processS7Dispatch;
|
|
178
194
|
readonly "builtin:source": typeof processSourceCall;
|
|
179
195
|
readonly "builtin:special-bin-op": typeof processSpecialBinOp;
|
|
180
196
|
readonly "builtin:stopifnot": typeof processStopIfNot;
|
|
@@ -189,7 +205,7 @@ export declare const BuiltInEvalHandlerMapper: {
|
|
|
189
205
|
readonly 'built-in:-': typeof resolveAsMinus;
|
|
190
206
|
};
|
|
191
207
|
export type ConfigOfBuiltInMappingName<N extends keyof typeof BuiltInProcessorMapper> = Parameters<typeof BuiltInProcessorMapper[N]>[4];
|
|
192
|
-
export type BuiltInMemory = Map<
|
|
208
|
+
export type BuiltInMemory = Map<BrandedIdentifier, IdentifierDefinition[]>;
|
|
193
209
|
export declare class BuiltIns {
|
|
194
210
|
/**
|
|
195
211
|
* Register a built-in constant (like `NULL` or `TRUE`) to the given {@link BuiltIns}
|
|
@@ -221,6 +237,6 @@ export declare class BuiltIns {
|
|
|
221
237
|
* @see {@link builtInMemory}
|
|
222
238
|
*/
|
|
223
239
|
emptyBuiltInMemory: BuiltInMemory;
|
|
224
|
-
set(identifier:
|
|
240
|
+
set(identifier: BrandedIdentifier, definition: IdentifierDefinition[], includeInEmptyMemory: boolean | undefined): void;
|
|
225
241
|
}
|
|
226
242
|
export {};
|
|
@@ -38,6 +38,9 @@ const built_in_try_catch_1 = require("../internal/process/functions/call/built-i
|
|
|
38
38
|
const built_in_register_hook_1 = require("../internal/process/functions/call/built-in/built-in-register-hook");
|
|
39
39
|
const built_in_local_1 = require("../internal/process/functions/call/built-in/built-in-local");
|
|
40
40
|
const built_in_s_three_dispatch_1 = require("../internal/process/functions/call/built-in/built-in-s-three-dispatch");
|
|
41
|
+
const built_in_recall_1 = require("../internal/process/functions/call/built-in/built-in-recall");
|
|
42
|
+
const built_in_s_seven_new_generic_1 = require("../internal/process/functions/call/built-in/built-in-s-seven-new-generic");
|
|
43
|
+
const built_in_s_seven_dispatch_1 = require("../internal/process/functions/call/built-in/built-in-s-seven-dispatch");
|
|
41
44
|
/**
|
|
42
45
|
* Generate a built-in id for the given name
|
|
43
46
|
*/
|
|
@@ -81,7 +84,7 @@ function defaultBuiltInProcessor(name, args, rootId, data, { returnsNthArgument,
|
|
|
81
84
|
(0, unknown_side_effect_1.handleUnknownSideEffect)(res.graph, res.environment, rootId, hasUnknownSideEffects);
|
|
82
85
|
}
|
|
83
86
|
}
|
|
84
|
-
const fnCallNames = treatAsFnCall?.[name.content];
|
|
87
|
+
const fnCallNames = treatAsFnCall?.[identifier_1.Identifier.getName(name.content)];
|
|
85
88
|
if (fnCallNames) {
|
|
86
89
|
for (const arg of args) {
|
|
87
90
|
if (arg !== r_function_call_1.EmptyArgument && arg.value && fnCallNames.includes(arg.name?.content)) {
|
|
@@ -158,6 +161,10 @@ var BuiltInProcName;
|
|
|
158
161
|
BuiltInProcName["Pipe"] = "builtin:pipe";
|
|
159
162
|
/** for `quote`, and other substituting calls, see {@link processQuote} */
|
|
160
163
|
BuiltInProcName["Quote"] = "builtin:quote";
|
|
164
|
+
/**
|
|
165
|
+
* for `recall` calls, see {@link processRecall}
|
|
166
|
+
*/
|
|
167
|
+
BuiltInProcName["Recall"] = "builtin:recall";
|
|
161
168
|
/** for `on.exìt` and other hooks, see {@link processRegisterHook} */
|
|
162
169
|
BuiltInProcName["RegisterHook"] = "builtin:register-hook";
|
|
163
170
|
/** for `repeat` loops, see {@link processRepeatLoop} */
|
|
@@ -170,6 +177,12 @@ var BuiltInProcName;
|
|
|
170
177
|
BuiltInProcName["Rm"] = "builtin:rm";
|
|
171
178
|
/** for `UseMethod` calls, see {@link processS3Dispatch} */
|
|
172
179
|
BuiltInProcName["S3Dispatch"] = "builtin:s3-dispatch";
|
|
180
|
+
/** for `NextMethod` calls, see {@link processS3Dispatch} */
|
|
181
|
+
BuiltInProcName["S3DispatchNext"] = "builtin:s3-dispatch-next";
|
|
182
|
+
/** for `new.generic` calls, see {@link processS7NewGeneric} */
|
|
183
|
+
BuiltInProcName["S7NewGeneric"] = "builtin:s7-new-generic";
|
|
184
|
+
/** for `S7_dispatch` calls (and their implicit creations), see {@link processS7Dispatch} */
|
|
185
|
+
BuiltInProcName["S7Dispatch"] = "builtin:s7-dispatch";
|
|
173
186
|
/** for `source` calls, see {@link processSourceCall} */
|
|
174
187
|
BuiltInProcName["Source"] = "builtin:source";
|
|
175
188
|
/** for special binary operators like `%x%`, see {@link processSpecialBinOp} */
|
|
@@ -206,11 +219,14 @@ exports.BuiltInProcessorMapper = {
|
|
|
206
219
|
[BuiltInProcName.Local]: built_in_local_1.processLocal,
|
|
207
220
|
[BuiltInProcName.Pipe]: built_in_pipe_1.processPipe,
|
|
208
221
|
[BuiltInProcName.Quote]: built_in_quote_1.processQuote,
|
|
222
|
+
[BuiltInProcName.Recall]: built_in_recall_1.processRecall,
|
|
209
223
|
[BuiltInProcName.RegisterHook]: built_in_register_hook_1.processRegisterHook,
|
|
210
224
|
[BuiltInProcName.RepeatLoop]: built_in_repeat_loop_1.processRepeatLoop,
|
|
211
225
|
[BuiltInProcName.Replacement]: built_in_replacement_1.processReplacementFunction,
|
|
212
226
|
[BuiltInProcName.Rm]: built_in_rm_1.processRm,
|
|
213
227
|
[BuiltInProcName.S3Dispatch]: built_in_s_three_dispatch_1.processS3Dispatch,
|
|
228
|
+
[BuiltInProcName.S7NewGeneric]: built_in_s_seven_new_generic_1.processS7NewGeneric,
|
|
229
|
+
[BuiltInProcName.S7Dispatch]: built_in_s_seven_dispatch_1.processS7Dispatch,
|
|
214
230
|
[BuiltInProcName.Source]: built_in_source_1.processSourceCall,
|
|
215
231
|
[BuiltInProcName.SpecialBinOp]: built_in_special_bin_op_1.processSpecialBinOp,
|
|
216
232
|
[BuiltInProcName.StopIfNot]: built_in_stop_if_not_1.processStopIfNot,
|
|
@@ -230,7 +246,8 @@ class BuiltIns {
|
|
|
230
246
|
*/
|
|
231
247
|
registerBuiltInConstant({ names, value, assumePrimitive }) {
|
|
232
248
|
for (const name of names) {
|
|
233
|
-
const
|
|
249
|
+
const n = identifier_1.Identifier.getName(name);
|
|
250
|
+
const id = builtInId(n);
|
|
234
251
|
const d = [{
|
|
235
252
|
type: identifier_1.ReferenceType.BuiltInConstant,
|
|
236
253
|
definedAt: id,
|
|
@@ -239,7 +256,7 @@ class BuiltIns {
|
|
|
239
256
|
name,
|
|
240
257
|
nodeId: id
|
|
241
258
|
}];
|
|
242
|
-
this.set(
|
|
259
|
+
this.set(n, d, assumePrimitive);
|
|
243
260
|
}
|
|
244
261
|
}
|
|
245
262
|
/**
|
|
@@ -250,7 +267,8 @@ class BuiltIns {
|
|
|
250
267
|
const mappedProcessor = exports.BuiltInProcessorMapper[processor];
|
|
251
268
|
(0, assert_1.guard)(mappedProcessor !== undefined, () => `Processor for ${processor} is undefined! Please pass a valid builtin name ${JSON.stringify(Object.keys(exports.BuiltInProcessorMapper))}!`);
|
|
252
269
|
for (const name of names) {
|
|
253
|
-
const
|
|
270
|
+
const n = identifier_1.Identifier.getName(name);
|
|
271
|
+
const id = builtInId(n);
|
|
254
272
|
const d = [{
|
|
255
273
|
type: identifier_1.ReferenceType.BuiltInFunction,
|
|
256
274
|
definedAt: id,
|
|
@@ -261,7 +279,7 @@ class BuiltIns {
|
|
|
261
279
|
name,
|
|
262
280
|
nodeId: id
|
|
263
281
|
}];
|
|
264
|
-
this.set(
|
|
282
|
+
this.set(n, d, assumePrimitive);
|
|
265
283
|
}
|
|
266
284
|
}
|
|
267
285
|
/**
|
|
@@ -272,7 +290,7 @@ class BuiltIns {
|
|
|
272
290
|
(0, assert_1.guard)(replacer !== undefined, () => `Processor for ${BuiltInProcName.Replacement} is undefined!`);
|
|
273
291
|
for (const assignment of names) {
|
|
274
292
|
for (const suffix of suffixes) {
|
|
275
|
-
const effectiveName = `${assignment}${suffix}`;
|
|
293
|
+
const effectiveName = `${identifier_1.Identifier.getName(assignment)}${suffix}`;
|
|
276
294
|
const id = builtInId(effectiveName);
|
|
277
295
|
const d = [{
|
|
278
296
|
type: identifier_1.ReferenceType.BuiltInFunction,
|
|
@@ -283,7 +301,7 @@ class BuiltIns {
|
|
|
283
301
|
assignmentOperator: suffix,
|
|
284
302
|
makeMaybe: true
|
|
285
303
|
},
|
|
286
|
-
name:
|
|
304
|
+
name: assignment,
|
|
287
305
|
cds: undefined,
|
|
288
306
|
nodeId: id
|
|
289
307
|
}];
|
|
@@ -5,6 +5,7 @@ import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-i
|
|
|
5
5
|
import { CascadeAction } from '../../queries/catalog/call-context-query/cascade-action';
|
|
6
6
|
import { BuiltInProcName } from './built-in';
|
|
7
7
|
import { KnownHooks } from '../hooks';
|
|
8
|
+
import { Identifier } from './identifier';
|
|
8
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"];
|
|
9
10
|
export declare const TinyPlotCrate: readonly ["tinyplot", "plt"];
|
|
10
11
|
export declare const GraphicsPlotCreate: string[];
|
|
@@ -383,7 +384,7 @@ export declare const DefaultBuiltinConfig: [{
|
|
|
383
384
|
readonly assumePrimitive: false;
|
|
384
385
|
}, {
|
|
385
386
|
readonly type: "function";
|
|
386
|
-
readonly names: [
|
|
387
|
+
readonly names: [Identifier, Identifier];
|
|
387
388
|
readonly processor: BuiltInProcName.Library;
|
|
388
389
|
readonly config: {};
|
|
389
390
|
readonly assumePrimitive: false;
|
|
@@ -403,7 +404,7 @@ export declare const DefaultBuiltinConfig: [{
|
|
|
403
404
|
readonly assumePrimitive: true;
|
|
404
405
|
}, {
|
|
405
406
|
readonly type: "function";
|
|
406
|
-
readonly names: ["assign", "
|
|
407
|
+
readonly names: ["assign", "setValidity"];
|
|
407
408
|
readonly processor: BuiltInProcName.Assignment;
|
|
408
409
|
readonly config: {
|
|
409
410
|
readonly targetVariable: true;
|
|
@@ -542,23 +543,57 @@ export declare const DefaultBuiltinConfig: [{
|
|
|
542
543
|
readonly assumePrimitive: true;
|
|
543
544
|
}, {
|
|
544
545
|
readonly type: "function";
|
|
545
|
-
readonly names: ["
|
|
546
|
-
readonly processor: BuiltInProcName.
|
|
546
|
+
readonly names: ["UseMethod"];
|
|
547
|
+
readonly processor: BuiltInProcName.S3Dispatch;
|
|
547
548
|
readonly config: {
|
|
548
|
-
readonly
|
|
549
|
-
|
|
550
|
-
|
|
549
|
+
readonly args: {
|
|
550
|
+
readonly generic: "generic";
|
|
551
|
+
readonly object: "object";
|
|
552
|
+
};
|
|
551
553
|
};
|
|
552
554
|
readonly assumePrimitive: true;
|
|
553
555
|
}, {
|
|
554
556
|
readonly type: "function";
|
|
555
|
-
readonly names: ["
|
|
557
|
+
readonly names: ["NextMethod"];
|
|
556
558
|
readonly processor: BuiltInProcName.S3Dispatch;
|
|
557
559
|
readonly config: {
|
|
558
560
|
readonly args: {
|
|
559
561
|
readonly generic: "generic";
|
|
560
562
|
readonly object: "object";
|
|
561
563
|
};
|
|
564
|
+
readonly inferFromClosure: true;
|
|
565
|
+
};
|
|
566
|
+
readonly assumePrimitive: true;
|
|
567
|
+
}, {
|
|
568
|
+
readonly type: "function";
|
|
569
|
+
readonly names: ["new_generic"];
|
|
570
|
+
readonly processor: BuiltInProcName.S7NewGeneric;
|
|
571
|
+
readonly config: {
|
|
572
|
+
readonly args: {
|
|
573
|
+
readonly name: "name";
|
|
574
|
+
readonly dispatchArg: "dispatch_args";
|
|
575
|
+
readonly fun: "fun";
|
|
576
|
+
};
|
|
577
|
+
};
|
|
578
|
+
readonly assumePrimitive: true;
|
|
579
|
+
}, {
|
|
580
|
+
readonly type: "function";
|
|
581
|
+
readonly names: ["setGeneric"];
|
|
582
|
+
readonly processor: BuiltInProcName.S7NewGeneric;
|
|
583
|
+
readonly config: {
|
|
584
|
+
readonly args: {
|
|
585
|
+
readonly name: "name";
|
|
586
|
+
readonly dispatchArg: undefined;
|
|
587
|
+
readonly fun: "fun";
|
|
588
|
+
};
|
|
589
|
+
};
|
|
590
|
+
readonly assumePrimitive: true;
|
|
591
|
+
}, {
|
|
592
|
+
readonly type: "function";
|
|
593
|
+
readonly names: ["S7_dispatch"];
|
|
594
|
+
readonly processor: BuiltInProcName.S7Dispatch;
|
|
595
|
+
readonly config: {
|
|
596
|
+
readonly libFn: true;
|
|
562
597
|
};
|
|
563
598
|
readonly assumePrimitive: true;
|
|
564
599
|
}, {
|
|
@@ -598,6 +633,14 @@ export declare const DefaultBuiltinConfig: [{
|
|
|
598
633
|
readonly processor: BuiltInProcName.List;
|
|
599
634
|
readonly config: {};
|
|
600
635
|
readonly assumePrimitive: true;
|
|
636
|
+
}, {
|
|
637
|
+
readonly type: "function";
|
|
638
|
+
readonly names: ["Recall"];
|
|
639
|
+
readonly processor: BuiltInProcName.Recall;
|
|
640
|
+
readonly config: {
|
|
641
|
+
readonly libFn: true;
|
|
642
|
+
};
|
|
643
|
+
readonly assumePrimitive: false;
|
|
601
644
|
}, {
|
|
602
645
|
readonly type: "function";
|
|
603
646
|
readonly names: ["c"];
|
|
@@ -663,6 +706,14 @@ export declare const DefaultBuiltinConfig: [{
|
|
|
663
706
|
readonly config: {
|
|
664
707
|
readonly readIndices: true;
|
|
665
708
|
};
|
|
709
|
+
}, {
|
|
710
|
+
readonly type: "replacement";
|
|
711
|
+
readonly suffixes: ["<-", "<<-"];
|
|
712
|
+
readonly names: ["method"];
|
|
713
|
+
readonly config: {
|
|
714
|
+
readonly readIndices: true;
|
|
715
|
+
readonly constructName: "s7";
|
|
716
|
+
};
|
|
666
717
|
}, {
|
|
667
718
|
readonly type: "replacement";
|
|
668
719
|
readonly suffixes: ["<-", "<<-"];
|