@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
package/README.md
CHANGED
|
@@ -4,9 +4,12 @@
|
|
|
4
4
|
[](https://hub.docker.com/r/eagleoutice/flowr)
|
|
5
5
|
[](https://github.com/flowr-analysis/flowr/releases/latest)
|
|
6
6
|
[](https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr)
|
|
7
|
+
[](https://open-vsx.org/extension/code-inspect/vscode-flowr)
|
|
7
8
|
[](https://zenodo.org/doi/10.5281/zenodo.13319290)
|
|
8
9
|
|
|
9
|
-
_flowR_ is a sophisticated, static [dataflow analyzer](https://en.wikipedia.org/wiki/Data-flow_analysis) for the [R programming language](https://www.r-project.org/)
|
|
10
|
+
_flowR_ is a sophisticated, static [dataflow analyzer](https://en.wikipedia.org/wiki/Data-flow_analysis) for the [R programming language](https://www.r-project.org/),
|
|
11
|
+
available for [VSCode](https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr), [Positron](https://open-vsx.org/extension/code-inspect/vscode-flowr), [RStudio](https://github.com/flowr-analysis/rstudio-addin-flowr),
|
|
12
|
+
and [Docker](https://hub.docker.com/r/eagleoutice/flowr).
|
|
10
13
|
It offers a wide variety of features, for example:
|
|
11
14
|
|
|
12
15
|
* 🍕 **program slicing**\
|
|
@@ -48,7 +51,7 @@ It offers a wide variety of features, for example:
|
|
|
48
51
|
|
|
49
52
|
```shell
|
|
50
53
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
51
|
-
flowR repl using flowR v2.2.
|
|
54
|
+
flowR repl using flowR v2.2.12, R v4.4.3 (r-shell engine)
|
|
52
55
|
R> :slicer test/testfiles/example.R --criterion "11@sum"
|
|
53
56
|
```
|
|
54
57
|
|
|
@@ -95,7 +98,7 @@ It offers a wide variety of features, for example:
|
|
|
95
98
|
|
|
96
99
|
|
|
97
100
|
* 🚀 **fast data- and control-flow graphs**\
|
|
98
|
-
Within just <i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
101
|
+
Within just <i><span title="This measurement is automatically fetched from the latest benchmark!">124.8 ms</span></i> (as of Mar 17, 2025),
|
|
99
102
|
_flowR_ can analyze the data- and control-flow of the average real-world R script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
|
|
100
103
|
and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) for more details on the dataflow graph.
|
|
101
104
|
|
|
@@ -104,7 +107,7 @@ It offers a wide variety of features, for example:
|
|
|
104
107
|
|
|
105
108
|
|
|
106
109
|
You can investigate flowR's analyses using the [REPL](https://github.com/flowr-analysis/flowr/wiki/Interface#using-the-repl).
|
|
107
|
-
Commands like <span title="Description (Repl Command, starred version): Returns the URL to mermaid.live; Base Command: Get mermaid code for the dataflow graph
|
|
110
|
+
Commands like <span title="Description (Repl Command, starred version): Returns the URL to mermaid.live; Base Command: Get mermaid code for the dataflow graph, start with 'file://' to indicate a file (aliases: :d*, :df*)">`:dataflow*`</span> allow you to view a dataflow graph for a given R script.
|
|
108
111
|
|
|
109
112
|
Let's have a look at the following example:
|
|
110
113
|
|
|
@@ -131,7 +134,7 @@ It offers a wide variety of features, for example:
|
|
|
131
134
|
|
|
132
135
|
```shell
|
|
133
136
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
134
|
-
flowR repl using flowR v2.2.
|
|
137
|
+
flowR repl using flowR v2.2.12, R v4.4.3 (r-shell engine)
|
|
135
138
|
R> :dataflow* test/testfiles/example.R
|
|
136
139
|
```
|
|
137
140
|
|
|
@@ -140,7 +143,7 @@ It offers a wide variety of features, for example:
|
|
|
140
143
|
|
|
141
144
|
|
|
142
145
|
```text
|
|
143
|
-
https://mermaid.live/view#base64:
|
|
146
|
+
https://mermaid.live/view#base64:eyJjb2RlIjoiZmxvd2NoYXJ0IEJUXG4gICAgMChbXCJgIzkxO1JTeW1ib2wjOTM7IHRlc3RcbiAgICAgICgwKVxuICAgICAgKjEuMS00KmBcIl0pXG4gICAgMShbXCJgIzkxO1JTeW1ib2wjOTM7IHRlc3RmaWxlc1xuICAgICAgKDEpXG4gICAgICAqMS42LTE0KmBcIl0pXG4gICAgMltbXCJgIzkxO1JCaW5hcnlPcCM5MzsgL1xuICAgICAgKDIpXG4gICAgICAqMS4xLTE0KlxuICAgICgwLCAxKWBcIl1dXG4gICAgYnVpbHQtaW46X1tcImBCdWlsdC1Jbjpcbi9gXCJdXG4gICAgc3R5bGUgYnVpbHQtaW46XyBzdHJva2U6Z3JheSxmaWxsOmxpZ2h0Z3JheSxzdHJva2Utd2lkdGg6MnB4LG9wYWNpdHk6Ljg7XG4gICAgMyhbXCJgIzkxO1JTeW1ib2wjOTM7IGV4YW1wbGUuUlxuICAgICAgKDMpXG4gICAgICAqMS4xNi0yNCpgXCJdKVxuICAgIDRbW1wiYCM5MTtSQmluYXJ5T3AjOTM7IC9cbiAgICAgICg0KVxuICAgICAgKjEuMS0yNCpcbiAgICAoMiwgMylgXCJdXVxuICAgIDIgLS0+fFwicmVhZHMsIGFyZ3VtZW50XCJ8IDBcbiAgICAyIC0tPnxcInJlYWRzLCBhcmd1bWVudFwifCAxXG4gICAgMiAtLi0+fFwicmVhZHMsIGNhbGxzXCJ8IGJ1aWx0LWluOl9cbiAgICBsaW5rU3R5bGUgMiBzdHJva2U6Z3JheTtcbiAgICA0IC0tPnxcInJlYWRzLCBhcmd1bWVudFwifCAyXG4gICAgNCAtLT58XCJyZWFkcywgYXJndW1lbnRcInwgM1xuICAgIDQgLS4tPnxcInJlYWRzLCBjYWxsc1wifCBidWlsdC1pbjpfXG4gICAgbGlua1N0eWxlIDUgc3Ryb2tlOmdyYXk7IiwibWVybWFpZCI6eyJhdXRvU3luYyI6dHJ1ZX19
|
|
144
147
|
```
|
|
145
148
|
|
|
146
149
|
|
|
@@ -162,6 +165,9 @@ It offers a wide variety of features, for example:
|
|
|
162
165
|
(2)
|
|
163
166
|
*1.1-8*
|
|
164
167
|
(0, 1)`"]]
|
|
168
|
+
built-in:_-["`Built-In:
|
|
169
|
+
#60;#45;`"]
|
|
170
|
+
style built-in:_- stroke:gray,fill:lightgray,stroke-width:2px,opacity:.8;
|
|
165
171
|
4{{"`#91;RNumber#93; 1
|
|
166
172
|
(4)
|
|
167
173
|
*2.12*`"}}
|
|
@@ -208,14 +214,23 @@ It offers a wide variety of features, for example:
|
|
|
208
214
|
(18)
|
|
209
215
|
*6.14-16*
|
|
210
216
|
(16, 17)`"]]
|
|
217
|
+
built-in:-["`Built-In:
|
|
218
|
+
#45;`"]
|
|
219
|
+
style built-in:- stroke:gray,fill:lightgray,stroke-width:2px,opacity:.8;
|
|
211
220
|
19[["`#91;RExpressionList#93; (
|
|
212
221
|
(19)
|
|
213
222
|
*6.13*
|
|
214
223
|
(18)`"]]
|
|
224
|
+
built-in:_["`Built-In:
|
|
225
|
+
(`"]
|
|
226
|
+
style built-in:_ stroke:gray,fill:lightgray,stroke-width:2px,opacity:.8;
|
|
215
227
|
20[["`#91;RBinaryOp#93; #58;
|
|
216
228
|
(20)
|
|
217
229
|
*6.11-17*
|
|
218
230
|
(13, 19)`"]]
|
|
231
|
+
built-in::["`Built-In:
|
|
232
|
+
#58;`"]
|
|
233
|
+
style built-in:: stroke:gray,fill:lightgray,stroke-width:2px,opacity:.8;
|
|
219
234
|
24(["`#91;RSymbol#93; sum
|
|
220
235
|
(24, :may:36+)
|
|
221
236
|
*7.10-12*`"])
|
|
@@ -265,12 +280,18 @@ It offers a wide variety of features, for example:
|
|
|
265
280
|
(36)
|
|
266
281
|
*6.1-9.1*
|
|
267
282
|
(12, 20, 35)`"]]
|
|
283
|
+
built-in:for["`Built-In:
|
|
284
|
+
for`"]
|
|
285
|
+
style built-in:for stroke:gray,fill:lightgray,stroke-width:2px,opacity:.8;
|
|
268
286
|
38{{"`#91;RString#93; #34;Sum#58;#34;
|
|
269
287
|
(38)
|
|
270
288
|
*11.5-10*`"}}
|
|
271
289
|
40(["`#91;RSymbol#93; sum
|
|
272
290
|
(40)
|
|
273
291
|
*11.13-15*`"])
|
|
292
|
+
built-in:sum["`Built-In:
|
|
293
|
+
sum`"]
|
|
294
|
+
style built-in:sum stroke:gray,fill:lightgray,stroke-width:2px,opacity:.8;
|
|
274
295
|
42{{"`#91;RString#93; #34;
|
|
275
296
|
#34;
|
|
276
297
|
(42)
|
|
@@ -279,6 +300,9 @@ It offers a wide variety of features, for example:
|
|
|
279
300
|
(44)
|
|
280
301
|
*11.1-22*
|
|
281
302
|
(38, 40, 42)`"]]
|
|
303
|
+
built-in:cat["`Built-In:
|
|
304
|
+
cat`"]
|
|
305
|
+
style built-in:cat stroke:gray,fill:lightgray,stroke-width:2px,opacity:.8;
|
|
282
306
|
46{{"`#91;RString#93; #34;Product#58;#34;
|
|
283
307
|
(46)
|
|
284
308
|
*12.5-14*`"}}
|
|
@@ -297,87 +321,121 @@ It offers a wide variety of features, for example:
|
|
|
297
321
|
0 -->|"defined-by"| 2
|
|
298
322
|
2 -->|"argument"| 1
|
|
299
323
|
2 -->|"returns, argument"| 0
|
|
324
|
+
2 -.->|"reads, calls"| built-in:_-
|
|
325
|
+
linkStyle 4 stroke:gray;
|
|
300
326
|
3 -->|"defined-by"| 4
|
|
301
327
|
3 -->|"defined-by"| 5
|
|
302
328
|
5 -->|"argument"| 4
|
|
303
329
|
5 -->|"returns, argument"| 3
|
|
330
|
+
5 -.->|"reads, calls"| built-in:_-
|
|
331
|
+
linkStyle 9 stroke:gray;
|
|
304
332
|
6 -->|"defined-by"| 7
|
|
305
333
|
6 -->|"defined-by"| 8
|
|
306
334
|
8 -->|"argument"| 7
|
|
307
335
|
8 -->|"returns, argument"| 6
|
|
336
|
+
8 -.->|"reads, calls"| built-in:_-
|
|
337
|
+
linkStyle 14 stroke:gray;
|
|
308
338
|
9 -->|"defined-by"| 10
|
|
309
339
|
9 -->|"defined-by"| 11
|
|
310
340
|
11 -->|"argument"| 10
|
|
311
341
|
11 -->|"returns, argument"| 9
|
|
342
|
+
11 -.->|"reads, calls"| built-in:_-
|
|
343
|
+
linkStyle 19 stroke:gray;
|
|
312
344
|
12 -->|"defined-by"| 20
|
|
313
345
|
16 -->|"reads"| 9
|
|
314
346
|
18 -->|"reads, argument"| 16
|
|
315
347
|
18 -->|"reads, argument"| 17
|
|
348
|
+
18 -.->|"reads, calls"| built-in:-
|
|
349
|
+
linkStyle 24 stroke:gray;
|
|
316
350
|
19 -->|"returns, argument"| 18
|
|
351
|
+
19 -.->|"reads"| built-in:_
|
|
352
|
+
linkStyle 26 stroke:gray;
|
|
317
353
|
20 -->|"reads, argument"| 13
|
|
318
354
|
20 -->|"reads, argument"| 19
|
|
355
|
+
20 -.->|"reads, calls"| built-in::
|
|
356
|
+
linkStyle 29 stroke:gray;
|
|
319
357
|
24 -->|"reads"| 0
|
|
320
358
|
24 -->|"reads"| 23
|
|
321
359
|
24 -->|"CD-True"| 36
|
|
322
|
-
linkStyle
|
|
360
|
+
linkStyle 32 stroke:gray,color:gray;
|
|
323
361
|
25 -->|"reads"| 12
|
|
324
362
|
25 -->|"CD-True"| 36
|
|
325
|
-
linkStyle
|
|
363
|
+
linkStyle 34 stroke:gray,color:gray;
|
|
326
364
|
26 -->|"reads, argument"| 24
|
|
327
365
|
26 -->|"reads, argument"| 25
|
|
366
|
+
26 -.->|"reads, calls"| built-in:_
|
|
367
|
+
linkStyle 37 stroke:gray;
|
|
328
368
|
26 -->|"CD-True"| 36
|
|
329
|
-
linkStyle
|
|
369
|
+
linkStyle 38 stroke:gray,color:gray;
|
|
330
370
|
27 -->|"reads"| 6
|
|
331
371
|
27 -->|"CD-True"| 36
|
|
332
|
-
linkStyle
|
|
372
|
+
linkStyle 40 stroke:gray,color:gray;
|
|
333
373
|
28 -->|"reads, argument"| 26
|
|
334
374
|
28 -->|"reads, argument"| 27
|
|
375
|
+
28 -.->|"reads, calls"| built-in:_
|
|
376
|
+
linkStyle 43 stroke:gray;
|
|
335
377
|
28 -->|"CD-True"| 36
|
|
336
|
-
linkStyle
|
|
378
|
+
linkStyle 44 stroke:gray,color:gray;
|
|
337
379
|
23 -->|"defined-by"| 28
|
|
338
380
|
23 -->|"defined-by"| 29
|
|
339
381
|
29 -->|"argument"| 28
|
|
340
382
|
29 -->|"returns, argument"| 23
|
|
383
|
+
29 -.->|"reads, calls"| built-in:_-
|
|
384
|
+
linkStyle 49 stroke:gray;
|
|
341
385
|
29 -->|"CD-True"| 36
|
|
342
|
-
linkStyle
|
|
386
|
+
linkStyle 50 stroke:gray,color:gray;
|
|
343
387
|
31 -->|"reads"| 3
|
|
344
388
|
31 -->|"reads"| 30
|
|
345
389
|
31 -->|"CD-True"| 36
|
|
346
|
-
linkStyle
|
|
390
|
+
linkStyle 53 stroke:gray,color:gray;
|
|
347
391
|
32 -->|"reads"| 12
|
|
348
392
|
32 -->|"CD-True"| 36
|
|
349
|
-
linkStyle
|
|
393
|
+
linkStyle 55 stroke:gray,color:gray;
|
|
350
394
|
33 -->|"reads, argument"| 31
|
|
351
395
|
33 -->|"reads, argument"| 32
|
|
396
|
+
33 -.->|"reads, calls"| built-in:_
|
|
397
|
+
linkStyle 58 stroke:gray;
|
|
352
398
|
33 -->|"CD-True"| 36
|
|
353
|
-
linkStyle
|
|
399
|
+
linkStyle 59 stroke:gray,color:gray;
|
|
354
400
|
30 -->|"defined-by"| 33
|
|
355
401
|
30 -->|"defined-by"| 34
|
|
356
402
|
34 -->|"argument"| 33
|
|
357
403
|
34 -->|"returns, argument"| 30
|
|
404
|
+
34 -.->|"reads, calls"| built-in:_-
|
|
405
|
+
linkStyle 64 stroke:gray;
|
|
358
406
|
34 -->|"CD-True"| 36
|
|
359
|
-
linkStyle
|
|
407
|
+
linkStyle 65 stroke:gray,color:gray;
|
|
360
408
|
35 -->|"argument"| 29
|
|
361
409
|
35 -->|"returns, argument"| 34
|
|
410
|
+
35 -.->|"reads, calls"| built-in:_
|
|
411
|
+
linkStyle 68 stroke:gray;
|
|
362
412
|
35 -->|"CD-True"| 36
|
|
363
|
-
linkStyle
|
|
413
|
+
linkStyle 69 stroke:gray,color:gray;
|
|
364
414
|
36 -->|"reads, argument"| 12
|
|
365
415
|
36 -->|"reads, argument"| 20
|
|
366
416
|
36 -->|"argument, non-standard-evaluation"| 35
|
|
417
|
+
36 -.->|"reads, calls"| built-in:for
|
|
418
|
+
linkStyle 73 stroke:gray;
|
|
367
419
|
40 -->|"reads"| 0
|
|
368
420
|
40 -->|"reads"| 23
|
|
421
|
+
40 -.->|"reads"| built-in:sum
|
|
422
|
+
linkStyle 76 stroke:gray;
|
|
369
423
|
44 -->|"argument"| 38
|
|
370
424
|
44 -->|"reads, argument"| 40
|
|
371
425
|
44 -->|"argument"| 42
|
|
426
|
+
44 -.->|"reads, calls"| built-in:cat
|
|
427
|
+
linkStyle 80 stroke:gray;
|
|
372
428
|
48 -->|"reads"| 3
|
|
373
429
|
48 -->|"reads"| 30
|
|
374
430
|
52 -->|"argument"| 46
|
|
375
431
|
52 -->|"reads, argument"| 48
|
|
376
432
|
52 -->|"argument"| 50
|
|
433
|
+
52 -.->|"reads, calls"| built-in:cat
|
|
434
|
+
linkStyle 86 stroke:gray;
|
|
377
435
|
```
|
|
378
436
|
|
|
379
437
|
|
|
380
|
-
(The analysis required _22.
|
|
438
|
+
(The analysis required _22.6 ms_ (including parse and normalize, using the [r-shell](https://github.com/flowr-analysis/flowr/wiki/Engines) engine) within the generation environment.)
|
|
381
439
|
|
|
382
440
|
|
|
383
441
|
|
|
@@ -392,12 +450,16 @@ It offers a wide variety of features, for example:
|
|
|
392
450
|
|
|
393
451
|
If you want to use flowR and the features it provides, feel free to check out the:
|
|
394
452
|
|
|
395
|
-
- [Visual Studio Code
|
|
453
|
+
- [Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr)/[Positron](https://open-vsx.org/extension/code-inspect/vscode-flowr): provides access to flowR directly in VS Code and Positron (or [vscode.dev](https://vscode.dev/))
|
|
396
454
|
- [RStudio Addin](https://github.com/flowr-analysis/rstudio-addin-flowr): integrates flowR into [RStudio](https://posit.co/downloads/)
|
|
397
455
|
- [R package](https://github.com/flowr-analysis/flowr-r-adapter): use flowR in your R scripts
|
|
398
456
|
- [Docker image](https://hub.docker.com/r/eagleoutice/flowr): run flowR in a container, this also includes [flowR's server](https://github.com/flowr-analysis/flowr/wiki/Interface#communicating-with-the-server)
|
|
399
457
|
- [NPM package](https://www.npmjs.com/package/@eagleoutice/flowr): include flowR in your TypeScript and JavaScript projects
|
|
400
458
|
|
|
459
|
+
|
|
460
|
+
If you are already using flowR and want to give feedback, please consider filling out our [feedback form](https://docs.google.com/forms/d/e/1FAIpQLScKFhgnh9LGVU7QzqLvFwZe1oiv_5jNhkIO-G-zND0ppqsMxQ/viewform).
|
|
461
|
+
|
|
462
|
+
|
|
401
463
|
## ⭐ Getting Started
|
|
402
464
|
|
|
403
465
|
To get started with _flowR_ and its features, please check out the [Overview](https://github.com/flowr-analysis/flowr/wiki/Overview) wiki page.
|
|
@@ -427,7 +489,7 @@ as well as the deployed [code documentation](https://flowr-analysis.github.io/fl
|
|
|
427
489
|
|
|
428
490
|
## 🚀 Contributing
|
|
429
491
|
|
|
430
|
-
We welcome every contribution! Please check out the [
|
|
492
|
+
We welcome every contribution! Please check out the [developer onboarding](https://github.com/flowr-analysis/flowr/wiki/Onboarding) section in the wiki for all the information you will need.
|
|
431
493
|
|
|
432
494
|
### Contributors
|
|
433
495
|
|
package/benchmark/slicer.js
CHANGED
|
@@ -12,7 +12,7 @@ const stopwatch_1 = require("./stopwatch");
|
|
|
12
12
|
const fs_1 = __importDefault(require("fs"));
|
|
13
13
|
const log_1 = require("../util/log");
|
|
14
14
|
const assert_1 = require("../util/assert");
|
|
15
|
-
const strings_1 = require("../util/strings");
|
|
15
|
+
const strings_1 = require("../util/text/strings");
|
|
16
16
|
const default_pipelines_1 = require("../core/steps/pipeline/default-pipelines");
|
|
17
17
|
const retriever_1 = require("../r-bridge/retriever");
|
|
18
18
|
const collect_all_1 = require("../slicing/criterion/collect-all");
|
|
@@ -23,7 +23,7 @@ const shell_1 = require("../r-bridge/shell");
|
|
|
23
23
|
const tree_sitter_types_1 = require("../r-bridge/lang-4.x/tree-sitter/tree-sitter-types");
|
|
24
24
|
const tree_sitter_executor_1 = require("../r-bridge/lang-4.x/tree-sitter/tree-sitter-executor");
|
|
25
25
|
const vertex_1 = require("../dataflow/graph/vertex");
|
|
26
|
-
const arrays_1 = require("../util/arrays");
|
|
26
|
+
const arrays_1 = require("../util/collections/arrays");
|
|
27
27
|
/**
|
|
28
28
|
* The logger to be used for benchmarking as a global object.
|
|
29
29
|
*/
|
|
@@ -9,7 +9,7 @@ const fs_1 = __importDefault(require("fs"));
|
|
|
9
9
|
const process_1 = require("../second-phase/process");
|
|
10
10
|
const process_2 = require("./process");
|
|
11
11
|
const assert_1 = require("../../../util/assert");
|
|
12
|
-
const ansi_1 = require("../../../util/ansi");
|
|
12
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
13
13
|
const json_1 = require("../../../util/json");
|
|
14
14
|
const print_1 = require("../../stats/print");
|
|
15
15
|
async function processRunMeasurement(line, fileNum, lineNum, textOutputAppendPath, rawOutputPath) {
|
|
@@ -43,16 +43,16 @@ exports.summarizeSummarizedTimePerToken = summarizeSummarizedTimePerToken;
|
|
|
43
43
|
exports.summarizeTimePerToken = summarizeTimePerToken;
|
|
44
44
|
const tmp = __importStar(require("tmp"));
|
|
45
45
|
const fs_1 = __importDefault(require("fs"));
|
|
46
|
-
const defaultmap_1 = require("../../../util/defaultmap");
|
|
46
|
+
const defaultmap_1 = require("../../../util/collections/defaultmap");
|
|
47
47
|
const log_1 = require("../../../util/log");
|
|
48
|
-
const strings_1 = require("../../../util/strings");
|
|
48
|
+
const strings_1 = require("../../../util/text/strings");
|
|
49
49
|
const summarizer_1 = require("../../../util/summarizer");
|
|
50
50
|
const assert_1 = require("../../../util/assert");
|
|
51
51
|
const shell_1 = require("../../../r-bridge/shell");
|
|
52
52
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
53
53
|
const visitor_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
54
54
|
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
55
|
-
const arrays_1 = require("../../../util/arrays");
|
|
55
|
+
const arrays_1 = require("../../../util/collections/arrays");
|
|
56
56
|
const tempfile = (() => {
|
|
57
57
|
let _tempfile = undefined;
|
|
58
58
|
return () => {
|
|
@@ -5,7 +5,7 @@ exports.summarizeAllUltimateStats = summarizeAllUltimateStats;
|
|
|
5
5
|
exports.processNextSummary = processNextSummary;
|
|
6
6
|
exports.processNextUltimateSummary = processNextUltimateSummary;
|
|
7
7
|
const process_1 = require("../first-phase/process");
|
|
8
|
-
const defaultmap_1 = require("../../../util/defaultmap");
|
|
8
|
+
const defaultmap_1 = require("../../../util/collections/defaultmap");
|
|
9
9
|
const summarizer_1 = require("../../../util/summarizer");
|
|
10
10
|
const assert_1 = require("../../../util/assert");
|
|
11
11
|
const stats_1 = require("../../stats/stats");
|
|
@@ -13,7 +13,7 @@ const summarizer_1 = require("../../util/summarizer");
|
|
|
13
13
|
const files_1 = require("../../util/files");
|
|
14
14
|
const json_1 = require("../../util/json");
|
|
15
15
|
const print_1 = require("../stats/print");
|
|
16
|
-
const defaultmap_1 = require("../../util/defaultmap");
|
|
16
|
+
const defaultmap_1 = require("../../util/collections/defaultmap");
|
|
17
17
|
const log_1 = require("../../util/log");
|
|
18
18
|
class BenchmarkSummarizer extends summarizer_1.Summarizer {
|
|
19
19
|
constructor(config) {
|
package/cli/common/options.js
CHANGED
|
@@ -5,10 +5,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.summarizerOptions = exports.statisticHelperOptions = exports.statisticOptions = exports.slicerOptions = exports.exportQuadsOptions = exports.benchmarkHelperOptions = exports.benchmarkOptions = void 0;
|
|
7
7
|
const os_1 = __importDefault(require("os"));
|
|
8
|
-
const time_1 = require("../../util/time");
|
|
8
|
+
const time_1 = require("../../util/text/time");
|
|
9
9
|
const feature_1 = require("../../statistics/features/feature");
|
|
10
10
|
/**
|
|
11
|
-
* This string contains a string representation of the
|
|
11
|
+
* This string contains a string representation of the time this module was loaded.
|
|
12
12
|
*/
|
|
13
13
|
const StartTimeString = (0, time_1.date2string)(new Date());
|
|
14
14
|
exports.benchmarkOptions = [
|
|
@@ -25,7 +25,7 @@ exports.benchmarkOptions = [
|
|
|
25
25
|
{ name: 'max-file-slices', type: Number, description: 'If file has more than passed number of slices, the file is not processed', defaultValue: -1, typeLabel: '{underline number}' },
|
|
26
26
|
{ name: 'threshold', alias: 't', type: Number, description: 'How many re-visits of the same node are ok?', defaultValue: undefined, typeLabel: '{underline number}' },
|
|
27
27
|
{ name: 'per-file-time-limit', type: Number, description: 'Time limit in milliseconds to process single file (disabled by default)', defaultValue: undefined, typeLabel: '{underline number}' },
|
|
28
|
-
{ name: 'sampling-strategy', type: String, description: 'Which strategy to use, when sampling is enabled', defaultValue: 'random', typeLabel: '{underline random/
|
|
28
|
+
{ name: 'sampling-strategy', type: String, description: 'Which strategy to use, when sampling is enabled', defaultValue: 'random', typeLabel: '{underline random/equidistant}' },
|
|
29
29
|
];
|
|
30
30
|
exports.benchmarkHelperOptions = [
|
|
31
31
|
{ name: 'verbose', alias: 'v', type: Boolean, description: 'Run with verbose logging [do not use for the real benchmark as this affects the time measurements, but only to find errors]' },
|
|
@@ -39,7 +39,7 @@ exports.benchmarkHelperOptions = [
|
|
|
39
39
|
{ name: 'enable-pointer-tracking', type: Boolean, description: 'Run dataflow analysis with pointer tracking', defaultValue: false },
|
|
40
40
|
{ name: 'max-slices', type: Number, description: 'If file has more than passed number of slices, the file is not processed', defaultValue: -1, typeLabel: '{underline number}' },
|
|
41
41
|
{ name: 'threshold', alias: 't', type: Number, description: 'How many re-visits of the same node are ok?', defaultValue: undefined, typeLabel: '{underline number}' },
|
|
42
|
-
{ name: 'sampling-strategy', type: String, description: 'Which strategy to use, when sampling is enabled', defaultValue: 'random', typeLabel: '{underline random/
|
|
42
|
+
{ name: 'sampling-strategy', type: String, description: 'Which strategy to use, when sampling is enabled', defaultValue: 'random', typeLabel: '{underline random/equidistant}' },
|
|
43
43
|
];
|
|
44
44
|
exports.exportQuadsOptions = [
|
|
45
45
|
{ name: 'verbose', alias: 'v', type: Boolean, description: 'Run with verbose logging' },
|
package/cli/common/script.js
CHANGED
|
@@ -13,7 +13,7 @@ exports.processCommandLineArgs = processCommandLineArgs;
|
|
|
13
13
|
const scripts_info_1 = require("./scripts-info");
|
|
14
14
|
const command_line_usage_1 = __importDefault(require("command-line-usage"));
|
|
15
15
|
const command_line_args_1 = __importDefault(require("command-line-args"));
|
|
16
|
-
const ansi_1 = require("../../util/ansi");
|
|
16
|
+
const ansi_1 = require("../../util/text/ansi");
|
|
17
17
|
const log_1 = require("../../util/log");
|
|
18
18
|
/**
|
|
19
19
|
* Automatically generates a uniform help from a given script (see {@link scripts}).
|
package/cli/flowr.js
CHANGED
|
@@ -9,7 +9,7 @@ const net_1 = require("./repl/server/net");
|
|
|
9
9
|
const version_1 = require("../util/version");
|
|
10
10
|
const command_line_usage_1 = __importDefault(require("command-line-usage"));
|
|
11
11
|
const log_1 = require("../util/log");
|
|
12
|
-
const ansi_1 = require("../util/ansi");
|
|
12
|
+
const ansi_1 = require("../util/text/ansi");
|
|
13
13
|
const command_line_args_1 = __importDefault(require("command-line-args"));
|
|
14
14
|
const config_1 = require("../config");
|
|
15
15
|
const assert_1 = require("../util/assert");
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import type { ReplCommand } from './repl-main';
|
|
2
2
|
export declare const controlflowCommand: ReplCommand;
|
|
3
3
|
export declare const controlflowStarCommand: ReplCommand;
|
|
4
|
+
export declare const controlflowBBCommand: ReplCommand;
|
|
5
|
+
export declare const controlflowBBStarCommand: ReplCommand;
|
|
@@ -33,12 +33,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.controlflowStarCommand = exports.controlflowCommand = void 0;
|
|
37
|
-
const
|
|
36
|
+
exports.controlflowBBStarCommand = exports.controlflowBBCommand = exports.controlflowStarCommand = exports.controlflowCommand = void 0;
|
|
37
|
+
const extract_cfg_1 = require("../../../control-flow/extract-cfg");
|
|
38
38
|
const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipelines");
|
|
39
39
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
40
|
-
const
|
|
41
|
-
const ansi_1 = require("../../../util/ansi");
|
|
40
|
+
const cfg_1 = require("../../../util/mermaid/cfg");
|
|
41
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
42
|
+
const cfg_simplification_1 = require("../../../control-flow/cfg-simplification");
|
|
42
43
|
async function controlflow(parser, remainingLine) {
|
|
43
44
|
return await (0, default_pipelines_1.createDataflowPipeline)(parser, {
|
|
44
45
|
request: (0, retriever_1.requestFromInput)(remainingLine.trim())
|
|
@@ -50,22 +51,26 @@ function handleString(code) {
|
|
|
50
51
|
function formatInfo(out, type) {
|
|
51
52
|
return out.formatter.format(`Copied ${type} to clipboard.`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
|
|
52
53
|
}
|
|
54
|
+
async function produceAndPrintCfg(shell, remainingLine, output, simplifications, cfgConverter) {
|
|
55
|
+
const result = await controlflow(shell, handleString(remainingLine));
|
|
56
|
+
const cfg = (0, extract_cfg_1.extractCFG)(result.normalize, result.dataflow.graph, [...cfg_simplification_1.DefaultCfgSimplificationOrder, ...simplifications]);
|
|
57
|
+
const mermaid = cfgConverter(cfg, result.normalize);
|
|
58
|
+
output.stdout(mermaid);
|
|
59
|
+
try {
|
|
60
|
+
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
61
|
+
clipboard.default.writeSync(mermaid);
|
|
62
|
+
output.stdout(formatInfo(output, 'mermaid code'));
|
|
63
|
+
}
|
|
64
|
+
catch { /* do nothing this is a service thing */
|
|
65
|
+
}
|
|
66
|
+
}
|
|
53
67
|
exports.controlflowCommand = {
|
|
54
68
|
description: `Get mermaid code for the control-flow graph of R code, start with '${retriever_1.fileProtocol}' to indicate a file`,
|
|
55
69
|
usageExample: ':controlflow',
|
|
56
70
|
aliases: ['cfg', 'cf'],
|
|
57
71
|
script: false,
|
|
58
72
|
fn: async (output, shell, remainingLine) => {
|
|
59
|
-
|
|
60
|
-
const cfg = (0, cfg_1.extractCFG)(result.normalize, result.dataflow.graph);
|
|
61
|
-
const mermaid = (0, cfg_2.cfgToMermaid)(cfg, result.normalize);
|
|
62
|
-
output.stdout(mermaid);
|
|
63
|
-
try {
|
|
64
|
-
const clipboard = await Promise.resolve().then(() => __importStar(require('clipboardy')));
|
|
65
|
-
clipboard.default.writeSync(mermaid);
|
|
66
|
-
output.stdout(formatInfo(output, 'mermaid code'));
|
|
67
|
-
}
|
|
68
|
-
catch { /* do nothing this is a service thing */ }
|
|
73
|
+
await produceAndPrintCfg(shell, remainingLine, output, [], cfg_1.cfgToMermaid);
|
|
69
74
|
}
|
|
70
75
|
};
|
|
71
76
|
exports.controlflowStarCommand = {
|
|
@@ -74,16 +79,25 @@ exports.controlflowStarCommand = {
|
|
|
74
79
|
aliases: ['cfg*', 'cf*'],
|
|
75
80
|
script: false,
|
|
76
81
|
fn: async (output, shell, remainingLine) => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
82
|
+
await produceAndPrintCfg(shell, remainingLine, output, [], cfg_1.cfgToMermaidUrl);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
exports.controlflowBBCommand = {
|
|
86
|
+
description: `Get mermaid code for the control-flow graph with basic blocks, start with '${retriever_1.fileProtocol}' to indicate a file`,
|
|
87
|
+
usageExample: ':controlflowbb',
|
|
88
|
+
aliases: ['cfgb', 'cfb'],
|
|
89
|
+
script: false,
|
|
90
|
+
fn: async (output, shell, remainingLine) => {
|
|
91
|
+
await produceAndPrintCfg(shell, remainingLine, output, ['to-basic-blocks'], cfg_1.cfgToMermaid);
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
exports.controlflowBBStarCommand = {
|
|
95
|
+
description: 'Returns the URL to mermaid.live',
|
|
96
|
+
usageExample: ':controlflowbb*',
|
|
97
|
+
aliases: ['cfgb*', 'cfb*'],
|
|
98
|
+
script: false,
|
|
99
|
+
fn: async (output, shell, remainingLine) => {
|
|
100
|
+
await produceAndPrintCfg(shell, remainingLine, output, ['to-basic-blocks'], cfg_1.cfgToMermaidUrl);
|
|
87
101
|
}
|
|
88
102
|
};
|
|
89
103
|
//# sourceMappingURL=repl-cfg.js.map
|
|
@@ -16,8 +16,8 @@ const repl_execute_1 = require("./repl-execute");
|
|
|
16
16
|
const repl_normalize_1 = require("./repl-normalize");
|
|
17
17
|
const repl_dataflow_1 = require("./repl-dataflow");
|
|
18
18
|
const repl_cfg_1 = require("./repl-cfg");
|
|
19
|
-
const ansi_1 = require("../../../util/ansi");
|
|
20
|
-
const args_1 = require("../../../util/args");
|
|
19
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
20
|
+
const args_1 = require("../../../util/text/args");
|
|
21
21
|
const assert_1 = require("../../../util/assert");
|
|
22
22
|
const scripts_info_1 = require("../../common/scripts-info");
|
|
23
23
|
const repl_lineage_1 = require("./repl-lineage");
|
|
@@ -85,6 +85,8 @@ const _commands = {
|
|
|
85
85
|
'dataflowsimple*': repl_dataflow_1.dataflowSimpleStarCommand,
|
|
86
86
|
'controlflow': repl_cfg_1.controlflowCommand,
|
|
87
87
|
'controlflow*': repl_cfg_1.controlflowStarCommand,
|
|
88
|
+
'controlflowbb': repl_cfg_1.controlflowBBCommand,
|
|
89
|
+
'controlflowbb*': repl_cfg_1.controlflowBBStarCommand,
|
|
88
90
|
'lineage': repl_lineage_1.lineageCommand,
|
|
89
91
|
'query': repl_query_1.queryCommand,
|
|
90
92
|
'query*': repl_query_1.queryStarCommand
|
|
@@ -37,7 +37,7 @@ exports.dataflowSimpleStarCommand = exports.dataflowSimplifiedCommand = exports.
|
|
|
37
37
|
const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipelines");
|
|
38
38
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
39
39
|
const dfg_1 = require("../../../util/mermaid/dfg");
|
|
40
|
-
const ansi_1 = require("../../../util/ansi");
|
|
40
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
41
41
|
/**
|
|
42
42
|
* Obtain the dataflow graph using a known parser (such as the {@link RShell} or {@link TreeSitterExecutor}).
|
|
43
43
|
*/
|
|
@@ -53,7 +53,7 @@ function formatInfo(out, type, timing) {
|
|
|
53
53
|
return out.formatter.format(`Copied ${type} to clipboard (dataflow: ${timing}ms).`, { color: 7 /* Colors.White */, effect: ansi_1.ColorEffect.Foreground, style: 3 /* FontStyles.Italic */ });
|
|
54
54
|
}
|
|
55
55
|
exports.dataflowCommand = {
|
|
56
|
-
description: `Get mermaid code for the dataflow graph
|
|
56
|
+
description: `Get mermaid code for the dataflow graph, start with '${retriever_1.fileProtocol}' to indicate a file`,
|
|
57
57
|
usageExample: ':dataflow',
|
|
58
58
|
aliases: ['d', 'df'],
|
|
59
59
|
script: false,
|
|
@@ -87,7 +87,7 @@ exports.dataflowStarCommand = {
|
|
|
87
87
|
}
|
|
88
88
|
};
|
|
89
89
|
exports.dataflowSimplifiedCommand = {
|
|
90
|
-
description: `Get
|
|
90
|
+
description: `Get mermaid code for the simplified dataflow graph, start with '${retriever_1.fileProtocol}' to indicate a file`,
|
|
91
91
|
usageExample: ':dataflowsimple',
|
|
92
92
|
aliases: ['ds', 'dfs'],
|
|
93
93
|
script: false,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.executeCommand = void 0;
|
|
4
4
|
exports.tryExecuteRShellCommand = tryExecuteRShellCommand;
|
|
5
|
-
const ansi_1 = require("../../../util/ansi");
|
|
5
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
6
6
|
const shell_1 = require("../../../r-bridge/shell");
|
|
7
7
|
async function tryExecuteRShellCommand(output, parser, statement, allowRSessionAccess) {
|
|
8
8
|
if (!allowRSessionAccess) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.standardReplOutput = void 0;
|
|
4
|
-
const ansi_1 = require("../../../util/ansi");
|
|
4
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
5
5
|
/**
|
|
6
6
|
* Default repl output that redirects everything to the stdout and stderror channels (linked to `console`).
|
|
7
7
|
* @see ReplOutput
|
|
@@ -37,7 +37,7 @@ exports.normalizeStarCommand = exports.normalizeCommand = void 0;
|
|
|
37
37
|
const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipelines");
|
|
38
38
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
39
39
|
const ast_1 = require("../../../util/mermaid/ast");
|
|
40
|
-
const ansi_1 = require("../../../util/ansi");
|
|
40
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
41
41
|
async function normalize(parser, remainingLine) {
|
|
42
42
|
return await (0, default_pipelines_1.createNormalizePipeline)(parser, {
|
|
43
43
|
request: (0, retriever_1.requestFromInput)(remainingLine.trim())
|
|
@@ -3,8 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.queryStarCommand = exports.queryCommand = void 0;
|
|
4
4
|
const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipelines");
|
|
5
5
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
6
|
-
const args_1 = require("../../../util/args");
|
|
7
|
-
const ansi_1 = require("../../../util/ansi");
|
|
6
|
+
const args_1 = require("../../../util/text/args");
|
|
7
|
+
const ansi_1 = require("../../../util/text/ansi");
|
|
8
8
|
const schema_1 = require("../../../util/schema");
|
|
9
9
|
const query_1 = require("../../../queries/query");
|
|
10
10
|
const json_1 = require("../../../util/json");
|
package/cli/repl/core.js
CHANGED
|
@@ -52,7 +52,7 @@ const repl_execute_1 = require("./commands/repl-execute");
|
|
|
52
52
|
const os_1 = __importDefault(require("os"));
|
|
53
53
|
const path_1 = __importDefault(require("path"));
|
|
54
54
|
const fs_1 = __importDefault(require("fs"));
|
|
55
|
-
const args_1 = require("../../util/args");
|
|
55
|
+
const args_1 = require("../../util/text/args");
|
|
56
56
|
const repl_commands_1 = require("./commands/repl-commands");
|
|
57
57
|
const scripts_info_1 = require("../common/scripts-info");
|
|
58
58
|
const retriever_1 = require("../../r-bridge/retriever");
|
package/cli/repl/prompt.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.prompt = exports.rawPrompt = void 0;
|
|
4
|
-
const ansi_1 = require("../../util/ansi");
|
|
4
|
+
const ansi_1 = require("../../util/text/ansi");
|
|
5
5
|
exports.rawPrompt = 'R>';
|
|
6
6
|
// is a function as the 'formatter' is configured only after the cli options have been read
|
|
7
7
|
const prompt = () => `${ansi_1.formatter.format(exports.rawPrompt, { color: 6 /* Colors.Cyan */, effect: ansi_1.ColorEffect.Foreground })} `;
|