@eagleoutice/flowr 2.13.13 → 2.13.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -26
- package/benchmark/calibration.d.ts +18 -0
- package/benchmark/calibration.js +63 -0
- package/benchmark/slicer.d.ts +19 -0
- package/benchmark/slicer.js +84 -1
- package/benchmark/stats/feature-counts.d.ts +6 -0
- package/benchmark/stats/feature-counts.js +61 -0
- package/benchmark/stats/print.js +20 -0
- package/benchmark/stats/sigdb-counts.d.ts +7 -0
- package/benchmark/stats/sigdb-counts.js +219 -0
- package/benchmark/stats/size-of.d.ts +6 -0
- package/benchmark/stats/size-of.js +8 -0
- package/benchmark/stats/stats.d.ts +79 -0
- package/benchmark/stats/stats.js +7 -1
- package/benchmark/stopwatch.d.ts +4 -0
- package/benchmark/stopwatch.js +12 -1
- package/benchmark/summarizer/data.d.ts +17 -1
- package/benchmark/summarizer/first-phase/input.js +5 -0
- package/benchmark/summarizer/first-phase/process.js +12 -2
- package/benchmark/summarizer/second-phase/graph.d.ts +1 -1
- package/benchmark/summarizer/second-phase/graph.js +214 -16
- package/benchmark/summarizer/second-phase/process.js +56 -0
- package/benchmark/summarizer/summarizer.js +1 -2
- package/cli/benchmark-app.d.ts +1 -0
- package/cli/benchmark-app.js +2 -1
- package/cli/benchmark-helper-app.d.ts +1 -0
- package/cli/benchmark-helper-app.js +12 -2
- package/cli/common/options.d.ts +10 -0
- package/cli/common/options.js +3 -1
- package/cli/common/scripts-info.d.ts +10 -0
- package/control-flow/cfg-builder.d.ts +30 -0
- package/control-flow/cfg-builder.js +79 -0
- package/control-flow/extract-cfg.js +17 -10
- package/dataflow/environments/apply-kill.d.ts +3 -3
- package/dataflow/environments/apply-kill.js +60 -31
- package/dataflow/environments/reference-to-maybe.d.ts +5 -3
- package/dataflow/environments/reference-to-maybe.js +17 -52
- package/dataflow/environments/resolve-helper.d.ts +2 -1
- package/dataflow/environments/resolve-helper.js +2 -1
- package/dataflow/graph/df-helper.d.ts +2 -1
- package/dataflow/info.d.ts +7 -1
- package/dataflow/info.js +36 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +33 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +6 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +7 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +8 -1
- package/documentation/doc-readme.js +5 -2
- package/documentation/doc-util/doc-issue.d.ts +2 -0
- package/documentation/doc-util/doc-issue.js +3 -1
- package/documentation/wiki-dataflow-graph.js +4 -0
- package/documentation/wiki-faq.js +6 -2
- package/documentation/wiki-onboarding.js +11 -1
- package/documentation/wiki-setup.js +2 -1
- package/package.json +9 -4
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +11 -9
- package/slicing/static/slice-call.js +4 -4
- package/util/node-version.d.ts +4 -0
- package/util/node-version.js +29 -0
- package/util/version.js +1 -1
|
@@ -67,6 +67,9 @@ function processForLoop(name, args, rootId, data) {
|
|
|
67
67
|
(0, reference_to_maybe_1.applyCdToReferences)(body.out, cd);
|
|
68
68
|
const outgoing = variable.out.concat(writtenVariable, body.out);
|
|
69
69
|
(0, linker_1.linkCircularRedefinitionsWithinALoop)(nextGraph, nameIdShares, body.out, body.environment);
|
|
70
|
+
/* the loop variable is bound by the head whenever the body runs, so reads of it are not ingoing */
|
|
71
|
+
const loopVariables = new Set(writtenVariable.map(w => w.name));
|
|
72
|
+
const bodyReadsOfOthers = [...nameIdShares.entries()].filter(([n]) => !loopVariables.has(n)).flatMap(([, refs]) => refs);
|
|
70
73
|
(0, linker_1.reapplyLoopExitPoints)(body.exitPoints, body.in.concat(body.out, body.unknownReferences), nextGraph);
|
|
71
74
|
(0, common_1.patchFunctionCall)({
|
|
72
75
|
nextGraph,
|
|
@@ -86,7 +89,7 @@ function processForLoop(name, args, rootId, data) {
|
|
|
86
89
|
return {
|
|
87
90
|
unknownReferences: [],
|
|
88
91
|
// we only want those not bound by a local variable
|
|
89
|
-
in: [{ nodeId: rootId, name: name.content, cds: originalDependency, type: identifier_1.ReferenceType.Function }, ...vector.unknownReferences, ...
|
|
92
|
+
in: [{ nodeId: rootId, name: name.content, cds: originalDependency, type: identifier_1.ReferenceType.Function }, ...vector.unknownReferences, ...bodyReadsOfOthers],
|
|
90
93
|
out: outgoing,
|
|
91
94
|
graph: nextGraph,
|
|
92
95
|
entryPoint: name.info.id,
|
|
@@ -9,6 +9,7 @@ const common_1 = require("../common");
|
|
|
9
9
|
const unpack_argument_1 = require("../argument/unpack-argument");
|
|
10
10
|
const scoping_1 = require("../../../../../environments/scoping");
|
|
11
11
|
const identifier_1 = require("../../../../../environments/identifier");
|
|
12
|
+
const resolve_by_name_1 = require("../../../../../environments/resolve-by-name");
|
|
12
13
|
const r_argument_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
13
14
|
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
14
15
|
const built_in_envir_utils_1 = require("./built-in-envir-utils");
|
|
@@ -56,16 +57,19 @@ function processLocal(name, args, rootId, data, config) {
|
|
|
56
57
|
argumentProcessResult: [dfExpr, dfEnv],
|
|
57
58
|
origin: built_in_proc_name_1.BuiltInProcName.Local
|
|
58
59
|
});
|
|
60
|
+
const resultEnvironment = envirResolution ? data.environment : (0, scoping_1.popLocalEnvironment)(dfExpr.environment);
|
|
61
|
+
/* definitions of the local scope vanish with it, only what escaped it (e.g. via `<<-`) may bubble up */
|
|
62
|
+
const escaping = envirResolution ? dfExpr.out : dfExpr.out.filter(o => o.name !== undefined && (0, resolve_by_name_1.resolveByName)(o.name, resultEnvironment, o.type)?.some(d => d.nodeId === o.nodeId));
|
|
59
63
|
const ingoing = dfEnv.in.concat(dfExpr.in, dfEnv.unknownReferences, dfExpr.unknownReferences);
|
|
60
64
|
ingoing.push({ nodeId: rootId, name: name.content, cds: data.cds, type: identifier_1.ReferenceType.Function });
|
|
61
65
|
const baseResult = {
|
|
62
66
|
hooks: dfExpr.hooks.concat(dfEnv.hooks),
|
|
63
|
-
environment:
|
|
67
|
+
environment: resultEnvironment,
|
|
64
68
|
exitPoints: dfEnv.exitPoints.concat(dfExpr.exitPoints),
|
|
65
69
|
graph: dfEnv.graph.mergeWith(dfExpr.graph),
|
|
66
70
|
entryPoint: rootId,
|
|
67
71
|
in: ingoing,
|
|
68
|
-
out:
|
|
72
|
+
out: escaping.concat(dfEnv.out),
|
|
69
73
|
unknownReferences: []
|
|
70
74
|
};
|
|
71
75
|
/* move all definitions made inside the body into the custom env's tracked state */
|
|
@@ -44,6 +44,7 @@ function processRepeatLoop(name, args, rootId, data) {
|
|
|
44
44
|
(0, linker_1.linkCircularRedefinitionsWithinALoop)(information.graph, (0, linker_1.produceNameSharedIdMap)((0, linker_1.findNonLocalReads)(information.graph)), body.out, body.environment);
|
|
45
45
|
(0, linker_1.reapplyLoopExitPoints)(body.exitPoints, body.in.concat(body.out, body.unknownReferences), information.graph);
|
|
46
46
|
information.exitPoints = (0, info_1.filterOutLoopExitPoints)(information.exitPoints);
|
|
47
|
-
|
|
47
|
+
/* the body is evaluated in the enclosing environment, so its definitions have to bubble up */
|
|
48
|
+
return { ...information, out: information.out.concat(body.out) };
|
|
48
49
|
}
|
|
49
50
|
//# sourceMappingURL=built-in-repeat-loop.js.map
|
|
@@ -18,6 +18,7 @@ const unknown_replacement_1 = require("../../../../../graph/unknown-replacement"
|
|
|
18
18
|
const built_in_s_seven_dispatch_1 = require("./built-in-s-seven-dispatch");
|
|
19
19
|
const make_argument_1 = require("../argument/make-argument");
|
|
20
20
|
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
21
|
+
const r_access_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-access");
|
|
21
22
|
const graph_1 = require("../../../../../graph/graph");
|
|
22
23
|
const range_1 = require("../../../../../../util/range");
|
|
23
24
|
const built_in_proc_name_1 = require("../../../../../environments/built-in-proc-name");
|
|
@@ -99,12 +100,16 @@ args, rootId, data, config) {
|
|
|
99
100
|
res.graph.addEdge(rootId, ref, edge_1.EdgeType.Reads);
|
|
100
101
|
}
|
|
101
102
|
}
|
|
102
|
-
if (firstArg) {
|
|
103
|
+
if (firstArg?.type === type_1.RType.Symbol) {
|
|
103
104
|
res = {
|
|
104
105
|
...res,
|
|
105
|
-
in: [...res.in, { name: firstArg.
|
|
106
|
+
in: [...res.in, { name: firstArg.content, type: identifier_1.ReferenceType.Variable, nodeId: firstArg.info.id, cds: data.cds }]
|
|
106
107
|
};
|
|
107
108
|
}
|
|
109
|
+
else if (firstArg !== undefined && r_access_1.RAccess.is(firstArg)) {
|
|
110
|
+
/* a nested target (e.g. `a$b$c <- 5`) is no variable read, it is read through its own accessor */
|
|
111
|
+
res.graph.addEdge(firstArg.info.id, node_id_1.NodeId.toBuiltIn(firstArg.operator), edge_1.EdgeType.Reads);
|
|
112
|
+
}
|
|
108
113
|
// dispatches actually as S3:
|
|
109
114
|
const fns = res.in.filter(i => i.nodeId === rootId);
|
|
110
115
|
for (const fn of fns) {
|
|
@@ -88,7 +88,14 @@ function processTryCatch(name, args, rootId, data, config) {
|
|
|
88
88
|
info.graph.addEdge(rootId, e.nodeId, edge_1.EdgeType.Returns);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
|
|
91
|
+
/* block and finally are evaluated in the enclosing environment, so their definitions have to bubble up */
|
|
92
|
+
const escaping = [];
|
|
93
|
+
for (const arg of res.processedArguments) {
|
|
94
|
+
if (arg && (blockArg.has(arg.entryPoint) || finallyArg.has(arg.entryPoint))) {
|
|
95
|
+
escaping.push(...arg.out);
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return escaping.length > 0 ? { ...info, out: info.out.concat(escaping) } : info;
|
|
92
99
|
}
|
|
93
100
|
function promoteCallToFunction(call, arg, info, data) {
|
|
94
101
|
let functionId = undefined;
|
|
@@ -208,7 +208,7 @@ ${await (0, doc_repl_1.documentReplSession)(treeSitter, [{
|
|
|
208
208
|
`), ' ')}
|
|
209
209
|
|
|
210
210
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\\
|
|
211
|
-
Within just ${ctx.linkPage('flowr:benchmarks', `${'<i>' + (0, html_hover_over_1.textWithTooltip)((0, numbers_1.roundToDecimals)(await (0, doc_benchmarks_1.getLatestDfAnalysisTime)('"
|
|
211
|
+
Within just ${ctx.linkPage('flowr:benchmarks', `${'<i>' + (0, html_hover_over_1.textWithTooltip)((0, numbers_1.roundToDecimals)(await (0, doc_benchmarks_1.getLatestDfAnalysisTime)('"real-world" Benchmark Suite (tree-sitter)'), 1) + ' ms', 'This measurement is automatically fetched from the latest benchmark!') + '</i>'} (as of ${new Date(await (0, doc_benchmarks_1.getLastBenchmarkUpdate)()).toLocaleDateString('en-US', dateOptions)})`)},
|
|
212
212
|
_flowR_ can analyze the data- and control-flow of the average real-world R script. See the ${ctx.linkPage('flowr:benchmarks', 'benchmarks')} for more information,
|
|
213
213
|
and consult the ${ctx.linkPage('wiki/Dataflow Graph', 'wiki pages')} for more details on the ${ctx.linkPage('wiki/Dataflow Graph', 'dataflow graphs')} as well as ${ctx.linkPage('wiki/Dataflow Graph', 'call graphs', 'perspectives-cg')}.
|
|
214
214
|
|
|
@@ -283,7 +283,10 @@ ${printPublications()}
|
|
|
283
283
|
|
|
284
284
|
## 🚀 Contributing
|
|
285
285
|
|
|
286
|
-
We welcome every contribution!
|
|
286
|
+
We welcome every contribution! The ${ctx.linkPage('wiki/Onboarding', 'developer onboarding')} page has everything you need to get started.
|
|
287
|
+
With **R** and **Node.js** installed, \`npm run setup:dev\` checks your prerequisites, installs the dependencies, and configures the git hooks.
|
|
288
|
+
The [contributing guidelines](${doc_files_1.FlowrGithubBaseRef}/flowr/tree/main/.github/CONTRIBUTING.md) explain our commit conventions,
|
|
289
|
+
and ${ctx.linkPage('wiki/Linting and Testing')} shows how to run the tests.
|
|
287
290
|
|
|
288
291
|
### Contributors
|
|
289
292
|
|
|
@@ -1 +1,3 @@
|
|
|
1
1
|
export declare const NewIssueUrl = "https://github.com/flowr-analysis/flowr/issues/new/choose";
|
|
2
|
+
/** the question issue form, for everything the wiki does not answer */
|
|
3
|
+
export declare const NewQuestionUrl = "https://github.com/flowr-analysis/flowr/issues/new?template=question.yaml";
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.NewIssueUrl = void 0;
|
|
3
|
+
exports.NewQuestionUrl = exports.NewIssueUrl = void 0;
|
|
4
4
|
const doc_files_1 = require("./doc-files");
|
|
5
5
|
exports.NewIssueUrl = `${doc_files_1.FlowrGithubBaseRef}/flowr/issues/new/choose`;
|
|
6
|
+
/** the question issue form, for everything the wiki does not answer */
|
|
7
|
+
exports.NewQuestionUrl = `${doc_files_1.FlowrGithubBaseRef}/flowr/issues/new?template=question.yaml`;
|
|
6
8
|
//# sourceMappingURL=doc-issue.js.map
|
|
@@ -46,6 +46,7 @@ const r_number_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-number");
|
|
|
46
46
|
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
47
47
|
const range_1 = require("../util/range");
|
|
48
48
|
const df_helper_1 = require("../dataflow/graph/df-helper");
|
|
49
|
+
const resolve_helper_1 = require("../dataflow/environments/resolve-helper");
|
|
49
50
|
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
50
51
|
async function subExplanation(parser, ctx, { description, code, expectedSubgraph }) {
|
|
51
52
|
expectedSubgraph = await (0, doc_dfg_1.verifyExpectedSubgraph)(parser, code, expectedSubgraph);
|
|
@@ -1097,6 +1098,9 @@ FlowR also provides various helper objects (with the same name as the correspond
|
|
|
1097
1098
|
* ${ctx.link(edge_1.DfEdge, undefined, { type: 'variable' })} to get helpful functions wrt. edges (see [below](#dfg-resolving-values))
|
|
1098
1099
|
* ${ctx.link(identifier_1.Identifier, undefined, { type: 'variable' })} to get helpful functions wrt. identifiers
|
|
1099
1100
|
* ${ctx.link(graph_1.FunctionArgument, undefined, { type: 'variable' })} to get helpful functions wrt. function arguments
|
|
1101
|
+
* ${ctx.link(resolve_helper_1.Resolve, undefined, { type: 'variable' })} (also reachable as \`Dataflow.resolve\`) to resolve a name against an environment or a node to its value.
|
|
1102
|
+
The entry points differ a lot in cost, so take the narrowest one that answers your question: \`byName\` walks the environment layers once and is served from the layer cache,
|
|
1103
|
+
\`byNameAndType\` additionally filters and merges the definitions of every layer it passes, and \`toValue\` as well as the \`argument\` family run the evaluator on top of a resolution.
|
|
1100
1104
|
|
|
1101
1105
|
Some of these functions have been explained in their respective wiki pages. However, some are part of the ${ctx.linkPage('wiki/Dataflow Graph', 'Dataflow Graph API')} and so we explain them here.
|
|
1102
1106
|
If you are interested in which features we support and which features are still to be worked on, please refer to our ${ctx.linkPage('wiki/Capabilities', 'capabilities')} page.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WikiFaq = void 0;
|
|
4
4
|
const faqs_1 = require("./data/faq/faqs");
|
|
5
|
+
const doc_issue_1 = require("./doc-util/doc-issue");
|
|
5
6
|
const doc_maker_1 = require("./wiki-mk/doc-maker");
|
|
6
7
|
/**
|
|
7
8
|
* https://github.com/flowr-analysis/flowr/wiki/FAQ
|
|
@@ -12,8 +13,11 @@ class WikiFaq extends doc_maker_1.DocMaker {
|
|
|
12
13
|
}
|
|
13
14
|
text({ ctx }) {
|
|
14
15
|
const faqs = (0, faqs_1.registerFaqs)(ctx);
|
|
15
|
-
return `
|
|
16
|
-
|
|
16
|
+
return `
|
|
17
|
+
Is your question not answered below? Please [ask it as an issue](${doc_issue_1.NewQuestionUrl}) and we will answer it.
|
|
18
|
+
Answers regularly end up on this page, so asking helps everyone who wonders the same thing later.
|
|
19
|
+
|
|
20
|
+
${faqs.toMarkdown()}
|
|
17
21
|
`.trim();
|
|
18
22
|
}
|
|
19
23
|
}
|
|
@@ -18,15 +18,25 @@ class WikiOnboarding extends doc_maker_1.DocMaker {
|
|
|
18
18
|
- 💖 [Contributing guidelines](${doc_files_1.FlowrGithubBaseRef}/flowr/tree/main/.github/CONTRIBUTING.md).\\
|
|
19
19
|
This page also includes information about how to set up **git-lfs** and several **git hooks**.
|
|
20
20
|
|
|
21
|
+
Once you are set up, these pages explain the parts you are most likely to touch:
|
|
22
|
+
- 🔬 ${ctx.linkPage('wiki/Core')} walks through the pipeline from parsing to the dataflow graph.
|
|
23
|
+
- 🖥️ ${ctx.linkPage('wiki/Interface')} covers the REPL, the server, and the API.
|
|
24
|
+
- 🧪 ${ctx.linkPage('wiki/Linting and Testing')} explains which tests exist and how to run them.
|
|
25
|
+
|
|
21
26
|
If you have any questions, please check out the ${ctx.linkPage('wiki/FAQ')} first, but if the question
|
|
22
27
|
is not answered there (or in the wiki in general), feel free to ask a question.
|
|
23
28
|
The ${ctx.linkPage('wiki/FAQ')} also includes information about how you can configure your editor.
|
|
24
29
|
|
|
25
30
|
## ⌛ TL;DR
|
|
26
31
|
|
|
27
|
-
|
|
32
|
+
After installing **R** and **Node.js**, a single command sets everything up:
|
|
28
33
|
${(0, doc_code_1.codeBlock)('shell', 'npm run setup:dev')}
|
|
29
34
|
|
|
35
|
+
It installs the dependencies, checks your **node** version, tells you whether **R** and **git-lfs** are available,
|
|
36
|
+
configures the git hooks, tests them, and closes with the pages and commands you will need next.
|
|
37
|
+
Missing **R** or **git-lfs** are reported as notes instead of aborting the setup, so you can start with the
|
|
38
|
+
${ctx.linkPage('wiki/Engines', '`tree-sitter` engine')} right away and add them later.
|
|
39
|
+
|
|
30
40
|
If you want to execute the steps manually, please follow the instructions below:
|
|
31
41
|
|
|
32
42
|
${(0, doc_code_1.codeBlock)('shell', `
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.WikiSetup = void 0;
|
|
4
4
|
const doc_maker_1 = require("./wiki-mk/doc-maker");
|
|
5
5
|
const doc_files_1 = require("./doc-util/doc-files");
|
|
6
|
+
const node_version_1 = require("../util/node-version");
|
|
6
7
|
/**
|
|
7
8
|
* https://github.com/flowr-analysis/flowr/wiki/Setup
|
|
8
9
|
*/
|
|
@@ -76,7 +77,7 @@ Again, you only require this for the ${ctx.linkPage('wiki/Engines', '`r-shell` e
|
|
|
76
77
|
### Installing Node.js
|
|
77
78
|
|
|
78
79
|
Furthermore, you need the [node package manager](https://www.npmjs.com/) (for Linux, we recommend using [nvm](https://github.com/nvm-sh/nvm)).
|
|
79
|
-
To work, we currently rely on node versions starting from \`
|
|
80
|
+
To work, we currently rely on node versions starting from \`${(0, node_version_1.minimumNodeMajor)()}.x\` (as declared by the \`engines.node\` field of the [package.json](${doc_files_1.RemoteFlowrFilePathBaseRef}package.json)).
|
|
80
81
|
|
|
81
82
|
### Installing _flowR_
|
|
82
83
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eagleoutice/flowr",
|
|
3
|
-
"version": "2.13.
|
|
3
|
+
"version": "2.13.14",
|
|
4
4
|
"description": "Static Dataflow Analyzer and Program Slicer for the R Programming Language",
|
|
5
|
+
"engines": {
|
|
6
|
+
"node": ">=22"
|
|
7
|
+
},
|
|
5
8
|
"types": "dist/src/index.d.ts",
|
|
6
9
|
"repository": {
|
|
7
10
|
"type": "git",
|
|
@@ -12,7 +15,7 @@
|
|
|
12
15
|
"url": "https://github.com/flowr-analysis/flowr/issues"
|
|
13
16
|
},
|
|
14
17
|
"scripts": {
|
|
15
|
-
"setup:dev": "
|
|
18
|
+
"setup:dev": "npm ci && ts-node --transpile-only scripts/setup-dev.ts",
|
|
16
19
|
"main": "npm run build:bundle-flowr && node dist/src/cli/flowr.min.js",
|
|
17
20
|
"flowr": "npm run main --",
|
|
18
21
|
"flowr:dev": "npm run sync:sigdb && npm run gen:base-packages && npm run main-dev --",
|
|
@@ -23,6 +26,8 @@
|
|
|
23
26
|
"benchmark-helper": "ts-node src/cli/benchmark-helper-app.ts",
|
|
24
27
|
"benchmark": "npm run build-dev && node dist/src/cli/benchmark-app.js",
|
|
25
28
|
"summarizer": "ts-node src/cli/summarizer-app.ts",
|
|
29
|
+
"benchmark:test-counts": "ts-node --transpile-only scripts/test-label-counts.ts",
|
|
30
|
+
"benchmark:compact": "ts-node --transpile-only scripts/compact-benchmark-data.ts",
|
|
26
31
|
"export-quads": "ts-node src/cli/export-quads-app.ts",
|
|
27
32
|
"capabilities-markdown": "ts-node src/documentation/doc-capabilities.ts",
|
|
28
33
|
"wiki": "ts-node src/cli/wiki.ts",
|
|
@@ -48,8 +53,8 @@
|
|
|
48
53
|
"test:coverage": "npm run test -- --coverage",
|
|
49
54
|
"test:full": "npm run test-full",
|
|
50
55
|
"test:bench": "vitest bench --config test/vitest.config.mts",
|
|
51
|
-
"test-full": "npm run test:coverage -- --no-watch -- --make-summary --test-installation",
|
|
52
|
-
"performance-test": "func() { cd test/performance/ && bash run-all-suites.sh
|
|
56
|
+
"test-full": "npm run test:coverage -- --no-watch --reporter=default --reporter=json --outputFile.json=coverage/flowr-test-results.json -- --make-summary --test-installation",
|
|
57
|
+
"performance-test": "func() { cd test/performance/ && bash run-all-suites.sh \"$@\"; }; func",
|
|
53
58
|
"test:performance": "npm run performance-test --",
|
|
54
59
|
"test:docker": "func() { b() { docker build ${1:+--network=$1} -t flowr-docker-test -f \"$2\" .; }; r() { docker run --rm ${1:+--network=$1} flowr-docker-test --version; }; for df in scripts/Dockerfile scripts/Dockerfile-NoR; do echo \"=== building $df ===\"; b '' \"$df\" || { echo '(retrying with --network=host: bridge networking unavailable)'; b host \"$df\"; } || return 1; echo \"=== smoke-testing $df ===\"; r '' || r host || return 1; done; }; func",
|
|
55
60
|
"detect-circular-deps": "npx madge --extensions ts,tsx --circular src/",
|
|
@@ -66,6 +66,16 @@ function makeTreeSitterStrict() {
|
|
|
66
66
|
log_1.log.info('[Tree-Sitter] Strict parsing active');
|
|
67
67
|
nonErrorChildren = nonErrorChildrenStrict;
|
|
68
68
|
}
|
|
69
|
+
function makeDefaultInfo(node, fullRange, fullLexeme) {
|
|
70
|
+
return {
|
|
71
|
+
info: {
|
|
72
|
+
fullRange,
|
|
73
|
+
adToks: [],
|
|
74
|
+
fullLexeme,
|
|
75
|
+
tsId: node.id
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
}
|
|
69
79
|
function convertTreeNode(node) {
|
|
70
80
|
if (!node) {
|
|
71
81
|
return {
|
|
@@ -91,17 +101,9 @@ function convertTreeNode(node) {
|
|
|
91
101
|
textCache ??= node.text;
|
|
92
102
|
return textCache;
|
|
93
103
|
};
|
|
94
|
-
const makeDefaultInfo = () => ({
|
|
95
|
-
info: {
|
|
96
|
-
fullRange: range,
|
|
97
|
-
adToks: [],
|
|
98
|
-
fullLexeme: text(),
|
|
99
|
-
tsId: node.id
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
104
|
let defaultInfoCache = undefined;
|
|
103
105
|
const defaultInfo = () => {
|
|
104
|
-
defaultInfoCache ??= makeDefaultInfo();
|
|
106
|
+
defaultInfoCache ??= makeDefaultInfo(node, range, text());
|
|
105
107
|
return defaultInfoCache;
|
|
106
108
|
};
|
|
107
109
|
switch (node.type) {
|
|
@@ -11,7 +11,7 @@ const fingerprint_1 = require("./fingerprint");
|
|
|
11
11
|
const linker_1 = require("../../dataflow/internal/linker");
|
|
12
12
|
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
13
13
|
const graph_1 = require("../../dataflow/graph/graph");
|
|
14
|
-
const
|
|
14
|
+
const resolve_helper_1 = require("../../dataflow/environments/resolve-helper");
|
|
15
15
|
const edge_1 = require("../../dataflow/graph/edge");
|
|
16
16
|
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
17
17
|
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
@@ -30,7 +30,7 @@ function getAllFunctionCallTargetsForSlice(dataflowGraph, callerInfo, baseEnviro
|
|
|
30
30
|
const activeEnvironment = (0, built_in_function_definition_1.retrieveActiveEnvironment)(callerInfo.environment, baseEnvironment, ctx);
|
|
31
31
|
const name = callerInfo.name;
|
|
32
32
|
(0, assert_1.guard)(name !== undefined, () => `name of id: ${callerInfo.id} can not be found in id map`);
|
|
33
|
-
const functionCallDefs =
|
|
33
|
+
const functionCallDefs = resolve_helper_1.Resolve.byName(name, activeEnvironment)?.filter(d => !node_id_1.NodeId.isBuiltIn(d.definedAt))?.map(d => d.nodeId) ?? [];
|
|
34
34
|
for (const [target, outgoingEdge] of outgoingEdges[1].entries()) {
|
|
35
35
|
if (edge_1.DfEdge.includesType(outgoingEdge, edge_1.EdgeType.Calls)) {
|
|
36
36
|
functionCallDefs.push(target);
|
|
@@ -56,7 +56,7 @@ function linkCallTargets(onlyForSideEffects, functionCallTargets, activeEnvironm
|
|
|
56
56
|
for (const openIn of functionCallTarget.subflow.in) {
|
|
57
57
|
// resolve them in the active env
|
|
58
58
|
if (openIn.name) {
|
|
59
|
-
const resolved =
|
|
59
|
+
const resolved = resolve_helper_1.Resolve.byName(openIn.name, activeEnvironment);
|
|
60
60
|
for (const res of resolved ?? []) {
|
|
61
61
|
(0, static_slicer_1.updatePotentialAddition)(queue, functionCallTarget.id, res.nodeId, activeEnvironment, activeEnvironmentFingerprint);
|
|
62
62
|
}
|
|
@@ -139,7 +139,7 @@ function sliceReachesFunctionInterface(fnDefId, graph, queue, idMap, ctx) {
|
|
|
139
139
|
if (open.name === undefined || !queue.hasId(open.nodeId)) {
|
|
140
140
|
continue;
|
|
141
141
|
}
|
|
142
|
-
const resolved =
|
|
142
|
+
const resolved = resolve_helper_1.Resolve.byNameAndType(open.name, definitionEnvironment, open.type ?? identifier_1.ReferenceType.Unknown);
|
|
143
143
|
if (resolved?.some(d => !node_id_1.NodeId.isBuiltIn(d.nodeId))) {
|
|
144
144
|
return true;
|
|
145
145
|
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/** The `engines.node` range of the package.json, e.g. `>=22`. */
|
|
2
|
+
export declare function supportedNodeVersions(): string;
|
|
3
|
+
/** The oldest major node version flowR runs on, derived from {@link supportedNodeVersions}. */
|
|
4
|
+
export declare function minimumNodeMajor(): number;
|
|
@@ -0,0 +1,29 @@
|
|
|
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.supportedNodeVersions = supportedNodeVersions;
|
|
7
|
+
exports.minimumNodeMajor = minimumNodeMajor;
|
|
8
|
+
/**
|
|
9
|
+
* The node version flowR requires, taken from the `engines.node` field of the package.json so that the
|
|
10
|
+
* package manager, the setup script, and the documentation all state the same thing.
|
|
11
|
+
* @module
|
|
12
|
+
*/
|
|
13
|
+
const fs_1 = __importDefault(require("fs"));
|
|
14
|
+
const path_1 = __importDefault(require("path"));
|
|
15
|
+
let cached = undefined;
|
|
16
|
+
/** The `engines.node` range of the package.json, e.g. `>=22`. */
|
|
17
|
+
function supportedNodeVersions() {
|
|
18
|
+
if (cached === undefined) {
|
|
19
|
+
const raw = fs_1.default.readFileSync(path_1.default.join(__dirname, '..', '..', 'package.json'), 'utf-8');
|
|
20
|
+
const { engines } = JSON.parse(raw);
|
|
21
|
+
cached = engines?.node ?? '>=22';
|
|
22
|
+
}
|
|
23
|
+
return cached;
|
|
24
|
+
}
|
|
25
|
+
/** The oldest major node version flowR runs on, derived from {@link supportedNodeVersions}. */
|
|
26
|
+
function minimumNodeMajor() {
|
|
27
|
+
return Number(/\d+/.exec(supportedNodeVersions())?.[0] ?? 22);
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=node-version.js.map
|
package/util/version.js
CHANGED
|
@@ -42,7 +42,7 @@ const assert_1 = require("./assert");
|
|
|
42
42
|
const sigdb_download_1 = require("../project/sigdb/sigdb-download");
|
|
43
43
|
const doc_files_1 = require("../documentation/doc-util/doc-files");
|
|
44
44
|
// this is automatically replaced with the current version by release-it
|
|
45
|
-
const version = '2.13.
|
|
45
|
+
const version = '2.13.14';
|
|
46
46
|
// this is automatically replaced with the release date by release-it (regex-bumper, see package.json)
|
|
47
47
|
const versionDate = '2026-07-15T07:13:44Z';
|
|
48
48
|
/**
|