@eagleoutice/flowr 2.2.12 → 2.2.13
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 +82 -20
- package/benchmark/slicer.js +2 -2
- package/benchmark/summarizer/first-phase/input.js +1 -1
- package/benchmark/summarizer/first-phase/process.js +3 -3
- package/benchmark/summarizer/second-phase/process.js +1 -1
- package/benchmark/summarizer/summarizer.js +1 -1
- package/cli/common/options.js +4 -4
- package/cli/common/script.js +1 -1
- package/cli/flowr.js +1 -1
- package/cli/repl/commands/repl-cfg.d.ts +2 -0
- package/cli/repl/commands/repl-cfg.js +38 -24
- package/cli/repl/commands/repl-commands.js +4 -2
- package/cli/repl/commands/repl-dataflow.js +3 -3
- package/cli/repl/commands/repl-execute.js +1 -1
- package/cli/repl/commands/repl-main.d.ts +1 -1
- package/cli/repl/commands/repl-main.js +1 -1
- package/cli/repl/commands/repl-normalize.js +1 -1
- package/cli/repl/commands/repl-query.js +2 -2
- package/cli/repl/core.js +1 -1
- package/cli/repl/prompt.js +1 -1
- package/cli/repl/server/connection.js +4 -4
- package/cli/repl/server/messages/message-analysis.d.ts +1 -1
- package/cli/script-core/statistics-core.js +1 -1
- package/cli/script-core/statistics-helper-core.js +4 -4
- package/config.d.ts +47 -24
- package/config.js +3 -3
- package/control-flow/basic-cfg-guided-visitor.d.ts +39 -0
- package/control-flow/basic-cfg-guided-visitor.js +114 -0
- package/control-flow/cfg-properties.d.ts +26 -0
- package/control-flow/cfg-properties.js +100 -0
- package/control-flow/cfg-simplification.d.ts +18 -0
- package/control-flow/cfg-simplification.js +55 -0
- package/control-flow/cfg-to-basic-blocks.d.ts +5 -0
- package/control-flow/cfg-to-basic-blocks.js +81 -0
- package/control-flow/control-flow-graph.d.ts +247 -0
- package/control-flow/control-flow-graph.js +290 -0
- package/control-flow/dfg-cfg-guided-visitor.d.ts +32 -0
- package/control-flow/dfg-cfg-guided-visitor.js +71 -0
- package/control-flow/diff-cfg.d.ts +11 -0
- package/control-flow/diff-cfg.js +161 -0
- package/control-flow/extract-cfg.d.ts +30 -0
- package/control-flow/extract-cfg.js +475 -0
- package/control-flow/happens-before.d.ts +7 -0
- package/{util/cfg → control-flow}/happens-before.js +3 -3
- package/control-flow/semantic-cfg-guided-visitor.d.ts +452 -0
- package/control-flow/semantic-cfg-guided-visitor.js +492 -0
- package/control-flow/simple-visitor.d.ts +25 -0
- package/control-flow/simple-visitor.js +80 -0
- package/control-flow/syntax-cfg-guided-visitor.d.ts +128 -0
- package/control-flow/syntax-cfg-guided-visitor.js +166 -0
- package/core/print/print.d.ts +1 -1
- package/core/print/slice-diff-ansi.js +1 -1
- package/core/steps/pipeline/create-pipeline.js +1 -1
- package/dataflow/environments/built-in-config.js +9 -6
- package/dataflow/environments/built-in.d.ts +8 -4
- package/dataflow/environments/built-in.js +47 -5
- package/dataflow/environments/default-builtin-config.d.ts +2 -0
- package/dataflow/environments/default-builtin-config.js +81 -14
- package/dataflow/environments/resolve-by-name.js +15 -4
- package/dataflow/extractor.js +2 -2
- package/dataflow/graph/dataflowgraph-builder.d.ts +3 -1
- package/dataflow/graph/dataflowgraph-builder.js +4 -2
- package/dataflow/graph/diff-dataflow-graph.d.ts +16 -0
- package/dataflow/graph/{diff.js → diff-dataflow-graph.js} +30 -56
- package/dataflow/graph/graph.d.ts +11 -3
- package/dataflow/graph/graph.js +27 -12
- package/dataflow/graph/vertex.d.ts +17 -2
- package/dataflow/internal/linker.d.ts +3 -2
- package/dataflow/internal/linker.js +33 -24
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +1 -1
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +12 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +84 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +23 -16
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +5 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +9 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +15 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +9 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +19 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +19 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +3 -3
- package/dataflow/internal/process/functions/call/common.d.ts +4 -1
- package/dataflow/internal/process/functions/call/common.js +5 -3
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +2 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.d.ts +1 -0
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +6 -4
- package/dataflow/internal/process/process-named-call.d.ts +1 -1
- package/dataflow/internal/process/process-named-call.js +5 -5
- package/dataflow/origin/dfg-get-origin.d.ts +82 -0
- package/dataflow/origin/dfg-get-origin.js +116 -0
- package/documentation/doc-util/doc-cfg.d.ts +13 -6
- package/documentation/doc-util/doc-cfg.js +19 -14
- package/documentation/doc-util/doc-cli-option.js +4 -2
- package/documentation/doc-util/doc-dfg.js +3 -3
- package/documentation/doc-util/doc-escape.d.ts +7 -0
- package/documentation/doc-util/doc-escape.js +19 -0
- package/documentation/doc-util/doc-files.d.ts +1 -0
- package/documentation/doc-util/doc-files.js +2 -1
- package/documentation/doc-util/doc-normalized-ast.js +3 -3
- package/documentation/doc-util/doc-query.js +2 -2
- package/documentation/doc-util/doc-repl.js +1 -1
- package/documentation/doc-util/doc-search.js +1 -1
- package/documentation/doc-util/doc-server-message.js +2 -2
- package/documentation/doc-util/doc-structure.d.ts +1 -0
- package/documentation/doc-util/doc-structure.js +5 -0
- package/documentation/doc-util/doc-types.d.ts +7 -1
- package/documentation/doc-util/doc-types.js +13 -2
- package/documentation/print-capabilities-markdown.js +27 -1
- package/documentation/print-cfg-wiki.js +505 -17
- package/documentation/print-dataflow-graph-wiki.js +180 -25
- package/documentation/print-engines-wiki.js +1 -1
- package/documentation/print-faq-wiki.d.ts +1 -0
- package/documentation/print-faq-wiki.js +75 -0
- package/documentation/print-interface-wiki.js +1 -1
- package/documentation/print-linting-and-testing-wiki.js +52 -36
- package/documentation/print-normalized-ast-wiki.js +1 -1
- package/documentation/print-onboarding-wiki.d.ts +1 -0
- package/documentation/print-onboarding-wiki.js +42 -0
- package/documentation/print-query-wiki.js +21 -1
- package/documentation/print-readme.js +10 -3
- package/package.json +9 -6
- package/queries/catalog/call-context-query/call-context-query-executor.js +5 -5
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-format.js +2 -2
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +2 -2
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +24 -21
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
- package/queries/catalog/cluster-query/cluster-query-format.js +1 -1
- package/queries/catalog/config-query/config-query-format.d.ts +1 -1
- package/queries/catalog/config-query/config-query-format.js +2 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -2
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -2
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -2
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +4 -4
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.js +2 -2
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.js +2 -2
- package/queries/catalog/lineage-query/lineage-query-format.d.ts +1 -1
- package/queries/catalog/lineage-query/lineage-query-format.js +2 -2
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +2 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +2 -2
- package/queries/catalog/origin-query/origin-query-executor.d.ts +5 -0
- package/queries/catalog/origin-query/origin-query-executor.js +33 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +71 -0
- package/queries/catalog/origin-query/origin-query-format.js +27 -0
- package/queries/catalog/project-query/project-query-format.d.ts +1 -1
- package/queries/catalog/project-query/project-query-format.js +2 -2
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +2 -2
- package/queries/catalog/search-query/search-query-format.d.ts +1 -1
- package/queries/catalog/search-query/search-query-format.js +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.js +2 -2
- package/queries/query-print.d.ts +1 -1
- package/queries/query-print.js +4 -4
- package/queries/query.d.ts +61 -2
- package/queries/query.js +3 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +3 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +5 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +5 -0
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/fold.js +3 -1
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +2 -2
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +4 -4
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +26 -8
- package/r-bridge/retriever.js +1 -1
- package/search/search-executor/search-generators.d.ts +1 -1
- package/search/search-executor/search-transformer.d.ts +1 -1
- package/slicing/criterion/collect-all.js +1 -1
- package/slicing/static/slice-call.js +13 -3
- package/statistics/features/supported/assignments/post-process.js +1 -1
- package/statistics/features/supported/defined-functions/post-process.js +2 -2
- package/statistics/features/supported/used-functions/post-process.js +1 -1
- package/statistics/features/supported/used-packages/post-process.js +2 -2
- package/statistics/features/supported/values/post-process.js +2 -2
- package/statistics/output/print-stats.js +2 -2
- package/statistics/summarizer/post-process/clusterer.d.ts +1 -1
- package/statistics/summarizer/post-process/clusterer.js +1 -1
- package/statistics/summarizer/post-process/histogram.js +3 -3
- package/statistics/summarizer/post-process/post-process-output.js +3 -3
- package/statistics/summarizer/second-phase/process.js +2 -2
- package/statistics/summarizer/summarizer.js +2 -2
- package/util/assert.js +36 -1
- package/util/cfg/cfg.d.ts +0 -80
- package/util/cfg/cfg.js +0 -549
- package/util/{arrays.d.ts → collections/arrays.d.ts} +1 -1
- package/util/{arrays.js → collections/arrays.js} +3 -3
- package/util/collections/set.js +17 -0
- package/util/diff-graph.d.ts +47 -0
- package/util/diff-graph.js +61 -0
- package/util/diff.d.ts +6 -6
- package/util/diff.js +1 -1
- package/util/mermaid/cfg.d.ts +9 -2
- package/util/mermaid/cfg.js +64 -12
- package/util/mermaid/dfg.d.ts +2 -1
- package/util/mermaid/dfg.js +26 -10
- package/util/mermaid/mermaid.d.ts +2 -0
- package/util/mermaid/mermaid.js +6 -0
- package/util/quads.js +1 -1
- package/util/schema.d.ts +1 -1
- package/util/schema.js +1 -1
- package/util/summarizer.js +1 -1
- package/util/{text.js → text/text.js} +1 -1
- package/util/{time.js → text/time.js} +1 -1
- package/util/version.js +1 -1
- package/dataflow/graph/diff.d.ts +0 -36
- package/util/cfg/happens-before.d.ts +0 -7
- package/util/cfg/visitor.d.ts +0 -9
- package/util/cfg/visitor.js +0 -30
- package/util/set.js +0 -31
- /package/util/{bimap.d.ts → collections/bimap.d.ts} +0 -0
- /package/util/{bimap.js → collections/bimap.js} +0 -0
- /package/util/{defaultmap.d.ts → collections/defaultmap.d.ts} +0 -0
- /package/util/{defaultmap.js → collections/defaultmap.js} +0 -0
- /package/util/{set.d.ts → collections/set.d.ts} +0 -0
- /package/util/{ansi.d.ts → text/ansi.d.ts} +0 -0
- /package/util/{ansi.js → text/ansi.js} +0 -0
- /package/util/{args.d.ts → text/args.d.ts} +0 -0
- /package/util/{args.js → text/args.js} +0 -0
- /package/util/{strings.d.ts → text/strings.d.ts} +0 -0
- /package/util/{strings.js → text/strings.js} +0 -0
- /package/util/{text.d.ts → text/text.d.ts} +0 -0
- /package/util/{time.d.ts → text/time.d.ts} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
2
|
+
import type { GenericDiffConfiguration, GenericDifferenceInformation, WriteableDifferenceReport } from './diff';
|
|
3
|
+
import type { DataflowGraph } from '../dataflow/graph/graph';
|
|
4
|
+
export interface NamedGraph<Graph = DataflowGraph> {
|
|
5
|
+
name: string;
|
|
6
|
+
graph: Graph;
|
|
7
|
+
}
|
|
8
|
+
interface ProblematicVertex {
|
|
9
|
+
tag: 'vertex';
|
|
10
|
+
id: NodeId;
|
|
11
|
+
}
|
|
12
|
+
interface ProblematicEdge {
|
|
13
|
+
tag: 'edge';
|
|
14
|
+
from: NodeId;
|
|
15
|
+
to: NodeId;
|
|
16
|
+
}
|
|
17
|
+
export type ProblematicDiffInfo = ProblematicVertex | ProblematicEdge;
|
|
18
|
+
/**
|
|
19
|
+
* To be produced by a function differencing two graphs (e.g., {@link DataflowGraph|DFGs} or {@link ControlFlowGraph|CFGs}).
|
|
20
|
+
*
|
|
21
|
+
* @see {@link GraphDifferenceReport#isEqual|isEqual} - to check whether the graphs are equal
|
|
22
|
+
* @see {@link GraphDifferenceReport#addComment|addComment} - to add comments to the report
|
|
23
|
+
* @see {@link GraphDifferenceReport#comments|comments} - to get the attached comments
|
|
24
|
+
* @see {@link GraphDifferenceReport#problematic|problematic} - to get the problematic vertices/edges
|
|
25
|
+
*/
|
|
26
|
+
export declare class GraphDifferenceReport implements WriteableDifferenceReport {
|
|
27
|
+
_comments: string[] | undefined;
|
|
28
|
+
_problematic: ProblematicDiffInfo[] | undefined;
|
|
29
|
+
addComment(comment: string, ...related: readonly ProblematicDiffInfo[]): void;
|
|
30
|
+
comments(): readonly string[] | undefined;
|
|
31
|
+
problematic(): readonly ProblematicDiffInfo[] | undefined;
|
|
32
|
+
isEqual(): boolean;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* A context that can be used by differencing functions to compare two graphs
|
|
36
|
+
* See {@link initDiffContext} for a function that creates such a context.
|
|
37
|
+
*/
|
|
38
|
+
export interface GraphDiffContext<Graph = DataflowGraph> extends GenericDifferenceInformation<GraphDifferenceReport> {
|
|
39
|
+
left: Graph;
|
|
40
|
+
right: Graph;
|
|
41
|
+
config: GenericDiffConfiguration;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Create the context for differencing two graphs
|
|
45
|
+
*/
|
|
46
|
+
export declare function initDiffContext<Graph>(left: NamedGraph<Graph>, right: NamedGraph<Graph>, config?: Partial<GenericDiffConfiguration>): GraphDiffContext<Graph>;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphDifferenceReport = void 0;
|
|
4
|
+
exports.initDiffContext = initDiffContext;
|
|
5
|
+
/**
|
|
6
|
+
* To be produced by a function differencing two graphs (e.g., {@link DataflowGraph|DFGs} or {@link ControlFlowGraph|CFGs}).
|
|
7
|
+
*
|
|
8
|
+
* @see {@link GraphDifferenceReport#isEqual|isEqual} - to check whether the graphs are equal
|
|
9
|
+
* @see {@link GraphDifferenceReport#addComment|addComment} - to add comments to the report
|
|
10
|
+
* @see {@link GraphDifferenceReport#comments|comments} - to get the attached comments
|
|
11
|
+
* @see {@link GraphDifferenceReport#problematic|problematic} - to get the problematic vertices/edges
|
|
12
|
+
*/
|
|
13
|
+
class GraphDifferenceReport {
|
|
14
|
+
_comments = undefined;
|
|
15
|
+
_problematic = undefined;
|
|
16
|
+
addComment(comment, ...related) {
|
|
17
|
+
if (this._comments === undefined) {
|
|
18
|
+
this._comments = [comment];
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
this._comments.push(comment);
|
|
22
|
+
}
|
|
23
|
+
if (related.length > 0) {
|
|
24
|
+
if (this._problematic === undefined) {
|
|
25
|
+
this._problematic = [...related];
|
|
26
|
+
}
|
|
27
|
+
else {
|
|
28
|
+
this._problematic.push(...related);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
comments() {
|
|
33
|
+
return this._comments;
|
|
34
|
+
}
|
|
35
|
+
problematic() {
|
|
36
|
+
return this._problematic;
|
|
37
|
+
}
|
|
38
|
+
isEqual() {
|
|
39
|
+
return this._comments === undefined;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
exports.GraphDifferenceReport = GraphDifferenceReport;
|
|
43
|
+
/**
|
|
44
|
+
* Create the context for differencing two graphs
|
|
45
|
+
*/
|
|
46
|
+
function initDiffContext(left, right, config) {
|
|
47
|
+
return {
|
|
48
|
+
left: left.graph,
|
|
49
|
+
leftname: left.name,
|
|
50
|
+
right: right.graph,
|
|
51
|
+
rightname: right.name,
|
|
52
|
+
report: new GraphDifferenceReport(),
|
|
53
|
+
position: '',
|
|
54
|
+
config: {
|
|
55
|
+
rightIsSubgraph: false,
|
|
56
|
+
leftIsSubgraph: false,
|
|
57
|
+
...config
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
//# sourceMappingURL=diff-graph.js.map
|
package/util/diff.d.ts
CHANGED
|
@@ -12,14 +12,14 @@ import type { MergeableRecord } from './objects';
|
|
|
12
12
|
*/
|
|
13
13
|
export interface DifferenceReport {
|
|
14
14
|
/**
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
* A human-readable description of differences during the comparison
|
|
16
|
+
* In combination with {@link isEqual} this can be used to provide detailed
|
|
17
|
+
* explanation on equal structures as well (e.g., if structures _could_ be equal).
|
|
18
|
+
*/
|
|
19
19
|
comments(): readonly string[] | undefined;
|
|
20
20
|
/**
|
|
21
|
-
|
|
22
|
-
|
|
21
|
+
* @returns true iff the compared structures are equal (i.e., the diff is empty)
|
|
22
|
+
*/
|
|
23
23
|
isEqual(): boolean;
|
|
24
24
|
}
|
|
25
25
|
export interface WriteableDifferenceReport extends DifferenceReport {
|
package/util/diff.js
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.setDifference = setDifference;
|
|
10
|
-
const set_1 = require("./set");
|
|
10
|
+
const set_1 = require("./collections/set");
|
|
11
11
|
function setDifference(left, right, info) {
|
|
12
12
|
const lWithoutR = (0, set_1.setMinus)(left, right);
|
|
13
13
|
const rWithoutL = (0, set_1.setMinus)(right, left);
|
package/util/mermaid/cfg.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
|
-
import type { ControlFlowInformation } from '../cfg/cfg';
|
|
2
1
|
import type { NormalizedAst } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
3
|
-
|
|
2
|
+
import type { ControlFlowInformation } from '../../control-flow/control-flow-graph';
|
|
3
|
+
/**
|
|
4
|
+
* Convert the control flow graph to a mermaid string.
|
|
5
|
+
* @param cfg - The control flow graph to convert.
|
|
6
|
+
* @param normalizedAst - The normalized AST to use for the vertex content.
|
|
7
|
+
* @param prefix - The prefix to use for the mermaid string.
|
|
8
|
+
* @param simplify - Whether to simplify the control flow graph (especially in the context of basic blocks).
|
|
9
|
+
*/
|
|
10
|
+
export declare function cfgToMermaid(cfg: ControlFlowInformation, normalizedAst: NormalizedAst, prefix?: string, simplify?: boolean): string;
|
|
4
11
|
/**
|
|
5
12
|
* Use mermaid to visualize the normalized AST.
|
|
6
13
|
*/
|
package/util/mermaid/cfg.js
CHANGED
|
@@ -3,27 +3,79 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.cfgToMermaid = cfgToMermaid;
|
|
4
4
|
exports.cfgToMermaidUrl = cfgToMermaidUrl;
|
|
5
5
|
const mermaid_1 = require("./mermaid");
|
|
6
|
+
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
7
|
+
const control_flow_graph_1 = require("../../control-flow/control-flow-graph");
|
|
8
|
+
const reconstruct_1 = require("../../reconstruct/reconstruct");
|
|
9
|
+
const auto_select_defaults_1 = require("../../reconstruct/auto-select/auto-select-defaults");
|
|
6
10
|
function getLexeme(n) {
|
|
7
|
-
return n ? n.info.fullLexeme ?? n.lexeme ?? '
|
|
11
|
+
return n ? n.info.fullLexeme ?? n.lexeme ?? '' : undefined;
|
|
8
12
|
}
|
|
9
|
-
function
|
|
13
|
+
function cfgOfNode(vert, normalizedVertex, id, content, output) {
|
|
14
|
+
if (normalizedVertex && content !== undefined) {
|
|
15
|
+
const start = vert.type === control_flow_graph_1.CfgVertexType.Expression ? '([' : '[';
|
|
16
|
+
const end = vert.type === control_flow_graph_1.CfgVertexType.Expression ? '])' : ']';
|
|
17
|
+
const name = `"\`${(0, mermaid_1.escapeMarkdown)(normalizedVertex.type)} (${id})${content ? '\n' + (0, mermaid_1.escapeMarkdown)(JSON.stringify(content)) : ''}${vert.callTargets ? '\n calls:' + (0, mermaid_1.escapeMarkdown)(JSON.stringify([...vert.callTargets])) : ''}\`"`;
|
|
18
|
+
output += ` n${id}${start}${name}${end}\n`;
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
output += String(id).endsWith('-exit') ? ` n${id}((${id}))\n` : ` n${id}[[${id}]]\n`;
|
|
22
|
+
}
|
|
23
|
+
return output;
|
|
24
|
+
}
|
|
25
|
+
const getDirRegex = /flowchart\s+([A-Za-z]+)/;
|
|
26
|
+
/**
|
|
27
|
+
* Convert the control flow graph to a mermaid string.
|
|
28
|
+
* @param cfg - The control flow graph to convert.
|
|
29
|
+
* @param normalizedAst - The normalized AST to use for the vertex content.
|
|
30
|
+
* @param prefix - The prefix to use for the mermaid string.
|
|
31
|
+
* @param simplify - Whether to simplify the control flow graph (especially in the context of basic blocks).
|
|
32
|
+
*/
|
|
33
|
+
function cfgToMermaid(cfg, normalizedAst, prefix = 'flowchart BT\n', simplify = false) {
|
|
10
34
|
let output = prefix;
|
|
11
|
-
|
|
12
|
-
|
|
35
|
+
const dirIs = getDirRegex.exec(prefix)?.at(1) ?? 'LR';
|
|
36
|
+
for (const [id, vertex] of cfg.graph.vertices(false)) {
|
|
37
|
+
const normalizedVertex = normalizedAst?.idMap.get(id);
|
|
13
38
|
const content = getLexeme(normalizedVertex);
|
|
14
|
-
if (
|
|
15
|
-
|
|
16
|
-
output += `
|
|
39
|
+
if (vertex.name === type_1.RType.ExpressionList && vertex.type === control_flow_graph_1.CfgVertexType.Expression && cfg.graph.hasVertex(id + '-exit')) {
|
|
40
|
+
output += ` subgraph ${type_1.RType.ExpressionList} ${normalizedVertex?.info.fullLexeme ?? id}\n`;
|
|
41
|
+
output += ` direction ${dirIs}\n`;
|
|
42
|
+
}
|
|
43
|
+
if (vertex.type === control_flow_graph_1.CfgVertexType.Block) {
|
|
44
|
+
if (simplify) {
|
|
45
|
+
const ids = vertex.elems?.map(e => e.id) ?? [];
|
|
46
|
+
const reconstruct = (0, reconstruct_1.reconstructToCode)(normalizedAst, new Set(ids), auto_select_defaults_1.doNotAutoSelect).code;
|
|
47
|
+
const name = `"\`Basic Block (${id})\n${(0, mermaid_1.escapeMarkdown)(reconstruct)}\`"`;
|
|
48
|
+
output += ` n${id}[[${name}]]\n`;
|
|
49
|
+
}
|
|
50
|
+
else {
|
|
51
|
+
output += ` subgraph n${vertex.id} [Block ${normalizedVertex?.info.fullLexeme ?? id}]\n`;
|
|
52
|
+
output += ` direction ${dirIs}\n`;
|
|
53
|
+
let last = undefined;
|
|
54
|
+
for (const element of vertex.elems ?? []) {
|
|
55
|
+
const childNormalizedVertex = normalizedAst?.idMap.get(element.id);
|
|
56
|
+
const childContent = getLexeme(childNormalizedVertex);
|
|
57
|
+
output = cfgOfNode(vertex, childNormalizedVertex, element.id, childContent, output);
|
|
58
|
+
// just to keep the order
|
|
59
|
+
if (last) {
|
|
60
|
+
output += ` ${last} -.-> n${element.id}\n`;
|
|
61
|
+
}
|
|
62
|
+
last = `n${element.id}`;
|
|
63
|
+
}
|
|
64
|
+
output += ' end\n';
|
|
65
|
+
}
|
|
17
66
|
}
|
|
18
67
|
else {
|
|
19
|
-
output
|
|
68
|
+
output = cfgOfNode(vertex, normalizedVertex, id, content, output);
|
|
69
|
+
}
|
|
70
|
+
if (vertex.name === type_1.RType.ExpressionList && vertex.type === control_flow_graph_1.CfgVertexType.EndMarker) {
|
|
71
|
+
output += ' end\n';
|
|
20
72
|
}
|
|
21
73
|
}
|
|
22
74
|
for (const [from, targets] of cfg.graph.edges()) {
|
|
23
75
|
for (const [to, edge] of targets) {
|
|
24
|
-
const edgeType = edge.label ===
|
|
25
|
-
const edgeSuffix = edge.label ===
|
|
26
|
-
output += ` n${from} ${edgeType}|"${(0, mermaid_1.escapeMarkdown)(edge.label)}${edgeSuffix}"| n${to}\n`;
|
|
76
|
+
const edgeType = edge.label === 1 /* CfgEdgeType.Cd */ ? '-->' : '-.->';
|
|
77
|
+
const edgeSuffix = edge.label === 1 /* CfgEdgeType.Cd */ ? ` (${edge.when})` : '';
|
|
78
|
+
output += ` n${from} ${edgeType}|"${(0, mermaid_1.escapeMarkdown)((0, control_flow_graph_1.edgeTypeToString)(edge.label))}${edgeSuffix}"| n${to}\n`;
|
|
27
79
|
}
|
|
28
80
|
}
|
|
29
81
|
for (const entryPoint of cfg.entryPoints) {
|
|
@@ -37,7 +89,7 @@ function cfgToMermaid(cfg, normalizedAst, prefix = 'flowchart BT\n') {
|
|
|
37
89
|
/**
|
|
38
90
|
* Use mermaid to visualize the normalized AST.
|
|
39
91
|
*/
|
|
40
|
-
function cfgToMermaidUrl(cfg, normalizedAst, prefix = '') {
|
|
92
|
+
function cfgToMermaidUrl(cfg, normalizedAst, prefix = 'flowchart BT\n') {
|
|
41
93
|
return (0, mermaid_1.mermaidCodeToUrl)(cfgToMermaid(cfg, normalizedAst, prefix));
|
|
42
94
|
}
|
|
43
95
|
//# sourceMappingURL=cfg.js.map
|
package/util/mermaid/dfg.d.ts
CHANGED
|
@@ -17,12 +17,13 @@ interface MermaidGraph {
|
|
|
17
17
|
markStyle: MermaidMarkStyle;
|
|
18
18
|
/** in the form of from-\>to because I am lazy, see {@link encodeEdge} */
|
|
19
19
|
presentEdges: Set<string>;
|
|
20
|
+
presentVertices: Set<string>;
|
|
20
21
|
rootGraph: DataflowGraph;
|
|
21
22
|
/** if given, the dataflow graph will only focus on the "important" parts */
|
|
22
23
|
simplified?: boolean;
|
|
23
24
|
}
|
|
24
25
|
/**
|
|
25
|
-
* Prints a {@link SourceRange|range} as a human
|
|
26
|
+
* Prints a {@link SourceRange|range} as a human-readable string.
|
|
26
27
|
*/
|
|
27
28
|
export declare function formatRange(range: SourceRange | undefined): string;
|
|
28
29
|
export declare function printIdentifier(id: IdentifierDefinition): string;
|
package/util/mermaid/dfg.js
CHANGED
|
@@ -9,14 +9,16 @@ exports.diffGraphsToMermaidUrl = diffGraphsToMermaidUrl;
|
|
|
9
9
|
const assert_1 = require("../assert");
|
|
10
10
|
const mermaid_1 = require("./mermaid");
|
|
11
11
|
const graph_1 = require("../../dataflow/graph/graph");
|
|
12
|
+
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
12
13
|
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
13
14
|
const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
14
15
|
const edge_1 = require("../../dataflow/graph/edge");
|
|
15
16
|
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
16
17
|
const environment_1 = require("../../dataflow/environments/environment");
|
|
17
18
|
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
19
|
+
const built_in_1 = require("../../dataflow/environments/built-in");
|
|
18
20
|
/**
|
|
19
|
-
* Prints a {@link SourceRange|range} as a human
|
|
21
|
+
* Prints a {@link SourceRange|range} as a human-readable string.
|
|
20
22
|
*/
|
|
21
23
|
function formatRange(range) {
|
|
22
24
|
if (range === undefined) {
|
|
@@ -36,14 +38,14 @@ function subflowToMermaid(nodeId, exitPoints, subflow, mermaid, idPrefix = '') {
|
|
|
36
38
|
if (subflow === undefined) {
|
|
37
39
|
return;
|
|
38
40
|
}
|
|
39
|
-
const subflowId = `${idPrefix}flow-${nodeId}
|
|
41
|
+
const subflowId = (0, mermaid_1.escapeId)(`${idPrefix}flow-${nodeId}`);
|
|
40
42
|
if (mermaid.simplified) {
|
|
41
43
|
// get parent
|
|
42
44
|
const idMap = mermaid.rootGraph.idMap;
|
|
43
45
|
const node = idMap?.get(nodeId);
|
|
44
|
-
const nodeLexeme = node?.info.fullLexeme ?? node?.lexeme ?? '
|
|
46
|
+
const nodeLexeme = node?.info.fullLexeme ?? node?.lexeme ?? 'function';
|
|
45
47
|
const location = node?.location?.[0] ? ` (L. ${node?.location?.[0]})` : '';
|
|
46
|
-
mermaid.nodeLines.push(`\nsubgraph "${subflowId}" ["${(0, mermaid_1.escapeMarkdown)(nodeLexeme
|
|
48
|
+
mermaid.nodeLines.push(`\nsubgraph "${subflowId}" ["${(0, mermaid_1.escapeMarkdown)(nodeLexeme)}${location}"]`);
|
|
47
49
|
}
|
|
48
50
|
else {
|
|
49
51
|
mermaid.nodeLines.push(`\nsubgraph "${subflowId}" [function ${nodeId}]`);
|
|
@@ -147,6 +149,7 @@ function printEnvironmentToLines(env) {
|
|
|
147
149
|
function vertexToMermaid(info, mermaid, id, idPrefix, mark) {
|
|
148
150
|
const fCall = info.tag === vertex_1.VertexType.FunctionCall;
|
|
149
151
|
const { open, close } = mermaidNodeBrackets(info.tag);
|
|
152
|
+
id = (0, mermaid_1.escapeId)(id);
|
|
150
153
|
if (info.environment && mermaid.includeEnvironments) {
|
|
151
154
|
if (info.environment.level > 0 || info.environment.current.memory.size !== 0) {
|
|
152
155
|
mermaid.nodeLines.push(` %% Environment of ${id} [level: ${info.environment.level}]:`, printEnvironmentToLines(info.environment.current).map(x => ` %% ${x}`).join('\n'));
|
|
@@ -162,24 +165,29 @@ function vertexToMermaid(info, mermaid, id, idPrefix, mark) {
|
|
|
162
165
|
else {
|
|
163
166
|
const escapedName = (0, mermaid_1.escapeMarkdown)(node ? `[${node.type}] ${lexeme}` : '??');
|
|
164
167
|
const deps = info.cds ? ', :may:' + info.cds.map(c => c.id + (c.when ? '+' : '-')).join(',') : '';
|
|
168
|
+
const lnks = info.link?.origin ? ', :links:' + info.link.origin.join(',') : '';
|
|
165
169
|
const n = node?.info.fullRange ?? node?.location ?? (node?.type === type_1.RType.ExpressionList ? node?.grouping?.[0].location : undefined);
|
|
166
|
-
mermaid.nodeLines.push(` ${idPrefix}${id}${open}"\`${escapedName}${escapedName.length > 10 ? '\n ' : ' '}(${id}${deps})\n *${formatRange(n)}*${fCall ? displayFunctionArgMapping(info.args) : ''}\`"${close}`);
|
|
170
|
+
mermaid.nodeLines.push(` ${idPrefix}${id}${open}"\`${escapedName}${escapedName.length > 10 ? '\n ' : ' '}(${id}${deps}${lnks})\n *${formatRange(n)}*${fCall ? displayFunctionArgMapping(info.args) : ''}\`"${close}`);
|
|
167
171
|
}
|
|
168
172
|
if (mark?.has(id)) {
|
|
169
173
|
mermaid.nodeLines.push(` style ${idPrefix}${id} ${mermaid.markStyle.vertex} `);
|
|
170
174
|
}
|
|
171
|
-
if (mermaid.rootGraph.unknownSideEffects.
|
|
175
|
+
if ([...mermaid.rootGraph.unknownSideEffects].some(l => (0, node_id_1.normalizeIdToNumberIfPossible)(l) === (0, node_id_1.normalizeIdToNumberIfPossible)(id))) {
|
|
172
176
|
mermaid.nodeLines.push(` style ${idPrefix}${id} stroke:red,stroke-width:5px; `);
|
|
173
177
|
}
|
|
174
|
-
const edges = mermaid.rootGraph.get(id, true);
|
|
178
|
+
const edges = mermaid.rootGraph.get((0, node_id_1.normalizeIdToNumberIfPossible)(id), true);
|
|
175
179
|
(0, assert_1.guard)(edges !== undefined, `node ${id} must be found`);
|
|
176
180
|
const artificialCdEdges = (info.cds ?? []).map(x => [x.id, { types: new Set([x.when ? 'CD-True' : 'CD-False']) }]);
|
|
177
|
-
|
|
181
|
+
// eslint-disable-next-line prefer-const
|
|
182
|
+
for (let [target, edge] of [...edges[1], ...artificialCdEdges]) {
|
|
183
|
+
const originalTarget = target;
|
|
184
|
+
target = (0, mermaid_1.escapeId)(target);
|
|
178
185
|
const edgeTypes = typeof edge.types == 'number' ? new Set((0, edge_1.splitEdgeTypes)(edge.types)) : edge.types;
|
|
179
186
|
const edgeId = encodeEdge(idPrefix + id, idPrefix + target, edgeTypes);
|
|
180
187
|
if (!mermaid.presentEdges.has(edgeId)) {
|
|
181
188
|
mermaid.presentEdges.add(edgeId);
|
|
182
|
-
|
|
189
|
+
const style = (0, built_in_1.isBuiltIn)(target) ? '-.->' : '-->';
|
|
190
|
+
mermaid.edgeLines.push(` ${idPrefix}${id} ${style}|"${[...edgeTypes].map(e => typeof e === 'number' ? (0, edge_1.edgeTypeToName)(e) : e).join(', ')}"| ${idPrefix}${target}`);
|
|
183
191
|
if (mermaid.mark?.has(id + '->' + target)) {
|
|
184
192
|
// who invented this syntax?!
|
|
185
193
|
mermaid.edgeLines.push(` linkStyle ${mermaid.presentEdges.size - 1} ${mermaid.markStyle.edge}`);
|
|
@@ -187,6 +195,14 @@ function vertexToMermaid(info, mermaid, id, idPrefix, mark) {
|
|
|
187
195
|
if (edgeTypes.has('CD-True') || edgeTypes.has('CD-False')) {
|
|
188
196
|
mermaid.edgeLines.push(` linkStyle ${mermaid.presentEdges.size - 1} stroke:gray,color:gray;`);
|
|
189
197
|
}
|
|
198
|
+
if ((0, built_in_1.isBuiltIn)(target)) {
|
|
199
|
+
mermaid.edgeLines.push(` linkStyle ${mermaid.presentEdges.size - 1} stroke:gray;`);
|
|
200
|
+
if (!mermaid.presentVertices.has(target)) {
|
|
201
|
+
mermaid.nodeLines.push(` ${idPrefix}${target}["\`Built-In:\n${(0, mermaid_1.escapeMarkdown)(String(originalTarget).replace('built-in:', ''))}\`"]`);
|
|
202
|
+
mermaid.nodeLines.push(` style ${idPrefix}${target} stroke:gray,fill:lightgray,stroke-width:2px,opacity:.8;`);
|
|
203
|
+
mermaid.presentVertices.add(target);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
190
206
|
}
|
|
191
207
|
}
|
|
192
208
|
if (info.tag === 'function-definition') {
|
|
@@ -195,7 +211,7 @@ function vertexToMermaid(info, mermaid, id, idPrefix, mark) {
|
|
|
195
211
|
}
|
|
196
212
|
// make the passing of root ids more performant again
|
|
197
213
|
function graphToMermaidGraph(rootIds, { simplified, graph, prefix = 'flowchart BT', idPrefix = '', includeEnvironments = !simplified, mark, rootGraph, presentEdges = new Set(), markStyle = { vertex: 'stroke:teal,stroke-width:7px,stroke-opacity:.8;', edge: 'stroke:teal,stroke-width:4.2px,stroke-opacity:.8' } }) {
|
|
198
|
-
const mermaid = { nodeLines: prefix === null ? [] : [prefix], edgeLines: [], presentEdges, mark, rootGraph: rootGraph ?? graph, includeEnvironments, markStyle, simplified };
|
|
214
|
+
const mermaid = { nodeLines: prefix === null ? [] : [prefix], edgeLines: [], presentEdges, presentVertices: new Set(), mark, rootGraph: rootGraph ?? graph, includeEnvironments, markStyle, simplified };
|
|
199
215
|
for (const [id, info] of graph.vertices(true)) {
|
|
200
216
|
if (rootIds.has(id)) {
|
|
201
217
|
vertexToMermaid(info, mermaid, id, idPrefix, mark);
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
export declare function escapeMarkdown(text: string): string;
|
|
2
|
+
export declare function escapeId(text: string | number): string;
|
|
2
3
|
/**
|
|
3
4
|
* Converts mermaid code (potentially produced by {@link graphToMermaid}) to an url that presents the graph in the mermaid editor.
|
|
4
5
|
*
|
|
5
6
|
* @param code - code to convert
|
|
7
|
+
* @param edit - if true, the url will point to the editor, otherwise it will point to the viewer
|
|
6
8
|
*/
|
|
7
9
|
export declare function mermaidCodeToUrl(code: string, edit?: boolean): string;
|
package/util/mermaid/mermaid.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.escapeMarkdown = escapeMarkdown;
|
|
4
|
+
exports.escapeId = escapeId;
|
|
4
5
|
exports.mermaidCodeToUrl = mermaidCodeToUrl;
|
|
5
6
|
const replacements = {
|
|
6
7
|
// keep newlines
|
|
@@ -45,10 +46,15 @@ function escapeMarkdown(text) {
|
|
|
45
46
|
}
|
|
46
47
|
return text;
|
|
47
48
|
}
|
|
49
|
+
function escapeId(text) {
|
|
50
|
+
text = String(text).replace(/[^a-zA-Z0-9:-]/g, '_');
|
|
51
|
+
return text;
|
|
52
|
+
}
|
|
48
53
|
/**
|
|
49
54
|
* Converts mermaid code (potentially produced by {@link graphToMermaid}) to an url that presents the graph in the mermaid editor.
|
|
50
55
|
*
|
|
51
56
|
* @param code - code to convert
|
|
57
|
+
* @param edit - if true, the url will point to the editor, otherwise it will point to the viewer
|
|
52
58
|
*/
|
|
53
59
|
function mermaidCodeToUrl(code, edit = false) {
|
|
54
60
|
const obj = {
|
package/util/quads.js
CHANGED
|
@@ -19,7 +19,7 @@ const namedNode = (v) => n3_1.DataFactory.namedNode(v);
|
|
|
19
19
|
const quad = (s, p, o, g) => n3_1.DataFactory.quad(s, p, o, g);
|
|
20
20
|
const objects_1 = require("./objects");
|
|
21
21
|
const assert_1 = require("./assert");
|
|
22
|
-
const defaultmap_1 = require("./defaultmap");
|
|
22
|
+
const defaultmap_1 = require("./collections/defaultmap");
|
|
23
23
|
const literal = (v, n) => n3_1.DataFactory.literal(v, n);
|
|
24
24
|
const log_1 = require("./log");
|
|
25
25
|
const domain = 'https://uni-ulm.de/r-ast/';
|
package/util/schema.d.ts
CHANGED
package/util/schema.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.describeSchema = describeSchema;
|
|
|
4
4
|
exports.genericDescription = genericDescription;
|
|
5
5
|
exports.headerLine = headerLine;
|
|
6
6
|
exports.describeObject = describeObject;
|
|
7
|
-
const ansi_1 = require("./ansi");
|
|
7
|
+
const ansi_1 = require("./text/ansi");
|
|
8
8
|
function describeSchema(schema, f = ansi_1.formatter) {
|
|
9
9
|
const description = schema.describe();
|
|
10
10
|
const lines = genericDescription(1, f, f.format('.', { effect: ansi_1.ColorEffect.Foreground, color: 7 /* Colors.White */ }), description);
|
package/util/summarizer.js
CHANGED
|
@@ -4,7 +4,7 @@ exports.Summarizer = void 0;
|
|
|
4
4
|
exports.summarizedMeasurement2Csv = summarizedMeasurement2Csv;
|
|
5
5
|
exports.summarizedMeasurement2CsvHeader = summarizedMeasurement2CsvHeader;
|
|
6
6
|
exports.summarizeMeasurement = summarizeMeasurement;
|
|
7
|
-
const arrays_1 = require("./arrays");
|
|
7
|
+
const arrays_1 = require("./collections/arrays");
|
|
8
8
|
class Summarizer {
|
|
9
9
|
config;
|
|
10
10
|
log;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.nth = nth;
|
|
4
|
-
const assert_1 = require("
|
|
4
|
+
const assert_1 = require("../assert");
|
|
5
5
|
function nth(n) {
|
|
6
6
|
(0, assert_1.guard)(isFinite(n) && n >= 1, 'n must be a non-negative number');
|
|
7
7
|
const num = String(n);
|
|
@@ -13,7 +13,7 @@ function date2string(date = new Date()) {
|
|
|
13
13
|
/**
|
|
14
14
|
* Print a number of milliseconds in a human-readable format including correct spacing.
|
|
15
15
|
*/
|
|
16
|
-
function printAsMs(ms, precision =
|
|
16
|
+
function printAsMs(ms, precision = 1) {
|
|
17
17
|
/* eslint-disable-next-line no-irregular-whitespace*/
|
|
18
18
|
return `${ms.toFixed(precision)} ms`;
|
|
19
19
|
}
|
package/util/version.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.flowrVersion = flowrVersion;
|
|
4
4
|
const semver_1 = require("semver");
|
|
5
5
|
// this is automatically replaced with the current version by release-it
|
|
6
|
-
const version = '2.2.
|
|
6
|
+
const version = '2.2.13';
|
|
7
7
|
function flowrVersion() {
|
|
8
8
|
return new semver_1.SemVer(version);
|
|
9
9
|
}
|
package/dataflow/graph/diff.d.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import type { DataflowGraph, FunctionArgument, OutgoingEdges } from './graph';
|
|
2
|
-
import type { GenericDiffConfiguration, GenericDifferenceInformation, WriteableDifferenceReport } from '../../util/diff';
|
|
3
|
-
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
4
|
-
interface ProblematicVertex {
|
|
5
|
-
tag: 'vertex';
|
|
6
|
-
id: NodeId;
|
|
7
|
-
}
|
|
8
|
-
interface ProblematicEdge {
|
|
9
|
-
tag: 'edge';
|
|
10
|
-
from: NodeId;
|
|
11
|
-
to: NodeId;
|
|
12
|
-
}
|
|
13
|
-
export type ProblematicDiffInfo = ProblematicVertex | ProblematicEdge;
|
|
14
|
-
export declare class DataflowDifferenceReport implements WriteableDifferenceReport {
|
|
15
|
-
_comments: string[] | undefined;
|
|
16
|
-
_problematic: ProblematicDiffInfo[] | undefined;
|
|
17
|
-
addComment(comment: string, ...related: readonly ProblematicDiffInfo[]): void;
|
|
18
|
-
comments(): readonly string[] | undefined;
|
|
19
|
-
problematic(): readonly ProblematicDiffInfo[] | undefined;
|
|
20
|
-
isEqual(): boolean;
|
|
21
|
-
}
|
|
22
|
-
export interface NamedGraph {
|
|
23
|
-
name: string;
|
|
24
|
-
graph: DataflowGraph;
|
|
25
|
-
}
|
|
26
|
-
interface DataflowDiffContext extends GenericDifferenceInformation<DataflowDifferenceReport> {
|
|
27
|
-
left: DataflowGraph;
|
|
28
|
-
right: DataflowGraph;
|
|
29
|
-
config: GenericDiffConfiguration;
|
|
30
|
-
}
|
|
31
|
-
export declare function diffOfDataflowGraphs(left: NamedGraph, right: NamedGraph, config?: Partial<GenericDiffConfiguration>): DataflowDifferenceReport;
|
|
32
|
-
export declare function equalFunctionArguments(fn: NodeId, a: false | readonly FunctionArgument[], b: false | readonly FunctionArgument[]): boolean;
|
|
33
|
-
export declare function diffFunctionArguments(fn: NodeId, a: false | readonly FunctionArgument[], b: false | readonly FunctionArgument[], ctx: GenericDifferenceInformation<DataflowDifferenceReport>): void;
|
|
34
|
-
export declare function diffVertices(ctx: DataflowDiffContext): void;
|
|
35
|
-
export declare function diffEdges(ctx: DataflowDiffContext, id: NodeId, lEdges: OutgoingEdges | undefined, rEdges: OutgoingEdges | undefined): void;
|
|
36
|
-
export {};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { ControlFlowGraph } from './cfg';
|
|
2
|
-
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
|
-
import { Ternary } from '../logic';
|
|
4
|
-
/**
|
|
5
|
-
* Determines if node `a` happens before node `b` in the control flow graph.
|
|
6
|
-
*/
|
|
7
|
-
export declare function happensBefore(cfg: ControlFlowGraph, a: NodeId, b: NodeId): Ternary;
|
package/util/cfg/visitor.d.ts
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { ControlFlowGraph } from './cfg';
|
|
2
|
-
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
|
-
/**
|
|
4
|
-
* Visit all nodes reachable from the start node in the control flow graph, traversing the dependencies but ignoring cycles.
|
|
5
|
-
* @param graph - The control flow graph.
|
|
6
|
-
* @param startNode - The node to start the traversal from.
|
|
7
|
-
* @param visitor - The visitor function to call for each node, if you return true the traversal from this node will be stopped.
|
|
8
|
-
*/
|
|
9
|
-
export declare function visitCfgInReverseOrder(graph: ControlFlowGraph, startNode: NodeId, visitor: (node: NodeId) => boolean | void): void;
|
package/util/cfg/visitor.js
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.visitCfgInReverseOrder = visitCfgInReverseOrder;
|
|
4
|
-
/**
|
|
5
|
-
* Visit all nodes reachable from the start node in the control flow graph, traversing the dependencies but ignoring cycles.
|
|
6
|
-
* @param graph - The control flow graph.
|
|
7
|
-
* @param startNode - The node to start the traversal from.
|
|
8
|
-
* @param visitor - The visitor function to call for each node, if you return true the traversal from this node will be stopped.
|
|
9
|
-
*/
|
|
10
|
-
function visitCfgInReverseOrder(graph, startNode,
|
|
11
|
-
// eslint-disable-next-line @typescript-eslint/no-invalid-void-type -- void is used to indicate that the return value is ignored/we never stop
|
|
12
|
-
visitor) {
|
|
13
|
-
const visited = new Set();
|
|
14
|
-
const queue = [startNode];
|
|
15
|
-
while (queue.length > 0) {
|
|
16
|
-
const current = queue.pop();
|
|
17
|
-
if (visited.has(current)) {
|
|
18
|
-
continue;
|
|
19
|
-
}
|
|
20
|
-
visited.add(current);
|
|
21
|
-
if (visitor(current)) {
|
|
22
|
-
continue;
|
|
23
|
-
}
|
|
24
|
-
const incoming = graph.outgoing(current) ?? [];
|
|
25
|
-
for (const [from] of incoming) {
|
|
26
|
-
queue.push(from);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
//# sourceMappingURL=visitor.js.map
|
package/util/set.js
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setEquals = setEquals;
|
|
4
|
-
exports.setMinus = setMinus;
|
|
5
|
-
/**
|
|
6
|
-
* Given both sets, this checks if they contain the same elements.
|
|
7
|
-
*/
|
|
8
|
-
function setEquals(a, b) {
|
|
9
|
-
if (a.size !== b.size) {
|
|
10
|
-
return false;
|
|
11
|
-
}
|
|
12
|
-
for (const item of a) {
|
|
13
|
-
if (!b.has(item)) {
|
|
14
|
-
return false;
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
return true;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* Returns `A – B`
|
|
21
|
-
*/
|
|
22
|
-
function setMinus(a, b) {
|
|
23
|
-
const result = new Set();
|
|
24
|
-
for (const item of a) {
|
|
25
|
-
if (!b.has(item)) {
|
|
26
|
-
result.add(item);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
return result;
|
|
30
|
-
}
|
|
31
|
-
//# sourceMappingURL=set.js.map
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|