@eagleoutice/flowr 1.3.13 → 1.4.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/abstract-interpretation/domain.d.ts +27 -0
- package/abstract-interpretation/domain.js +146 -0
- package/abstract-interpretation/handler/binop/binop.d.ts +16 -0
- package/abstract-interpretation/handler/binop/binop.js +40 -0
- package/abstract-interpretation/handler/binop/operators.d.ts +2 -0
- package/abstract-interpretation/handler/binop/operators.js +42 -0
- package/abstract-interpretation/handler/handler.d.ts +6 -0
- package/abstract-interpretation/handler/handler.js +3 -0
- package/abstract-interpretation/processor.d.ts +10 -0
- package/abstract-interpretation/processor.js +78 -0
- package/benchmark/slicer.d.ts +6 -5
- package/benchmark/slicer.js +2 -0
- package/benchmark/stats/print.d.ts +1 -1
- package/benchmark/stats/stats.d.ts +4 -4
- package/benchmark/stats/stats.js +1 -1
- package/cli/common/features.d.ts +1 -1
- package/cli/common/options.d.ts +1 -1
- package/cli/common/script.d.ts +1 -1
- package/cli/common/scripts-info.d.ts +2 -2
- package/cli/repl/commands/cfg.d.ts +1 -1
- package/cli/repl/commands/cfg.js +1 -1
- package/cli/repl/commands/commands.d.ts +1 -1
- package/cli/repl/commands/dataflow.d.ts +1 -1
- package/cli/repl/commands/execute.d.ts +2 -2
- package/cli/repl/commands/main.d.ts +2 -2
- package/cli/repl/commands/normalize.d.ts +1 -1
- package/cli/repl/commands/parse.d.ts +1 -1
- package/cli/repl/commands/quit.d.ts +1 -1
- package/cli/repl/commands/version.d.ts +1 -1
- package/cli/repl/core.d.ts +3 -5
- package/cli/repl/core.js +33 -6
- package/cli/repl/execute.d.ts +1 -1
- package/cli/repl/server/connection.d.ts +2 -2
- package/cli/repl/server/connection.js +3 -2
- package/cli/repl/server/messages/analysis.d.ts +3 -3
- package/cli/repl/server/messages/error.d.ts +1 -1
- package/cli/repl/server/messages/hello.d.ts +2 -2
- package/cli/repl/server/messages/messages.d.ts +6 -6
- package/cli/repl/server/messages/messages.js +26 -6
- package/cli/repl/server/messages/repl.d.ts +1 -1
- package/cli/repl/server/messages/repl.js +28 -8
- package/cli/repl/server/messages/slice.d.ts +3 -3
- package/cli/repl/server/messages/slice.js +28 -8
- package/cli/repl/server/net.d.ts +16 -0
- package/cli/repl/server/net.js +40 -1
- package/cli/repl/server/send.d.ts +2 -2
- package/cli/repl/server/server.d.ts +2 -2
- package/cli/repl/server/validate.d.ts +3 -3
- package/cli/statistics-helper-app.js +2 -2
- package/core/input.d.ts +6 -6
- package/core/output.d.ts +3 -2
- package/core/print/dataflow-printer.d.ts +3 -3
- package/core/print/normalize-printer.d.ts +2 -2
- package/core/print/parse-printer.d.ts +2 -2
- package/core/print/print.d.ts +1 -1
- package/core/print/slice-diff-ansi.d.ts +1 -1
- package/core/slicer.d.ts +5 -4
- package/core/slicer.js +6 -2
- package/core/steps.d.ts +22 -4
- package/core/steps.js +10 -2
- package/dataflow/environments/append.d.ts +1 -1
- package/dataflow/environments/environment.d.ts +4 -4
- package/dataflow/environments/overwrite.d.ts +1 -1
- package/dataflow/environments/register.d.ts +2 -2
- package/dataflow/environments/resolve-by-name.d.ts +2 -2
- package/dataflow/environments/scoping.d.ts +1 -1
- package/dataflow/extractor.d.ts +4 -4
- package/dataflow/graph/diff.d.ts +3 -3
- package/dataflow/graph/graph.d.ts +8 -7
- package/dataflow/graph/quads.d.ts +2 -2
- package/dataflow/graph/vertex.d.ts +5 -5
- package/dataflow/internal/info.d.ts +2 -2
- package/dataflow/internal/linker.d.ts +3 -3
- package/dataflow/internal/process/access.d.ts +3 -3
- package/dataflow/internal/process/expression-list.d.ts +3 -3
- package/dataflow/internal/process/expression-list.js +0 -4
- package/dataflow/internal/process/functions/argument.d.ts +4 -4
- package/dataflow/internal/process/functions/exit-points.d.ts +1 -1
- package/dataflow/internal/process/functions/function-call.d.ts +3 -3
- package/dataflow/internal/process/functions/function-definition.d.ts +3 -3
- package/dataflow/internal/process/functions/parameter.d.ts +3 -3
- package/dataflow/internal/process/if-then-else.d.ts +3 -3
- package/dataflow/internal/process/loops/for-loop.d.ts +3 -3
- package/dataflow/internal/process/loops/repeat-loop.d.ts +3 -3
- package/dataflow/internal/process/loops/while-loop.d.ts +3 -3
- package/dataflow/internal/process/operators/assignment.d.ts +3 -3
- package/dataflow/internal/process/operators/non-assignment-binary-op.d.ts +3 -3
- package/dataflow/internal/process/operators/pipe.d.ts +3 -3
- package/dataflow/internal/process/operators/unary-op.d.ts +3 -3
- package/dataflow/internal/process/symbol.d.ts +3 -3
- package/dataflow/internal/process/uninteresting-leaf.d.ts +2 -2
- package/dataflow/processor.d.ts +3 -3
- package/flowr.d.ts +3 -2
- package/flowr.js +5 -3
- package/package.json +11 -2
- package/r-bridge/lang-4.x/ast/model/collect.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/model.d.ts +6 -6
- package/r-bridge/lang-4.x/ast/model/nodes/info/index.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/operators.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/processing/fold.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/processing/visitor.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/xml/config.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/data.d.ts +5 -5
- package/r-bridge/lang-4.x/ast/parser/xml/hooks.d.ts +5 -5
- package/r-bridge/lang-4.x/ast/parser/xml/input-format.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/xml/internal/access.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/control/if-then-else.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/control/if-then.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/expression/expression.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/argument.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/call.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/definition.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/parameter.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/break.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/for.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/next.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/repeat.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/while.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/meta.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/binary.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/special.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/unary.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/other/comment.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/other/line-directive.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/elements.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/root.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/single-element.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/number.d.ts +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/string.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/symbol.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/xml-to-json.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/parser/xml/parser.d.ts +4 -4
- package/r-bridge/retriever.d.ts +2 -2
- package/r-bridge/shell-executor.d.ts +25 -0
- package/r-bridge/shell-executor.js +119 -0
- package/r-bridge/shell.d.ts +8 -5
- package/r-bridge/shell.js +6 -3
- package/reconstruct/reconstruct.d.ts +1 -1
- package/slicing/criterion/collect-all.d.ts +3 -3
- package/slicing/criterion/filters/all-variables.d.ts +1 -1
- package/slicing/criterion/parse.d.ts +1 -1
- package/slicing/static/static-slicer.d.ts +3 -3
- package/statistics/features/common-syntax-probability.d.ts +3 -2
- package/statistics/features/common-syntax-probability.js +0 -3
- package/statistics/features/feature.d.ts +6 -6
- package/statistics/features/post-processing.d.ts +2 -2
- package/statistics/features/supported/assignments/assignments.d.ts +2 -2
- package/statistics/features/supported/assignments/post-process.d.ts +2 -2
- package/statistics/features/supported/comments/comments.d.ts +2 -2
- package/statistics/features/supported/comments/post-process.d.ts +2 -2
- package/statistics/features/supported/control-flow/control-flow.d.ts +2 -2
- package/statistics/features/supported/control-flow/post-process.d.ts +2 -2
- package/statistics/features/supported/data-access/data-access.d.ts +3 -3
- package/statistics/features/supported/data-access/post-process.d.ts +2 -2
- package/statistics/features/supported/defined-functions/defined-functions.d.ts +4 -4
- package/statistics/features/supported/defined-functions/post-process.d.ts +2 -2
- package/statistics/features/supported/expression-list/expression-list.d.ts +2 -2
- package/statistics/features/supported/expression-list/post-process.d.ts +2 -2
- package/statistics/features/supported/loops/loops.d.ts +2 -2
- package/statistics/features/supported/loops/post-process.d.ts +2 -2
- package/statistics/features/supported/used-functions/post-process.d.ts +2 -2
- package/statistics/features/supported/used-functions/used-functions.d.ts +3 -3
- package/statistics/features/supported/used-packages/post-process.d.ts +2 -2
- package/statistics/features/supported/used-packages/used-packages.d.ts +2 -2
- package/statistics/features/supported/values/post-process.d.ts +2 -2
- package/statistics/features/supported/values/values.d.ts +2 -2
- package/statistics/features/supported/variables/post-process.d.ts +3 -3
- package/statistics/features/supported/variables/variables.d.ts +2 -2
- package/statistics/meta-statistics.d.ts +1 -1
- package/statistics/output/print-stats.d.ts +2 -2
- package/statistics/output/statistics-file.d.ts +1 -1
- package/statistics/statistics.d.ts +4 -4
- package/util/{cfg.d.ts → cfg/cfg.d.ts} +18 -6
- package/util/{cfg.js → cfg/cfg.js} +42 -37
- package/util/cfg/visitor.d.ts +14 -0
- package/util/cfg/visitor.js +64 -0
- package/util/diff.d.ts +1 -1
- package/util/files.d.ts +1 -1
- package/util/mermaid/ast.d.ts +1 -1
- package/util/mermaid/cfg.d.ts +2 -2
- package/util/mermaid/dfg.d.ts +3 -3
- package/util/objects.d.ts +1 -1
- package/util/quads.d.ts +2 -2
- package/util/summarizer/benchmark/data.d.ts +1 -1
- package/util/summarizer/benchmark/first-phase/process.d.ts +3 -3
- package/util/summarizer/benchmark/second-phase/graph.d.ts +1 -1
- package/util/summarizer/benchmark/second-phase/process.d.ts +1 -1
- package/util/summarizer/benchmark/summarizer.d.ts +3 -2
- package/util/summarizer/benchmark/summarizer.js +0 -4
- package/util/summarizer/statistics/post-process/clusterer.d.ts +2 -2
- package/util/summarizer/statistics/post-process/file-based-count.d.ts +1 -1
- package/util/summarizer/statistics/post-process/histogram.d.ts +2 -2
- package/util/summarizer/statistics/post-process/post-process-output.d.ts +2 -2
- package/util/summarizer/statistics/second-phase/process.d.ts +2 -2
- package/util/summarizer/statistics/summarizer.d.ts +3 -2
- package/util/summarizer/summarizer.d.ts +1 -1
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.RShellExecutor = void 0;
|
|
7
|
+
const shell_1 = require("./shell");
|
|
8
|
+
const objects_1 = require("../util/objects");
|
|
9
|
+
const child_process_1 = require("child_process");
|
|
10
|
+
const lang_4_x_1 = require("./lang-4.x");
|
|
11
|
+
const preload_1 = __importDefault(require("semver/preload"));
|
|
12
|
+
const log_1 = require("../util/log");
|
|
13
|
+
const fs_1 = __importDefault(require("fs"));
|
|
14
|
+
const retriever_1 = require("./retriever");
|
|
15
|
+
class RShellExecutor {
|
|
16
|
+
options;
|
|
17
|
+
log;
|
|
18
|
+
prerequisites = [];
|
|
19
|
+
constructor(options) {
|
|
20
|
+
this.options = (0, objects_1.deepMergeObject)(shell_1.DEFAULT_R_SHELL_OPTIONS, options);
|
|
21
|
+
this.log = log_1.log.getSubLogger({ name: 'RShellExecutor' });
|
|
22
|
+
}
|
|
23
|
+
continueOnError() {
|
|
24
|
+
this.log.info('continue in case of Errors');
|
|
25
|
+
this.addPrerequisites('options(error=function() {})');
|
|
26
|
+
return this;
|
|
27
|
+
}
|
|
28
|
+
injectLibPaths(...paths) {
|
|
29
|
+
this.log.debug(`injecting lib paths ${JSON.stringify(paths)}`);
|
|
30
|
+
this.addPrerequisites(`.libPaths(c(.libPaths(), ${paths.map(lang_4_x_1.ts2r).join(',')}))`);
|
|
31
|
+
return this;
|
|
32
|
+
}
|
|
33
|
+
tryToInjectHomeLibPath() {
|
|
34
|
+
if (this.options.homeLibPath === undefined) {
|
|
35
|
+
this.log.debug('ensuring home lib path exists (automatic inject)');
|
|
36
|
+
this.addPrerequisites([
|
|
37
|
+
'if(!dir.exists(Sys.getenv("R_LIBS_USER"))) { dir.create(path=Sys.getenv("R_LIBS_USER"),showWarnings=FALSE,recursive=TRUE) }',
|
|
38
|
+
'.libPaths(c(.libPaths(), Sys.getenv("R_LIBS_USER")))'
|
|
39
|
+
]);
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
this.injectLibPaths(this.options.homeLibPath);
|
|
43
|
+
}
|
|
44
|
+
return this;
|
|
45
|
+
}
|
|
46
|
+
addPrerequisites(commands) {
|
|
47
|
+
this.prerequisites.push(...(typeof commands == 'string' ? [commands] : commands));
|
|
48
|
+
return this;
|
|
49
|
+
}
|
|
50
|
+
usedRVersion() {
|
|
51
|
+
const version = this.run(`cat(paste0(R.version$major,".",R.version$minor), ${(0, lang_4_x_1.ts2r)(this.options.eol)})`);
|
|
52
|
+
this.log.trace(`raw version: ${JSON.stringify(version)}`);
|
|
53
|
+
return preload_1.default.coerce(version);
|
|
54
|
+
}
|
|
55
|
+
allInstalledPackages() {
|
|
56
|
+
this.log.debug('getting all installed packages');
|
|
57
|
+
const packages = this.run(`cat(paste0(installed.packages()[,1], collapse=","),"${this.options.eol}")`);
|
|
58
|
+
return packages.split(',');
|
|
59
|
+
}
|
|
60
|
+
isPackageInstalled(packageName) {
|
|
61
|
+
this.log.debug(`checking if package "${packageName}" is installed`);
|
|
62
|
+
return this.run(`cat(system.file(package="${packageName}")!="","${this.options.eol}")`) === 'TRUE';
|
|
63
|
+
}
|
|
64
|
+
ensurePackageInstalled(packageName, autoload = false, force = false) {
|
|
65
|
+
const packageExistedAlready = this.isPackageInstalled(packageName);
|
|
66
|
+
if (!force && packageExistedAlready) {
|
|
67
|
+
this.log.info(`package "${packageName}" is already installed`);
|
|
68
|
+
if (autoload)
|
|
69
|
+
this.addPrerequisites(`library(${(0, lang_4_x_1.ts2r)(packageName)})`);
|
|
70
|
+
return { packageName, packageExistedAlready };
|
|
71
|
+
}
|
|
72
|
+
const tempDir = this.obtainTempDir();
|
|
73
|
+
this.log.debug(`using temporary directory: "${tempDir}" to install package "${packageName}"`);
|
|
74
|
+
this.run(`install.packages(${(0, lang_4_x_1.ts2r)(packageName)},repos="https://cloud.r-project.org/",quiet=FALSE,lib=temp)`);
|
|
75
|
+
if (autoload)
|
|
76
|
+
this.addPrerequisites(`library(${(0, lang_4_x_1.ts2r)(packageName)},lib.loc=temp)`);
|
|
77
|
+
return { packageName, packageExistedAlready, libraryLocation: tempDir };
|
|
78
|
+
}
|
|
79
|
+
obtainTempDir() {
|
|
80
|
+
const tempDir = this.run([
|
|
81
|
+
'temp <- tempdir()',
|
|
82
|
+
`cat(temp, ${(0, lang_4_x_1.ts2r)(this.options.eol)})`
|
|
83
|
+
]);
|
|
84
|
+
log_1.log.info(`obtained temp dir ${tempDir}`);
|
|
85
|
+
const deleteOnExit = function () {
|
|
86
|
+
if (fs_1.default.existsSync(tempDir)) {
|
|
87
|
+
log_1.log.info(`deleting temp dir ${tempDir}`);
|
|
88
|
+
fs_1.default.rmSync(tempDir, { recursive: true, force: true });
|
|
89
|
+
}
|
|
90
|
+
};
|
|
91
|
+
process.on('SIGINT', deleteOnExit);
|
|
92
|
+
process.on('SIGTERM', deleteOnExit);
|
|
93
|
+
return tempDir;
|
|
94
|
+
}
|
|
95
|
+
getTokenMap() {
|
|
96
|
+
this.ensurePackageInstalled('xmlparsedata', true);
|
|
97
|
+
// we invert the token map to get a mapping back from the replacement
|
|
98
|
+
const parsed = (0, lang_4_x_1.parseCSV)(this.run('write.table(xmlparsedata::xml_parse_token_map,sep=",",col.names=FALSE)').split('\n'));
|
|
99
|
+
if (parsed.some(s => s.length !== 2))
|
|
100
|
+
throw new Error(`Expected two columns in token map, but got ${JSON.stringify(parsed)}`);
|
|
101
|
+
// we swap key and value to get the other direction, furthermore we remove quotes from keys if they are quoted
|
|
102
|
+
const ret = {};
|
|
103
|
+
for (const [key, value] of parsed)
|
|
104
|
+
ret[value] = (0, retriever_1.removeTokenMapQuotationMarks)(key);
|
|
105
|
+
return ret;
|
|
106
|
+
}
|
|
107
|
+
run(commands, returnErr = false) {
|
|
108
|
+
this.log.trace(`> ${JSON.stringify(commands)}`);
|
|
109
|
+
const returns = (0, child_process_1.spawnSync)(this.options.pathToRExecutable, this.options.commandLineOptions, {
|
|
110
|
+
env: this.options.env,
|
|
111
|
+
cwd: this.options.cwd,
|
|
112
|
+
encoding: 'utf8',
|
|
113
|
+
input: [...this.prerequisites, commands].join(this.options.eol)
|
|
114
|
+
});
|
|
115
|
+
return (returnErr ? returns.stderr : returns.stdout).trim();
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
exports.RShellExecutor = RShellExecutor;
|
|
119
|
+
//# sourceMappingURL=shell-executor.js.map
|
package/r-bridge/shell.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
import { type MergeableRecord } from '../util/objects';
|
|
3
|
-
import { SemVer } from 'semver';
|
|
4
|
-
import { TokenMap } from './retriever';
|
|
3
|
+
import type { SemVer } from 'semver';
|
|
4
|
+
import type { TokenMap } from './retriever';
|
|
5
5
|
export type OutputStreamSelector = 'stdout' | 'stderr' | 'both';
|
|
6
6
|
export interface CollectorTimeout extends MergeableRecord {
|
|
7
7
|
/**
|
|
@@ -33,7 +33,7 @@ export interface OutputCollectorConfiguration extends MergeableRecord {
|
|
|
33
33
|
automaticallyTrimOutput: boolean;
|
|
34
34
|
}
|
|
35
35
|
export declare const DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION: OutputCollectorConfiguration;
|
|
36
|
-
export interface
|
|
36
|
+
export interface RShellExecutionOptions extends MergeableRecord {
|
|
37
37
|
/** The path to the R executable, can be only the executable if it is to be found on the PATH. */
|
|
38
38
|
readonly pathToRExecutable: string;
|
|
39
39
|
/** Command line options to use when starting the R session. */
|
|
@@ -44,12 +44,14 @@ export interface RShellSessionOptions extends MergeableRecord {
|
|
|
44
44
|
readonly eol: string;
|
|
45
45
|
/** The environment variables available in the R session. */
|
|
46
46
|
readonly env: NodeJS.ProcessEnv;
|
|
47
|
+
/** The path to the library directory, use undefined to let R figure that out for itself */
|
|
48
|
+
readonly homeLibPath: string | undefined;
|
|
49
|
+
}
|
|
50
|
+
export interface RShellSessionOptions extends RShellExecutionOptions {
|
|
47
51
|
/** If set, the R session will be restarted if it exits due to an error */
|
|
48
52
|
readonly revive: 'never' | 'on-error' | 'always';
|
|
49
53
|
/** Called when the R session is restarted, this makes only sense if `revive` is not set to `'never'` */
|
|
50
54
|
readonly onRevive: (code: number, signal: string | null) => void;
|
|
51
|
-
/** The path to the library directory, use undefined to let R figure that out for itself */
|
|
52
|
-
readonly homeLibPath: string | undefined;
|
|
53
55
|
}
|
|
54
56
|
/**
|
|
55
57
|
* Configuration of an {@link RShell} instance.
|
|
@@ -58,6 +60,7 @@ export interface RShellSessionOptions extends MergeableRecord {
|
|
|
58
60
|
export interface RShellOptions extends RShellSessionOptions {
|
|
59
61
|
readonly sessionName: string;
|
|
60
62
|
}
|
|
63
|
+
export declare const DEFAULT_R_SHELL_EXEC_OPTIONS: RShellExecutionOptions;
|
|
61
64
|
export declare const DEFAULT_R_SHELL_OPTIONS: RShellOptions;
|
|
62
65
|
/**
|
|
63
66
|
* The `RShell` represents an interactive session with the R interpreter.
|
package/r-bridge/shell.js
CHANGED
|
@@ -26,7 +26,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.RShell = exports.DEFAULT_R_SHELL_OPTIONS = exports.DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION = void 0;
|
|
29
|
+
exports.RShell = exports.DEFAULT_R_SHELL_OPTIONS = exports.DEFAULT_R_SHELL_EXEC_OPTIONS = exports.DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION = void 0;
|
|
30
30
|
const child_process_1 = require("child_process");
|
|
31
31
|
const objects_1 = require("../util/objects");
|
|
32
32
|
const readline = __importStar(require("node:readline"));
|
|
@@ -47,14 +47,17 @@ exports.DEFAULT_OUTPUT_COLLECTOR_CONFIGURATION = {
|
|
|
47
47
|
automaticallyTrimOutput: true,
|
|
48
48
|
errorStopsWaiting: true
|
|
49
49
|
};
|
|
50
|
-
exports.
|
|
51
|
-
sessionName: 'default',
|
|
50
|
+
exports.DEFAULT_R_SHELL_EXEC_OPTIONS = {
|
|
52
51
|
pathToRExecutable: (0, os_1.getPlatform)() === 'windows' ? 'R.exe' : 'R',
|
|
53
52
|
commandLineOptions: ['--vanilla', '--quiet', '--no-echo', '--no-save'],
|
|
54
53
|
cwd: process.cwd(),
|
|
55
54
|
env: process.env,
|
|
56
55
|
eol: '\n',
|
|
57
56
|
homeLibPath: (0, os_1.getPlatform)() === 'windows' ? undefined : '~/.r-libs',
|
|
57
|
+
};
|
|
58
|
+
exports.DEFAULT_R_SHELL_OPTIONS = {
|
|
59
|
+
...exports.DEFAULT_R_SHELL_EXEC_OPTIONS,
|
|
60
|
+
sessionName: 'default',
|
|
58
61
|
revive: 'never',
|
|
59
62
|
onRevive: () => { }
|
|
60
63
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* as the file itself is way too long). See {@link reconstructToCode}.
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { NormalizedAst, NodeId, ParentInformation, RNode } from '../r-bridge';
|
|
6
|
+
import type { NormalizedAst, NodeId, ParentInformation, RNode } from '../r-bridge';
|
|
7
7
|
type Selection = Set<NodeId>;
|
|
8
8
|
export declare const reconstructLogger: import("tslog").Logger<import("tslog").ILogObj>;
|
|
9
9
|
/** The structure of the predicate that should be used to determine if a given normalized node should be included in the reconstructed code independent of if it is selected by the slice or not */
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* This module provides a function to collect all slicing criteria.
|
|
4
4
|
* @module
|
|
5
5
|
*/
|
|
6
|
-
import { MergeableRecord } from '../../util/objects';
|
|
7
|
-
import { NodeId, RNodeWithParent } from '../../r-bridge';
|
|
8
|
-
import { SlicingCriteria } from './parse';
|
|
6
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
7
|
+
import type { NodeId, RNodeWithParent } from '../../r-bridge';
|
|
8
|
+
import type { SlicingCriteria } from './parse';
|
|
9
9
|
/**
|
|
10
10
|
* Defines the filter for collecting all possible slicing criteria.
|
|
11
11
|
* @see DefaultAllVariablesFilter
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { SlicingCriteriaFilter } from '../collect-all';
|
|
1
|
+
import type { SlicingCriteriaFilter } from '../collect-all';
|
|
2
2
|
export declare const DefaultAllVariablesFilter: SlicingCriteriaFilter;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NormalizedAst, NodeId, NoInfo, ParentInformation } from '../../r-bridge';
|
|
1
|
+
import type { NormalizedAst, NodeId, NoInfo, ParentInformation } from '../../r-bridge';
|
|
2
2
|
/** Either `line:column`, `line@variable-name`, or `$id` */
|
|
3
3
|
export type SingleSlicingCriterion = `${number}:${number}` | `${number}@${string}` | `$${number}`;
|
|
4
4
|
export type SlicingCriteria = SingleSlicingCriterion[];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { DataflowGraph } from '../../dataflow';
|
|
2
|
-
import { NodeId, NormalizedAst } from '../../r-bridge';
|
|
3
|
-
import { DecodedCriteria, SlicingCriteria } from '../criterion';
|
|
1
|
+
import type { DataflowGraph } from '../../dataflow';
|
|
2
|
+
import type { NodeId, NormalizedAst } from '../../r-bridge';
|
|
3
|
+
import type { DecodedCriteria, SlicingCriteria } from '../criterion';
|
|
4
4
|
export declare const slicerLogger: import("tslog").Logger<import("tslog").ILogObj>;
|
|
5
5
|
/**
|
|
6
6
|
* The result of the slice step
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Defines the type of syntax constructs that we track (e.g., true, false, 0, 1, T, F, conditions...)
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import type { RNodeWithParent } from '../../r-bridge';
|
|
5
|
+
import { RFalse, RTrue } from '../../r-bridge';
|
|
6
|
+
import type { SummarizedMeasurement } from '../../util/summarizer/benchmark/data';
|
|
6
7
|
export interface CommonSyntaxTypeCounts<Measurement = bigint> {
|
|
7
8
|
total: Measurement;
|
|
8
9
|
multiple: Measurement;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.summarizeCommonSyntaxTypeCounter = exports.appendCommonSyntaxTypeCounter = exports.updateCommonSyntaxTypeCounts = exports.emptyCommonSyntaxTypeCounts = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Defines the type of syntax constructs that we track (e.g., true, false, 0, 1, T, F, conditions...)
|
|
6
|
-
*/
|
|
7
4
|
const r_bridge_1 = require("../../r-bridge");
|
|
8
5
|
const process_1 = require("../../util/summarizer/benchmark/first-phase/process");
|
|
9
6
|
const numbers_1 = require("../../util/numbers");
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { EvalOptions } from 'xpath-ts2/src/parse-api';
|
|
2
|
-
import { MergeableRecord } from '../../util/objects';
|
|
3
|
-
import { NormalizedAst } from '../../r-bridge';
|
|
4
|
-
import { DataflowInformation } from '../../dataflow/internal/info';
|
|
5
|
-
import { MetaStatistics } from '../meta-statistics';
|
|
6
|
-
import { StatisticsSummarizerConfiguration } from '../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { EvalOptions } from 'xpath-ts2/src/parse-api';
|
|
2
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
3
|
+
import type { NormalizedAst } from '../../r-bridge';
|
|
4
|
+
import type { DataflowInformation } from '../../dataflow/internal/info';
|
|
5
|
+
import type { MetaStatistics } from '../meta-statistics';
|
|
6
|
+
import type { StatisticsSummarizerConfiguration } from '../../util/summarizer/statistics/summarizer';
|
|
7
7
|
/**
|
|
8
8
|
* Maps each sub-feature name to the number of occurrences of that sub-feature.
|
|
9
9
|
* Allows for one nesting level to denote hierarchical features.
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { MergeableRecord } from '../../util/objects';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { MergeableRecord } from '../../util/objects';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export interface SummarizedWithProject<Uniques = Set<string>, Count = number[]> {
|
|
4
4
|
uniqueProjects: Uniques;
|
|
5
5
|
uniqueFiles: Uniques;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
3
|
declare const initialAssignmentInfo: {
|
|
4
4
|
assignmentOperator: Record<string, bigint>;
|
|
5
5
|
assigned: import("../../common-syntax-probability").CommonSyntaxTypeCounts<bigint>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
3
|
export declare const initialCommentInfo: {
|
|
4
4
|
totalAmount: number;
|
|
5
5
|
roxygenComments: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
3
|
declare const initialControlflowInfo: {
|
|
4
4
|
ifThen: import("../../common-syntax-probability").CommonSyntaxTypeCounts<bigint>;
|
|
5
5
|
thenBody: import("../../common-syntax-probability").CommonSyntaxTypeCounts<bigint>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
3
|
-
import { CommonSyntaxTypeCounts } from '../../common-syntax-probability';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
|
+
import type { CommonSyntaxTypeCounts } from '../../common-syntax-probability';
|
|
4
4
|
declare const initialDataAccessInfo: {
|
|
5
5
|
singleBracket: Record<number, bigint | CommonSyntaxTypeCounts<bigint>>;
|
|
6
6
|
doubleBracket: Record<number, bigint | CommonSyntaxTypeCounts<bigint>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
3
|
-
import { SourcePosition } from '../../../../util/range';
|
|
4
|
-
import { MergeableRecord } from '../../../../util/objects';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
|
+
import type { SourcePosition } from '../../../../util/range';
|
|
4
|
+
import type { MergeableRecord } from '../../../../util/objects';
|
|
5
5
|
declare const initialFunctionDefinitionInfo: {
|
|
6
6
|
/** all, anonymous, assigned, non-assigned, ... */
|
|
7
7
|
total: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
/**
|
|
4
4
|
* Note: the summary does not contain a 0 for each function that is _not_ called by a file. Hence, the minimum can not be 0 (division for mean etc. will still be performed on total file count)
|
|
5
5
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Writable } from 'ts-essentials';
|
|
2
|
-
import { Feature } from '../../feature';
|
|
1
|
+
import type { Writable } from 'ts-essentials';
|
|
2
|
+
import type { Feature } from '../../feature';
|
|
3
3
|
declare const initialExpressionListInfo: {
|
|
4
4
|
allExpressionLists: number;
|
|
5
5
|
deepestNesting: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
3
|
declare const initialLoopInfo: {
|
|
4
4
|
forLoops: import("../../common-syntax-probability").CommonSyntaxTypeCounts<bigint>;
|
|
5
5
|
forLoopVar: import("../../common-syntax-probability").CommonSyntaxTypeCounts<bigint>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
/**
|
|
4
4
|
* Note: the summary does not contain a 0 for each function that is _not_ called by a file. Hence, the minimum can not be 0 (division for mean etc. will still be performed on total file count)
|
|
5
5
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
3
|
-
import { CommonSyntaxTypeCounts } from '../../common-syntax-probability';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
|
+
import type { CommonSyntaxTypeCounts } from '../../common-syntax-probability';
|
|
4
4
|
declare const initialFunctionUsageInfo: {
|
|
5
5
|
allFunctionCalls: number;
|
|
6
6
|
args: Record<number, bigint | CommonSyntaxTypeCounts<bigint>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
3
|
export declare const initialUsedPackageInfos: {
|
|
4
4
|
library: number;
|
|
5
5
|
require: number;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
3
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
3
|
declare const initialValueInfo: {
|
|
4
4
|
allNumerics: number;
|
|
5
5
|
imaginaryNumbers: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
-
import { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
|
-
import { SummarizedWithProject } from '../../post-processing';
|
|
1
|
+
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
|
+
import type { StatisticsSummarizerConfiguration } from '../../../../util/summarizer/statistics/summarizer';
|
|
3
|
+
import type { SummarizedWithProject } from '../../post-processing';
|
|
4
4
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
5
5
|
type VariableInfoMap = Map<string, SummarizedWithProject & {
|
|
6
6
|
linePercentageInFile: number[][];
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Feature } from '../../feature';
|
|
2
|
-
import { Writable } from 'ts-essentials';
|
|
1
|
+
import type { Feature } from '../../feature';
|
|
2
|
+
import type { Writable } from 'ts-essentials';
|
|
3
3
|
declare const initialVariableInfo: {
|
|
4
4
|
numberOfVariableUses: number;
|
|
5
5
|
numberOfDefinitions: number;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { FeatureKey, FeatureStatistics } from '../features';
|
|
2
|
-
import { MetaStatistics } from '../meta-statistics';
|
|
1
|
+
import type { FeatureKey, FeatureStatistics } from '../features';
|
|
2
|
+
import type { MetaStatistics } from '../meta-statistics';
|
|
3
3
|
interface MinMaxAvgMedian {
|
|
4
4
|
sum: number;
|
|
5
5
|
min: number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { RParseRequestFromFile, RParseRequestFromText, RShell } from '../r-bridge';
|
|
2
|
-
import { FeatureSelection, FeatureStatistics } from './features';
|
|
3
|
-
import { MetaStatistics } from './meta-statistics';
|
|
4
|
-
import { StepResults } from '../core';
|
|
1
|
+
import type { RParseRequestFromFile, RParseRequestFromText, RShell } from '../r-bridge';
|
|
2
|
+
import type { FeatureSelection, FeatureStatistics } from './features';
|
|
3
|
+
import type { MetaStatistics } from './meta-statistics';
|
|
4
|
+
import type { StepResults } from '../core';
|
|
5
5
|
/**
|
|
6
6
|
* By default, {@link extractUsageStatistics} requires a generator, but sometimes you already know all the files
|
|
7
7
|
* that you want to process. This function simply reps your requests as a generator.
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import { NodeId, NormalizedAst, ParentInformation
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import type { NodeId, NormalizedAst, ParentInformation } from '../../r-bridge';
|
|
2
|
+
import { RFalse, RTrue } from '../../r-bridge';
|
|
3
|
+
import type { MergeableRecord } from '../objects';
|
|
4
|
+
import type { QuadSerializationConfiguration } from '../quads';
|
|
5
|
+
export declare const enum CfgVertexType {
|
|
6
|
+
/** Marks a break point in a construct (e.g., between the name and the value of an argument, or the formals and the body of a function) */
|
|
7
|
+
MidMarker = "mid-marker",
|
|
8
|
+
/** The explicit exit-nodes to ensure the hammock property */
|
|
9
|
+
EndMarker = "end-marker",
|
|
10
|
+
/** something like an if, assignment, ... even though in the classical sense of R they are still expressions */
|
|
11
|
+
Statement = "statement",
|
|
12
|
+
/** something like an addition, ... */
|
|
13
|
+
Expression = "expression"
|
|
14
|
+
}
|
|
4
15
|
export interface CfgVertex {
|
|
5
16
|
id: NodeId;
|
|
17
|
+
type: CfgVertexType;
|
|
6
18
|
name: string;
|
|
7
19
|
/** in case of a function definition */
|
|
8
20
|
children?: NodeId[];
|
|
@@ -14,7 +26,7 @@ interface CfgControlDependencyEdge extends MergeableRecord {
|
|
|
14
26
|
label: 'CD';
|
|
15
27
|
when: typeof RTrue | typeof RFalse;
|
|
16
28
|
}
|
|
17
|
-
export type
|
|
29
|
+
export type CfgEdge = CfgFlowDependencyEdge | CfgControlDependencyEdge;
|
|
18
30
|
/**
|
|
19
31
|
* This class represents the control flow graph of an R program.
|
|
20
32
|
* The control flow may be hierarchical when confronted with function definitions (see {@link CfgVertex} and {@link CFG#rootVertexIds|rootVertexIds()}).
|
|
@@ -24,10 +36,10 @@ export declare class ControlFlowGraph {
|
|
|
24
36
|
private vertexInformation;
|
|
25
37
|
private edgeInformation;
|
|
26
38
|
addVertex(vertex: CfgVertex, rootVertex?: boolean): this;
|
|
27
|
-
addEdge(from: NodeId, to: NodeId, edge:
|
|
39
|
+
addEdge(from: NodeId, to: NodeId, edge: CfgEdge): this;
|
|
28
40
|
rootVertexIds(): ReadonlySet<NodeId>;
|
|
29
41
|
vertices(): ReadonlyMap<NodeId, CfgVertex>;
|
|
30
|
-
edges(): ReadonlyMap<NodeId, ReadonlyMap<NodeId,
|
|
42
|
+
edges(): ReadonlyMap<NodeId, ReadonlyMap<NodeId, CfgEdge>>;
|
|
31
43
|
merge(other: ControlFlowGraph, forceNested?: boolean): this;
|
|
32
44
|
}
|
|
33
45
|
export interface ControlFlowInformation extends MergeableRecord {
|