@eagleoutice/flowr 2.13.10 โ 2.13.11
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 +40 -40
- package/dataflow/environments/environment.js +56 -20
- package/dataflow/environments/resolve-by-name.js +16 -6
- package/dataflow/environments/resolve-helper.d.ts +43 -0
- package/dataflow/environments/resolve-helper.js +47 -0
- package/dataflow/graph/df-helper.d.ts +48 -1
- package/dataflow/graph/df-helper.js +63 -0
- package/dataflow/graph/graph.js +24 -13
- package/documentation/data/faq/faqs.js +1 -1
- package/documentation/data/faq/wiki-faq-store.js +3 -2
- package/documentation/data/server/doc-data-server-messages.js +1 -1
- package/documentation/doc-readme.js +1 -1
- package/documentation/doc-util/doc-files.d.ts +5 -0
- package/documentation/doc-util/doc-files.js +13 -3
- package/documentation/wiki-analyzer.js +10 -10
- package/documentation/wiki-core.js +1 -1
- package/documentation/wiki-dataflow-graph.js +3 -3
- package/documentation/wiki-linting-and-testing.js +13 -13
- package/documentation/wiki-mk/doc-context.d.ts +1 -1
- package/documentation/wiki-mk/doc-context.js +9 -5
- package/documentation/wiki-normalized-ast.js +1 -1
- package/documentation/wiki-overview.js +2 -2
- package/documentation/wiki-query.js +1 -1
- package/documentation/wiki-setup.js +3 -3
- package/linter/linter-rules.d.ts +1 -1
- package/linter/rules/syntactically-valid.d.ts +12 -1
- package/linter/rules/syntactically-valid.js +88 -17
- package/package.json +7 -8
- package/project/context/flowr-analyzer-loading-order-context.d.ts +8 -0
- package/project/context/flowr-analyzer-loading-order-context.js +23 -2
- package/project/sigdb/reader.d.ts +20 -0
- package/project/sigdb/reader.js +93 -10
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +3 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +6 -0
- package/queries/catalog/dependencies-query/link-devices.d.ts +7 -3
- package/queries/catalog/dependencies-query/link-devices.js +56 -10
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +14 -0
- package/queries/catalog/happens-before-query/happens-before-query-format.js +18 -2
- package/queries/catalog/slice-query-options.d.ts +11 -1
- package/queries/catalog/slice-query-options.js +8 -4
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +4 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +5 -1
- package/r-bridge/lang-4.x/ast/model/model.d.ts +9 -0
- package/r-bridge/lang-4.x/ast/model/model.js +12 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
- package/reconstruct/reconstruct.d.ts +9 -0
- package/reconstruct/reconstruct.js +1 -0
- package/search/flowr-search-filters.d.ts +8 -0
- package/search/flowr-search-filters.js +19 -7
- package/search/search-executor/search-generators.js +7 -2
- package/search/search-executor/search-transformer.js +4 -1
- package/slicing/static/slice-call.js +2 -2
- package/util/collections/bimap.d.ts +21 -1
- package/util/collections/bimap.js +43 -7
- package/util/version.js +1 -1
|
@@ -4,7 +4,7 @@ import { emptyGraph } from './dataflowgraph-builder';
|
|
|
4
4
|
import { getOriginInDfg } from '../origin/dfg-get-origin';
|
|
5
5
|
import { CallGraph } from './call-graph';
|
|
6
6
|
import { computeCallGraphSummaries, propagateTransitiveSideEffects } from '../internal/process/functions/call/built-in/transitive-side-effects';
|
|
7
|
-
import
|
|
7
|
+
import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
8
8
|
import type { REnvironmentInformation } from '../environments/environment';
|
|
9
9
|
import type { DataflowGraphVertexInfo } from './vertex';
|
|
10
10
|
import { Identifier } from '../environments/identifier';
|
|
@@ -15,6 +15,9 @@ import { Identifier } from '../environments/identifier';
|
|
|
15
15
|
* - {@link Dataflow.views} - for working with specific views of the dataflow graph (e.g., the call graph),
|
|
16
16
|
* - {@link Dataflow.edge} - for working with the edges in the dataflow graph,
|
|
17
17
|
* - {@link Dataflow.qualify} - for the package-qualified `pkg::fn` identifier of a call from its id and graph,
|
|
18
|
+
* - {@link Dataflow.resolve} - for resolving a name against an environment,
|
|
19
|
+
* - {@link Dataflow.packagesOf} - for the packages a set of nodes (e.g. a slice) calls into,
|
|
20
|
+
* - {@link Dataflow.valueIsUsed}/{@link Dataflow.hasComputedArguments} - for what a call does with, and gets as, values,
|
|
18
21
|
*/
|
|
19
22
|
export declare const Dataflow: {
|
|
20
23
|
/**
|
|
@@ -85,6 +88,26 @@ export declare const Dataflow: {
|
|
|
85
88
|
* @see {@link getOriginInDfg} - for the underlying function
|
|
86
89
|
*/
|
|
87
90
|
readonly origin: typeof getOriginInDfg;
|
|
91
|
+
/**
|
|
92
|
+
* Name and value resolution.
|
|
93
|
+
* @see {@link Resolve} - the helper object itself, which documents which entry point to reach for
|
|
94
|
+
*/
|
|
95
|
+
readonly resolve: {
|
|
96
|
+
readonly name: "Resolve";
|
|
97
|
+
readonly byName: typeof import("../environments/resolve-by-name").resolveByNameAnyType;
|
|
98
|
+
readonly byNameAndType: typeof import("../environments/resolve-by-name").resolveByName;
|
|
99
|
+
readonly toBuiltIn: typeof import("../environments/resolve-by-name").resolvesToBuiltInConstant;
|
|
100
|
+
readonly toConstants: typeof import("../eval/resolve/alias-tracking").resolveToConstants;
|
|
101
|
+
readonly toValue: typeof import("../eval/resolve/alias-tracking").resolveIdToValue;
|
|
102
|
+
readonly toSingleString: typeof import("../eval/resolve/alias-tracking").resolveIdToSingleString;
|
|
103
|
+
readonly argument: {
|
|
104
|
+
readonly name: typeof import("../../abstract-interpretation/data-frame/resolve-args").resolveIdToArgName;
|
|
105
|
+
readonly value: typeof import("../../abstract-interpretation/data-frame/resolve-args").resolveIdToArgValue;
|
|
106
|
+
readonly stringVector: typeof import("../../abstract-interpretation/data-frame/resolve-args").resolveIdToArgStringVector;
|
|
107
|
+
readonly symbolName: typeof import("../../abstract-interpretation/data-frame/resolve-args").resolveIdToArgValueSymbolName;
|
|
108
|
+
readonly vectorLength: typeof import("../../abstract-interpretation/data-frame/resolve-args").resolveIdToArgVectorLength;
|
|
109
|
+
};
|
|
110
|
+
};
|
|
88
111
|
/**
|
|
89
112
|
* The qualified identifier of the call with the given id, or `undefined` if it does not resolve to a package
|
|
90
113
|
* export and is not itself already namespaced (with `purrr` loaded, a `map()` call yields
|
|
@@ -99,6 +122,30 @@ export declare const Dataflow: {
|
|
|
99
122
|
* Set this to `false` to only qualify what the origins resolve to (or what is already namespaced).
|
|
100
123
|
*/
|
|
101
124
|
readonly qualify: (this: void, id: NodeId, graph: DataflowGraph, qualifyBaseR?: boolean) => Identifier | undefined;
|
|
125
|
+
/**
|
|
126
|
+
* The packages the given nodes call into, as {@link Dataflow.qualify} resolves every call among them.
|
|
127
|
+
* This is what a selection needs, which is not what the program loads: a `library()` whose exports the
|
|
128
|
+
* selection never calls does not make the package needed. Base R is left out unless `includeBaseR`.
|
|
129
|
+
* @param nodes - the ids to consider, e.g. the result of a slice
|
|
130
|
+
* @param graph - the graph the ids belong to
|
|
131
|
+
* @param includeBaseR - whether to also report base-R packages
|
|
132
|
+
*/
|
|
133
|
+
readonly packagesOf: (this: void, nodes: Iterable<NodeId>, graph: DataflowGraph, includeBaseR?: boolean) => Set<string>;
|
|
134
|
+
/**
|
|
135
|
+
* Whether the call's result is passed on -- assigned, handed to another call, returned -- rather than left
|
|
136
|
+
* for R to auto-print. A bare `anova(a, b)` is an output the program reports; the `summary(m)` of
|
|
137
|
+
* `x <- summary(m)` is not.
|
|
138
|
+
*
|
|
139
|
+
* Only an edge that carries the value counts. A plain {@link EdgeType.Reads} does not: it also chains the
|
|
140
|
+
* calls that share a side effect, which would report `plot(x)` as consumed by the `lines(y)` drawn after it.
|
|
141
|
+
*/
|
|
142
|
+
readonly valueIsUsed: (this: void, id: NodeId, graph: DataflowGraph) => boolean;
|
|
143
|
+
/**
|
|
144
|
+
* Whether any argument of the call carries a value the program worked out, rather than only literals the
|
|
145
|
+
* author typed: `cat("starting\n")` is a log line, `cat("n =", length(m))` is a finding.
|
|
146
|
+
* A call among the arguments counts as computed, even one over literals such as `paste("a", "b")`.
|
|
147
|
+
*/
|
|
148
|
+
readonly hasComputedArguments: (this: void, id: NodeId, graph: DataflowGraph) => boolean;
|
|
102
149
|
/**
|
|
103
150
|
* Interprocedural propagation of escaped side effects (attached packages, `<<-` definitions) to their callers.
|
|
104
151
|
*/
|
|
@@ -8,9 +8,12 @@ const dfg_get_origin_1 = require("../origin/dfg-get-origin");
|
|
|
8
8
|
const graph_helper_1 = require("./graph-helper");
|
|
9
9
|
const call_graph_1 = require("./call-graph");
|
|
10
10
|
const transitive_side_effects_1 = require("../internal/process/functions/call/built-in/transitive-side-effects");
|
|
11
|
+
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
11
12
|
const vertex_1 = require("./vertex");
|
|
12
13
|
const identifier_1 = require("../environments/identifier");
|
|
14
|
+
const resolve_helper_1 = require("../environments/resolve-helper");
|
|
13
15
|
const model_1 = require("../../r-bridge/lang-4.x/ast/model/model");
|
|
16
|
+
const r_base_packages_1 = require("../../util/r-base-packages");
|
|
14
17
|
/**
|
|
15
18
|
* This is the root helper object to work with the {@link DataflowGraph}.
|
|
16
19
|
*
|
|
@@ -18,6 +21,9 @@ const model_1 = require("../../r-bridge/lang-4.x/ast/model/model");
|
|
|
18
21
|
* - {@link Dataflow.views} - for working with specific views of the dataflow graph (e.g., the call graph),
|
|
19
22
|
* - {@link Dataflow.edge} - for working with the edges in the dataflow graph,
|
|
20
23
|
* - {@link Dataflow.qualify} - for the package-qualified `pkg::fn` identifier of a call from its id and graph,
|
|
24
|
+
* - {@link Dataflow.resolve} - for resolving a name against an environment,
|
|
25
|
+
* - {@link Dataflow.packagesOf} - for the packages a set of nodes (e.g. a slice) calls into,
|
|
26
|
+
* - {@link Dataflow.valueIsUsed}/{@link Dataflow.hasComputedArguments} - for what a call does with, and gets as, values,
|
|
21
27
|
*/
|
|
22
28
|
exports.Dataflow = {
|
|
23
29
|
name: 'Dataflow',
|
|
@@ -55,6 +61,11 @@ exports.Dataflow = {
|
|
|
55
61
|
* @see {@link getOriginInDfg} - for the underlying function
|
|
56
62
|
*/
|
|
57
63
|
origin: dfg_get_origin_1.getOriginInDfg,
|
|
64
|
+
/**
|
|
65
|
+
* Name and value resolution.
|
|
66
|
+
* @see {@link Resolve} - the helper object itself, which documents which entry point to reach for
|
|
67
|
+
*/
|
|
68
|
+
resolve: resolve_helper_1.Resolve,
|
|
58
69
|
/**
|
|
59
70
|
* The qualified identifier of the call with the given id, or `undefined` if it does not resolve to a package
|
|
60
71
|
* export and is not itself already namespaced (with `purrr` loaded, a `map()` call yields
|
|
@@ -72,6 +83,58 @@ exports.Dataflow = {
|
|
|
72
83
|
const vertex = graph.getVertex(id);
|
|
73
84
|
return identifier_1.Identifier.toQualified((0, dfg_get_origin_1.getOriginInDfg)(graph, id), vertex_1.FunctionCallVertex.is(vertex) ? vertex.name : undefined, qualifyBaseR);
|
|
74
85
|
},
|
|
86
|
+
/**
|
|
87
|
+
* The packages the given nodes call into, as {@link Dataflow.qualify} resolves every call among them.
|
|
88
|
+
* This is what a selection needs, which is not what the program loads: a `library()` whose exports the
|
|
89
|
+
* selection never calls does not make the package needed. Base R is left out unless `includeBaseR`.
|
|
90
|
+
* @param nodes - the ids to consider, e.g. the result of a slice
|
|
91
|
+
* @param graph - the graph the ids belong to
|
|
92
|
+
* @param includeBaseR - whether to also report base-R packages
|
|
93
|
+
*/
|
|
94
|
+
packagesOf(nodes, graph, includeBaseR = false) {
|
|
95
|
+
const packages = new Set();
|
|
96
|
+
for (const id of nodes) {
|
|
97
|
+
if (!vertex_1.FunctionCallVertex.is(graph.getVertex(id))) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
const qualified = exports.Dataflow.qualify(id, graph, includeBaseR);
|
|
101
|
+
const pkg = qualified === undefined ? undefined : identifier_1.Identifier.getNamespace(qualified);
|
|
102
|
+
if (pkg !== undefined && (includeBaseR || !(0, r_base_packages_1.isBaseRPackage)(pkg))) {
|
|
103
|
+
packages.add(pkg);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
return packages;
|
|
107
|
+
},
|
|
108
|
+
/**
|
|
109
|
+
* Whether the call's result is passed on -- assigned, handed to another call, returned -- rather than left
|
|
110
|
+
* for R to auto-print. A bare `anova(a, b)` is an output the program reports; the `summary(m)` of
|
|
111
|
+
* `x <- summary(m)` is not.
|
|
112
|
+
*
|
|
113
|
+
* Only an edge that carries the value counts. A plain {@link EdgeType.Reads} does not: it also chains the
|
|
114
|
+
* calls that share a side effect, which would report `plot(x)` as consumed by the `lines(y)` drawn after it.
|
|
115
|
+
*/
|
|
116
|
+
valueIsUsed(id, graph) {
|
|
117
|
+
const consuming = edge_1.EdgeType.Argument | edge_1.EdgeType.Returns | edge_1.EdgeType.DefinedBy;
|
|
118
|
+
for (const [, edge] of graph.ingoingEdges(id) ?? []) {
|
|
119
|
+
if ((edge.types & consuming) !== 0) {
|
|
120
|
+
return true;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
return false;
|
|
124
|
+
},
|
|
125
|
+
/**
|
|
126
|
+
* Whether any argument of the call carries a value the program worked out, rather than only literals the
|
|
127
|
+
* author typed: `cat("starting\n")` is a log line, `cat("n =", length(m))` is a finding.
|
|
128
|
+
* A call among the arguments counts as computed, even one over literals such as `paste("a", "b")`.
|
|
129
|
+
*/
|
|
130
|
+
hasComputedArguments(id, graph) {
|
|
131
|
+
for (const [target] of graph.outgoingEdges(id) ?? []) {
|
|
132
|
+
if (!node_id_1.NodeId.isBuiltIn(target) && graph.getVertex(target)?.tag !== vertex_1.VertexType.Value) {
|
|
133
|
+
return true;
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
return false;
|
|
137
|
+
},
|
|
75
138
|
/**
|
|
76
139
|
* Interprocedural propagation of escaped side effects (attached packages, `<<-` definitions) to their callers.
|
|
77
140
|
*/
|
package/dataflow/graph/graph.js
CHANGED
|
@@ -178,8 +178,9 @@ class DataflowGraph {
|
|
|
178
178
|
vertexInformation = new Map();
|
|
179
179
|
/** All edges in the complete graph (including those nested in function definition) */
|
|
180
180
|
edgeInformation = new Map();
|
|
181
|
-
/* the reverse of `edgeInformation`, built on demand
|
|
182
|
-
* lookup made every caller asking for the ingoing
|
|
181
|
+
/* the reverse of `edgeInformation`, built on demand, then kept up to date by `addEdge` and dropped only on a
|
|
182
|
+
* bulk write (`mergeEdges`, `fromJson`): rebuilding it per lookup made every caller asking for the ingoing
|
|
183
|
+
* edges of many nodes scan the whole graph once per node */
|
|
183
184
|
incomingIndex;
|
|
184
185
|
types = new Map();
|
|
185
186
|
toJSON() {
|
|
@@ -362,20 +363,30 @@ class DataflowGraph {
|
|
|
362
363
|
if (fromId === toId) {
|
|
363
364
|
return this;
|
|
364
365
|
}
|
|
365
|
-
|
|
366
|
-
|
|
366
|
+
const fromEdges = this.edgeInformation.get(fromId);
|
|
367
|
+
const existing = fromEdges?.get(toId);
|
|
368
|
+
if (existing !== undefined) {
|
|
369
|
+
/* the reverse index holds this very object, so a widened type is already visible through it */
|
|
370
|
+
existing.types |= type;
|
|
371
|
+
return this;
|
|
372
|
+
}
|
|
373
|
+
const added = { types: type };
|
|
367
374
|
if (fromEdges === undefined) {
|
|
368
|
-
|
|
369
|
-
this.edgeInformation.set(fromId, fromEdges);
|
|
375
|
+
this.edgeInformation.set(fromId, new Map([[toId, added]]));
|
|
370
376
|
}
|
|
371
377
|
else {
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
378
|
+
fromEdges.set(toId, added);
|
|
379
|
+
}
|
|
380
|
+
/*
|
|
381
|
+
* carry the new edge into the reverse index rather than dropping it: construction interleaves `addEdge`
|
|
382
|
+
* with `ingoingEdges`, and rebuilding costs a pass over every edge in the graph each time
|
|
383
|
+
*/
|
|
384
|
+
const into = this.incomingIndex?.get(toId);
|
|
385
|
+
if (into !== undefined) {
|
|
386
|
+
into.set(fromId, added);
|
|
387
|
+
}
|
|
388
|
+
else {
|
|
389
|
+
this.incomingIndex?.set(toId, new Map([[fromId, added]]));
|
|
379
390
|
}
|
|
380
391
|
return this;
|
|
381
392
|
}
|
|
@@ -51,7 +51,7 @@ ${(0, doc_code_1.codeBlock)('shell', 'npm run wiki:watch')}
|
|
|
51
51
|
`)
|
|
52
52
|
.addFaq('Why can\'t I pass *arguments* when running flowR *with npm*?', `
|
|
53
53
|
With \`npm\` you have to pass arguments in a specific way. The \`--\` operator is used to separate the \`npm\` arguments from the script arguments. For example, if you want to run \`flowR\` with the \`--help\` argument, you can use the following command:
|
|
54
|
-
${(0, doc_code_1.codeBlock)('shell', 'npm run
|
|
54
|
+
${(0, doc_code_1.codeBlock)('shell', 'npm run flowr -- --help')}
|
|
55
55
|
`)
|
|
56
56
|
.addFaq('How to do *logging* in flowR?', `
|
|
57
57
|
Check out the ${ctx.linkPage('wiki/Linting and Testing', 'Logging Section in the Linting and Testing wiki page', 'logging')} for more information on how to do logging in *flowR*.
|
|
@@ -10,6 +10,7 @@ const FlowrFaqTopics = {
|
|
|
10
10
|
'r.packages': '๐ฆ R Packages',
|
|
11
11
|
'editor.configs': 'โ๏ธ Recommended Editor Configs'
|
|
12
12
|
};
|
|
13
|
+
const FlowrFaqMainTitle = '๐ฎ <i>flowR</i> FAQ';
|
|
13
14
|
/**
|
|
14
15
|
* Manage all questions and answers by topic.
|
|
15
16
|
*/
|
|
@@ -50,7 +51,7 @@ class FaqStore {
|
|
|
50
51
|
toMarkdown() {
|
|
51
52
|
return `
|
|
52
53
|
${(0, doc_structure_1.collapsibleToc)({
|
|
53
|
-
[
|
|
54
|
+
[FlowrFaqMainTitle]: {
|
|
54
55
|
[FlowrFaqTopics['flowr.development']]: {},
|
|
55
56
|
[FlowrFaqTopics['flowr.use']]: {}
|
|
56
57
|
},
|
|
@@ -62,7 +63,7 @@ ${(0, doc_structure_1.collapsibleToc)({
|
|
|
62
63
|
}
|
|
63
64
|
})}
|
|
64
65
|
|
|
65
|
-
${(0, doc_structure_1.section)(
|
|
66
|
+
${(0, doc_structure_1.section)(FlowrFaqMainTitle, 2)}
|
|
66
67
|
|
|
67
68
|
${this.printAllTopics(/^flowr.*$/)}
|
|
68
69
|
|
|
@@ -44,7 +44,7 @@ ${(0, doc_code_1.codeBlock)('json', await (0, doc_server_message_1.inServerConte
|
|
|
44
44
|
|
|
45
45
|
There are currently a few messages that you can send after the hello message.
|
|
46
46
|
If you want to _slice_ a piece of R code you first have to send an [analysis request](#message-request-file-analysis), so that you can send one or multiple slice requests afterward.
|
|
47
|
-
Requests for the [REPL](#message-request-repl) are independent of that.
|
|
47
|
+
Requests for the [REPL](#message-request-repl-execution) are independent of that.
|
|
48
48
|
`;
|
|
49
49
|
}
|
|
50
50
|
});
|
|
@@ -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
|
|
211
|
+
Within just ${ctx.linkPage('flowr:benchmarks', `${'<i>' + (0, html_hover_over_1.textWithTooltip)((0, numbers_1.roundToDecimals)(await (0, doc_benchmarks_1.getLatestDfAnalysisTime)('"social-science" 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
|
|
|
@@ -26,3 +26,8 @@ export declare function getFileContentFromRoot(path: string): string;
|
|
|
26
26
|
* Returns a markdown link to the given flowr source file path.
|
|
27
27
|
*/
|
|
28
28
|
export declare function linkFlowRSourceFile(path: string): string;
|
|
29
|
+
/**
|
|
30
|
+
* Returns the remote url for the given flowr source file path,
|
|
31
|
+
* ensuring exactly one slash between the base ref and the path.
|
|
32
|
+
*/
|
|
33
|
+
export declare function flowrSourceFileUrl(path: string): string;
|
|
@@ -7,6 +7,7 @@ exports.toPosixPath = exports.FlowrRAdapter = exports.FlowrRStudioAddin = export
|
|
|
7
7
|
exports.getFilePathMd = getFilePathMd;
|
|
8
8
|
exports.getFileContentFromRoot = getFileContentFromRoot;
|
|
9
9
|
exports.linkFlowRSourceFile = linkFlowRSourceFile;
|
|
10
|
+
exports.flowrSourceFileUrl = flowrSourceFileUrl;
|
|
10
11
|
const fs_1 = __importDefault(require("fs"));
|
|
11
12
|
const path_1 = __importDefault(require("path"));
|
|
12
13
|
const files_1 = require("../../util/files");
|
|
@@ -30,8 +31,8 @@ exports.FlowrRAdapter = `${exports.FlowrGithubBaseRef}/flowr-r-adapter`;
|
|
|
30
31
|
function getFilePathMd(filePath) {
|
|
31
32
|
// we go one up as we are in doc-util now :D #convenience
|
|
32
33
|
const fullpath = require.resolve('../' + filePath);
|
|
33
|
-
const relative =
|
|
34
|
-
return `[
|
|
34
|
+
const relative = (0, files_1.toPosixPath)(path_1.default.relative(process.cwd(), fullpath));
|
|
35
|
+
return `[\`./${relative}\`](${flowrSourceFileUrl(relative)})`;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Returns the content of a file located at the given path relative to the project root.
|
|
@@ -45,6 +46,15 @@ function getFileContentFromRoot(path) {
|
|
|
45
46
|
* Returns a markdown link to the given flowr source file path.
|
|
46
47
|
*/
|
|
47
48
|
function linkFlowRSourceFile(path) {
|
|
48
|
-
return `[${path}](${
|
|
49
|
+
return `[${path}](${flowrSourceFileUrl(path)})`;
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Returns the remote url for the given flowr source file path,
|
|
53
|
+
* ensuring exactly one slash between the base ref and the path.
|
|
54
|
+
*/
|
|
55
|
+
function flowrSourceFileUrl(path) {
|
|
56
|
+
const base = exports.RemoteFlowrFilePathBaseRef.replace(/\/+$/, '');
|
|
57
|
+
const suffix = path.startsWith('/') ? path : '/' + path;
|
|
58
|
+
return base + suffix;
|
|
49
59
|
}
|
|
50
60
|
//# sourceMappingURL=doc-files.js.map
|
|
@@ -98,7 +98,7 @@ ${(0, doc_structure_1.collapsibleToc)({
|
|
|
98
98
|
${(0, doc_structure_1.section)('Overview', 2)}
|
|
99
99
|
|
|
100
100
|
No matter whether you want to analyze a single R script, a couple of R notebooks, a complete project, or an R package,
|
|
101
|
-
your journey starts with the ${ctx.link(flowr_analyzer_builder_1.FlowrAnalyzerBuilder)} (further described in [Builder Configuration](#
|
|
101
|
+
your journey starts with the ${ctx.link(flowr_analyzer_builder_1.FlowrAnalyzerBuilder)} (further described in [Builder Configuration](#Builder_Configuration) below).
|
|
102
102
|
This builder allows you to configure the analysis in many different ways, for example, by specifying which [plugins](#Plugins) to use or
|
|
103
103
|
what ${ctx.linkPage('wiki/Engines', 'engine')} to use for the analysis.
|
|
104
104
|
|
|
@@ -118,7 +118,7 @@ The builder provides two methods for building the analyzer:
|
|
|
118
118
|
which requires that the engine (e.g., TreeSitter) has already been initialized before calling this method.
|
|
119
119
|
Yet, as Engines only have to be initialized once per process, this method is often more convenient to use.
|
|
120
120
|
|
|
121
|
-
For more information on how to configure the builder, please refer to the [Builder Configuration](#
|
|
121
|
+
For more information on how to configure the builder, please refer to the [Builder Configuration](#Builder_Configuration) section below.
|
|
122
122
|
|
|
123
123
|
${(0, doc_structure_1.section)('Overview of the Analyzer', 3)}
|
|
124
124
|
|
|
@@ -168,12 +168,12 @@ We work on providing a set of example repositories that demonstrate how to use t
|
|
|
168
168
|
|
|
169
169
|
${(0, doc_structure_1.section)('Builder Configuration', 2)}
|
|
170
170
|
|
|
171
|
-
If you are interested in all available options, have a look at the [Builder Reference](#
|
|
171
|
+
If you are interested in all available options, have a look at the [Builder Reference](#Builder_Reference) below.
|
|
172
172
|
The following sections highlight some of the most important configuration options:
|
|
173
173
|
|
|
174
|
-
1. How to [configure flowR](#
|
|
175
|
-
1. How to [configure the engine](#
|
|
176
|
-
2. How to [register plugins](#
|
|
174
|
+
1. How to [configure flowR](#Configuring_flowR)
|
|
175
|
+
1. How to [configure the engine](#Configuring_the_Engine)
|
|
176
|
+
2. How to [register plugins](#Configuring_Plugins)
|
|
177
177
|
|
|
178
178
|
${(0, doc_structure_1.section)('Configuring flowR', 3)}
|
|
179
179
|
|
|
@@ -256,8 +256,8 @@ Plugins allow you to extend the capabilities of the analyzer in many different w
|
|
|
256
256
|
For example, they can be used to support other file formats, or to provide new algorithms to determine the loading order of files in a project.
|
|
257
257
|
All plugins have to extend the ${ctx.link(flowr_analyzer_plugin_1.FlowrAnalyzerPlugin)} base class and specify their ${ctx.link('PluginType')}.
|
|
258
258
|
During the analysis, the analyzer will apply all registered plugins of the different types at the appropriate stages of the analysis.
|
|
259
|
-
If you just want to _use_ these plugins, you can usually ignore their [type](#
|
|
260
|
-
in the [Builder Configuration](#
|
|
259
|
+
If you just want to _use_ these plugins, you can usually ignore their [type](#Plugin_Types) and just register them with the builder as described
|
|
260
|
+
in the [Builder Configuration](#Builder_Configuration) section above.
|
|
261
261
|
However, if you want to _create_ new plugins, you should be aware of the different plugin types and when they are applied during the analysis.
|
|
262
262
|
|
|
263
263
|
Currently, flowR supports the following plugin types built-in:
|
|
@@ -333,7 +333,7 @@ All loading order plugins should conform to the ${ctx.link(flowr_analyzer_loadin
|
|
|
333
333
|
|
|
334
334
|
${(0, doc_structure_1.section)('How to add a new plugin', 3)}
|
|
335
335
|
|
|
336
|
-
If you want to make a new plugin you first have to decide which type of plugin you want to create (see [Plugin Types](#
|
|
336
|
+
If you want to make a new plugin you first have to decide which type of plugin you want to create (see [Plugin Types](#Plugin_Types) above).
|
|
337
337
|
Then, you must create a new class that extends the corresponding base class (e.g., ${ctx.link(flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin)} for file loading plugins).
|
|
338
338
|
In general, most plugins operate on the [context information](#Context_Information) provided by the analyzer.
|
|
339
339
|
Usually it is a good idea to have a look at the existing plugins of the same type to get an idea of how to implement your own plugin.
|
|
@@ -524,7 +524,7 @@ The cache is maintained by the ${ctx.link(flowr_analyzer_cache_1.FlowrAnalyzerCa
|
|
|
524
524
|
Underlying, it relies on the ${ctx.link(pipeline_executor_1.PipelineExecutor)} to cache results of different pipeline stages.
|
|
525
525
|
|
|
526
526
|
Usually, you do not have to worry about the cache, as it is managed automatically by the analyzer.
|
|
527
|
-
If you want to overwrite cache information, the analysis methods in ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)} (see [Conducting Analyses](#
|
|
527
|
+
If you want to overwrite cache information, the analysis methods in ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)} (see [Conducting Analyses](#Conducting_Analyses) above)
|
|
528
528
|
usually provide an optional \`force\` parameter to control whether to use the cache or recompute the results.
|
|
529
529
|
`;
|
|
530
530
|
}
|
|
@@ -191,7 +191,7 @@ It is mostly intended for developers that want to extend the capabilities of _fl
|
|
|
191
191
|
and assumes knowledge of [TypeScript](https://www.typescriptlang.org/) and [R](https://www.r-project.org/).
|
|
192
192
|
If you think parts of the wiki are missing, wrong, or outdated, please do not hesitate to [open a new issue](${doc_issue_1.NewIssueUrl})!
|
|
193
193
|
In case you are new and want to develop for flowR, please check out the relevant ${ctx.linkPage('wiki/Setup', 'Setup', '-developing-for-flowr')} wiki page
|
|
194
|
-
and the [Contributing Guidelines](${doc_files_1.RemoteFlowrFilePathBaseRef}
|
|
194
|
+
and the [Contributing Guidelines](${doc_files_1.RemoteFlowrFilePathBaseRef}.github/CONTRIBUTING.md).
|
|
195
195
|
|
|
196
196
|
${(0, doc_structure_1.block)({
|
|
197
197
|
type: 'NOTE',
|
|
@@ -594,7 +594,7 @@ However, nested definitions can carry it (in the nested case, \`x\` is defined b
|
|
|
594
594
|
name: 'Calls Edge',
|
|
595
595
|
type: edge_1.EdgeType.Calls,
|
|
596
596
|
description: `Link the [function call](#function-call-vertex) to the [function definition](#function-definition-vertex) that is called. To find all called definitions,
|
|
597
|
-
please use the ${ctx.link(dfg_get_origin_1.getOriginInDfg.name)} function, as explained in ${ctx.linkPage('wiki/Dataflow Graph', 'working with the dataflow graph', '
|
|
597
|
+
please use the ${ctx.link(dfg_get_origin_1.getOriginInDfg.name)} function, as explained in ${ctx.linkPage('wiki/Dataflow Graph', 'working with the dataflow graph', 'dfg-working')}.
|
|
598
598
|
If you are interested in the call graph, refer to ${ctx.linkM(flowr_analyzer_1.FlowrAnalyzer, 'callGraph')} and consult the ${ctx.linkPage('wiki/Dataflow Graph', 'call graph wiki', 'perspectives-cg')} for more information.
|
|
599
599
|
`,
|
|
600
600
|
code: 'foo <- function() {}\nfoo()',
|
|
@@ -801,7 +801,7 @@ ${(0, doc_structure_1.details)('Simplified Version of the graph', await (0, doc_
|
|
|
801
801
|
|
|
802
802
|
The following vertices types exist:
|
|
803
803
|
|
|
804
|
-
1. ${(0, doc_data_dfg_util_1.getAllVertices)().map(([k, v]
|
|
804
|
+
1. ${(0, doc_data_dfg_util_1.getAllVertices)().map(([k, v]) => `[\`${k}\`](#${v.toLowerCase().replace(/\s/g, '-')}-vertex)`).join('\n1. ')}
|
|
805
805
|
|
|
806
806
|
${(0, doc_structure_1.details)('Class Diagram', 'All boxes should link to their respective implementation:\n' + (0, doc_code_1.codeBlock)('mermaid', ctx.mermaid('DataflowGraphVertexInfo', { inlineTypes: ['MergeableRecord'] })))}
|
|
807
807
|
|
|
@@ -929,7 +929,7 @@ ${(0, doc_structure_1.details)('Example: Nested Conditionals', await (0, doc_dfg
|
|
|
929
929
|
|
|
930
930
|
${(0, doc_structure_1.section)('Dataflow Information', 2, 'dataflow-information')}
|
|
931
931
|
|
|
932
|
-
Using _flowR's_ code interface (see the ${ctx.linkPage('wiki/Interface', 'Interface', 'creating-flowr
|
|
932
|
+
Using _flowR's_ code interface (see the ${ctx.linkPage('wiki/Interface', 'Interface', 'creating-analyses-with-flowr')} wiki page for more), you can generate the dataflow information
|
|
933
933
|
for a given piece of R code (in this case \`x <- 1; x + 1\`) as follows:
|
|
934
934
|
|
|
935
935
|
${(0, doc_code_1.codeBlock)('ts', `
|
|
@@ -17,7 +17,7 @@ class WikiLintingAndTesting extends doc_maker_1.DocMaker {
|
|
|
17
17
|
text({ ctx }) {
|
|
18
18
|
return `
|
|
19
19
|
For the latest code coverage information, see [codecov.io](${doc_files_1.FlowrCodecovRef}),
|
|
20
|
-
for the latest benchmark results, see the
|
|
20
|
+
for the latest benchmark results, see the ${ctx.linkPage('flowr:benchmarks', 'benchmark results')} wiki page.
|
|
21
21
|
|
|
22
22
|
- [๐จ Testing Suites](#testing-suites)
|
|
23
23
|
- [๐งช Functionality Tests](#functionality-tests)
|
|
@@ -81,7 +81,7 @@ It is up to the [ci](#ci-pipeline) to run the tests on different systems to ensu
|
|
|
81
81
|
<a id='test-structure'></a>
|
|
82
82
|
#### ๐๏ธ Test Structure
|
|
83
83
|
|
|
84
|
-
All functionality tests are to be located under [test/functionality](${doc_files_1.RemoteFlowrFilePathBaseRef}
|
|
84
|
+
All functionality tests are to be located under [test/functionality](${doc_files_1.RemoteFlowrFilePathBaseRef}test/functionality).
|
|
85
85
|
|
|
86
86
|
This folder contains three special and important elements:
|
|
87
87
|
|
|
@@ -120,7 +120,7 @@ and it is probably best to have a look at existing tests in that area to get an
|
|
|
120
120
|
Various helper functions are available to ease in writing tests with common behaviors, like testing for dataflow, slicing or query results.
|
|
121
121
|
These can be found in [the \`_helper\` subdirectory](${doc_files_1.RemoteFlowrFilePathBaseRef}test/functionality/_helper).
|
|
122
122
|
|
|
123
|
-
For example, an [existing test](${doc_files_1.RemoteFlowrFilePathBaseRef}test/functionality/dataflow/
|
|
123
|
+
For example, an [existing test](${doc_files_1.RemoteFlowrFilePathBaseRef}test/functionality/dataflow/main/atomic/dataflow-atomic.test.ts) that tests the dataflow graph of a simple variable looks like this:
|
|
124
124
|
${(0, doc_code_1.codeBlock)('typescript', `
|
|
125
125
|
assertDataflow(label('simple variable', ['name-normal']), shell,
|
|
126
126
|
'x', emptyGraph().use('0', 'x')
|
|
@@ -179,7 +179,7 @@ To run them, issue:
|
|
|
179
179
|
|
|
180
180
|
${(0, doc_code_1.codeBlock)('shell', 'npm run performance-test')}
|
|
181
181
|
|
|
182
|
-
See
|
|
182
|
+
See ${(0, doc_files_1.linkFlowRSourceFile)('test/performance')} for more information on the suites, how to run them, and their results. If you are interested in the results of the benchmarks, see ${ctx.linkPage('flowr:benchmarks', 'here')}.
|
|
183
183
|
|
|
184
184
|
<a id='testing-within-your-ide'></a>
|
|
185
185
|
### ๐ Testing Within Your IDE
|
|
@@ -207,18 +207,18 @@ Otherwise, the tests will not be instantiated.
|
|
|
207
207
|
<a id='ci-pipeline'></a>
|
|
208
208
|
## ๐ช CI Pipeline
|
|
209
209
|
|
|
210
|
-
We have several workflows defined in
|
|
210
|
+
We have several workflows defined in ${(0, doc_files_1.linkFlowRSourceFile)('.github/workflows')}.
|
|
211
211
|
We explain the most important workflows in the following:
|
|
212
212
|
|
|
213
|
-
-
|
|
213
|
+
- ${(0, doc_files_1.linkFlowRSourceFile)('.github/workflows/qa.yaml')} is the main workflow that will run different steps depending on several factors. It is responsible for:
|
|
214
214
|
- running the [functionality](#functionality-tests) and [performance tests](#performance-tests)
|
|
215
|
-
- uploading the results to the
|
|
215
|
+
- uploading the results to the ${ctx.linkPage('flowr:benchmarks', 'benchmark page')} for releases
|
|
216
216
|
- running the [functionality tests](#functionality-tests) on different operating systems (Windows, macOS, Linux) and with different versions of R
|
|
217
217
|
- reporting code coverage
|
|
218
218
|
- running the [linter](#linting) and reporting its results
|
|
219
|
-
- deploying the documentation to
|
|
220
|
-
-
|
|
221
|
-
-
|
|
219
|
+
- deploying the documentation to ${ctx.linkPage('flowr:docs', 'GitHub Pages')}
|
|
220
|
+
- ${(0, doc_files_1.linkFlowRSourceFile)('.github/workflows/release.yaml')} is responsible for creating a new release, only to be run by repository owners. Furthermore, it adds the new docker image to ${ctx.linkPage('flowr:docker', 'docker hub')}.
|
|
221
|
+
- ${(0, doc_files_1.linkFlowRSourceFile)('.github/workflows/broken-links-and-wiki.yaml')} repeatedly tests that all links are not dead!
|
|
222
222
|
|
|
223
223
|
<a id='linting'></a>
|
|
224
224
|
## ๐งน Linting
|
|
@@ -228,11 +228,11 @@ The main one:
|
|
|
228
228
|
|
|
229
229
|
${(0, doc_code_1.codeBlock)('shell', 'npm run lint')}
|
|
230
230
|
|
|
231
|
-
And a weaker version of the first (allowing for *todo* comments) which is run automatically in the [pre-push githook](${doc_files_1.RemoteFlowrFilePathBaseRef}
|
|
231
|
+
And a weaker version of the first (allowing for *todo* comments) which is run automatically in the [pre-push githook](${doc_files_1.RemoteFlowrFilePathBaseRef}.githooks/pre-push) as explained in the [CONTRIBUTING.md](${doc_files_1.RemoteFlowrFilePathBaseRef}.github/CONTRIBUTING.md):
|
|
232
232
|
|
|
233
233
|
${(0, doc_code_1.codeBlock)('shell', 'npm run lint-local')}
|
|
234
234
|
|
|
235
|
-
Besides checking coding style (as defined in the [package.json](${doc_files_1.RemoteFlowrFilePathBaseRef}
|
|
235
|
+
Besides checking coding style (as defined in the [package.json](${doc_files_1.RemoteFlowrFilePathBaseRef}package.json)), the *full* linter runs the [license checker](#license-checker).
|
|
236
236
|
|
|
237
237
|
In case you are unaware,
|
|
238
238
|
eslint can automatically fix several linting problems[](https://eslint.org/docs/latest/use/command-line-interface#fix-problems).
|
|
@@ -252,7 +252,7 @@ However, in case you think that the linter is wrong, please do not hesitate to o
|
|
|
252
252
|
<a id='license-checker'></a>
|
|
253
253
|
### ๐ชช License Checker
|
|
254
254
|
|
|
255
|
-
*flowR* is licensed under the [GPLv3 License](${doc_files_1.FlowrGithubBaseRef}/flowr/blob/main/LICENSE) requiring us to only rely on [compatible licenses](https://www.gnu.org/licenses/license-list.en.html). For now, this list is hardcoded as part of the npm [\`license-compat\`](${doc_files_1.RemoteFlowrFilePathBaseRef}
|
|
255
|
+
*flowR* is licensed under the [GPLv3 License](${doc_files_1.FlowrGithubBaseRef}/flowr/blob/main/LICENSE) requiring us to only rely on [compatible licenses](https://www.gnu.org/licenses/license-list.en.html). For now, this list is hardcoded as part of the npm [\`license-compat\`](${doc_files_1.RemoteFlowrFilePathBaseRef}package.json) script so it can very well be that a new dependency you add causes the checker to fail — *even though it is compatible*. In that case, please either open a [new issue](${doc_files_1.FlowrGithubBaseRef}/flowr/issues/new/choose) or directly add the license to the list (including a reference to why it is compatible).
|
|
256
256
|
|
|
257
257
|
<a id='debugging'></a>
|
|
258
258
|
## ๐ Debugging
|
|
@@ -86,7 +86,7 @@ export declare const ConstantWikiLinkInfo: {
|
|
|
86
86
|
readonly name: "flowR benchmark page";
|
|
87
87
|
};
|
|
88
88
|
readonly 'flowr:docs': {
|
|
89
|
-
readonly url: "https://flowr-analysis.github.io/flowr/
|
|
89
|
+
readonly url: "https://flowr-analysis.github.io/flowr/doc/";
|
|
90
90
|
readonly name: "flowR code docs";
|
|
91
91
|
};
|
|
92
92
|
readonly 'flowr:zenodo': {
|
|
@@ -31,8 +31,8 @@ exports.ConstantWikiLinkInfo = {
|
|
|
31
31
|
'flowr:positron': { url: doc_files_1.FlowrPositron, name: 'flowR extension for Positron' },
|
|
32
32
|
'flowr:rstudio-addin': { url: doc_files_1.FlowrRStudioAddin, name: 'flowR RStudio Addin' },
|
|
33
33
|
'flowr:radapter': { url: doc_files_1.FlowrRAdapter, name: 'flowR R Adapter' },
|
|
34
|
-
'flowr:benchmarks': { url:
|
|
35
|
-
'flowr:docs': { url:
|
|
34
|
+
'flowr:benchmarks': { url: `${doc_files_1.FlowrSiteBaseRef}/wiki/stats/benchmark`, name: 'flowR benchmark page' },
|
|
35
|
+
'flowr:docs': { url: `${doc_files_1.FlowrSiteBaseRef}/doc/`, name: 'flowR code docs' },
|
|
36
36
|
'flowr:zenodo': { url: 'https://zenodo.org/doi/10.5281/zenodo.13319290', name: 'flowR on Zenodo' },
|
|
37
37
|
};
|
|
38
38
|
/**
|
|
@@ -124,15 +124,19 @@ function makeDocContextForTypes(shell, ...rootFolders) {
|
|
|
124
124
|
link = i.url;
|
|
125
125
|
text ??= i.name;
|
|
126
126
|
}
|
|
127
|
+
else if (pageName.startsWith('wiki/')) {
|
|
128
|
+
link = `${doc_files_1.FlowrWikiBaseRef}/${pageName.slice('wiki/'.length).replaceAll(' ', '-')}`;
|
|
129
|
+
}
|
|
127
130
|
else {
|
|
128
|
-
link =
|
|
131
|
+
link = (0, doc_files_1.flowrSourceFileUrl)(/\.[a-z0-9]+$/i.test(pageName) ? pageName : pageName + '.md');
|
|
129
132
|
}
|
|
130
133
|
text ??= pageName.split('/').pop() ?? pageName;
|
|
131
134
|
return `[${text}](${link}${segment ? '#' + segment : ''})`;
|
|
132
135
|
},
|
|
133
136
|
linkCode(path, lineNumber) {
|
|
134
|
-
const
|
|
135
|
-
|
|
137
|
+
const p = path.toString();
|
|
138
|
+
const lnk = (0, doc_files_1.flowrSourceFileUrl)(p) + (lineNumber ? `#L${lineNumber}` : '');
|
|
139
|
+
return `[${p}](${encodeURI(lnk)})`;
|
|
136
140
|
},
|
|
137
141
|
cliOption(scriptName, optionName, withAlias = false, quote = true) {
|
|
138
142
|
return (0, doc_cli_option_1.getCliLongOptionOf)(scriptName, optionName, withAlias, quote);
|
|
@@ -109,7 +109,7 @@ The following segments intend to give you an overview of how to work with the no
|
|
|
109
109
|
|
|
110
110
|
## How to Get a Normalized AST
|
|
111
111
|
|
|
112
|
-
As explained alongside the ${ctx.linkPage('wiki/Interface', 'Interface', 'creating-flowr
|
|
112
|
+
As explained alongside the ${ctx.linkPage('wiki/Interface', 'Interface', 'creating-analyses-with-flowr')} wiki page, you can use an instance of
|
|
113
113
|
${ctx.link(flowr_analyzer_1.FlowrAnalyzer)} to get the ${ctx.link('NormalizedAst')}:
|
|
114
114
|
|
|
115
115
|
${ctx.code(simpleNormalizedAst, { dropLinesStart: 1, dropLinesEnd: 2, hideDefinedAt: true })}
|
|
@@ -38,7 +38,7 @@ Primarily, _flowR_ provides a dataflow analysis framework for the [*R*](https://
|
|
|
38
38
|
Its subcomponents (like the custom ${ctx.link(shell_1.RShell)}) or the internals of the static ${ctx.link(graph_1.DataflowGraph)})
|
|
39
39
|
are not important if you simply wish to use _flowR_.
|
|
40
40
|
If you wish to use _flowR_, check out one of its extensions (e.g., the ${ctx.linkPage('flowr:vscode', 'VS Code extension')}),
|
|
41
|
-
the [REPL and server interfaces](#using-
|
|
41
|
+
the [REPL and server interfaces](#using-flowr-from-the-outside) or its coding API with the
|
|
42
42
|
${ctx.link(flowr_analyzer_1.FlowrAnalyzer)}.
|
|
43
43
|
|
|
44
44
|
The benchmark module is only of interest if you want to benchmark/measure the runtime performance and reduction of the slicer.
|
|
@@ -112,7 +112,7 @@ The supported requests are documented alongside the internal documentation, see
|
|
|
112
112
|
<details>
|
|
113
113
|
<summary>Small demonstration using netcat</summary>
|
|
114
114
|
|
|
115
|
-

|
|
115
|
+

|
|
116
116
|
|
|
117
117
|
<details>
|
|
118
118
|
<summary>Used <a href="https://github.com/charmbracelet/vhs">vhs</a> code</summary>
|
|
@@ -1064,7 +1064,7 @@ ${(0, doc_structure_1.block)({
|
|
|
1064
1064
|
content: `
|
|
1065
1065
|
There are many ways to query a dataflow graph created by flowR.
|
|
1066
1066
|
For example, you can use the ${ctx.linkPage('wiki/Interface', '`request-query`', 'message-request-query')} message
|
|
1067
|
-
with a running flowR server, or the ${(0, doc_cli_option_1.getReplCommand)('query')} command in the flowR ${ctx.linkPage('wiki/Interface', 'REPL', 'repl')}.
|
|
1067
|
+
with a running flowR server, or the ${(0, doc_cli_option_1.getReplCommand)('query')} command in the flowR ${ctx.linkPage('wiki/Interface', 'REPL', '-using-the-repl')}.
|
|
1068
1068
|
|
|
1069
1069
|
Also, check out the [${doc_files_1.FlowrGithubGroupName}/sample-analyzer-project-query](${doc_files_1.FlowrGithubBaseRef}/sample-analyzer-project-query) repository for a complete example project using the query API.
|
|
1070
1070
|
`.trim()
|