@eagleoutice/flowr 2.10.9 → 2.11.0
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 +116 -38
- package/abstract-interpretation/absint-visitor.js +6 -3
- package/abstract-interpretation/domains/abstract-domain.d.ts +1 -1
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +1 -1
- package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
- package/abstract-interpretation/domains/interval-domain.d.ts +1 -1
- package/abstract-interpretation/domains/interval-domain.js +1 -1
- package/abstract-interpretation/domains/lattice.d.ts +1 -1
- package/abstract-interpretation/domains/partial-product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/partial-product-domain.js +2 -2
- package/abstract-interpretation/domains/set-range-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-range-domain.js +1 -1
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-upper-bound-domain.js +1 -1
- package/abstract-interpretation/domains/singleton-domain.d.ts +1 -1
- package/abstract-interpretation/domains/singleton-domain.js +1 -1
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +1 -1
- package/abstract-interpretation/domains/state-abstract-domain.js +2 -2
- package/abstract-interpretation/unsupported-functions.d.ts +3 -2
- package/abstract-interpretation/unsupported-functions.js +38 -28
- package/cli/benchmark-app.js +2 -1
- package/cli/common/options.d.ts +2 -108
- package/cli/common/options.js +3 -27
- package/cli/common/script.js +3 -2
- package/cli/common/scripts-info.d.ts +2 -123
- package/cli/common/scripts-info.js +0 -17
- package/cli/flowr-main-options.d.ts +5 -0
- package/cli/flowr-main-options.js +10 -0
- package/cli/flowr.js +48 -11
- package/cli/repl/commands/repl-cfg.js +9 -9
- package/cli/repl/commands/repl-commands.js +5 -0
- package/cli/repl/commands/repl-dataflow.js +31 -24
- package/cli/repl/commands/repl-main.d.ts +6 -0
- package/cli/repl/commands/repl-normalize.js +15 -12
- package/cli/repl/commands/repl-parse.js +1 -1
- package/cli/repl/commands/repl-query.js +4 -5
- package/cli/repl/commands/repl-quit.js +2 -1
- package/cli/repl/core.d.ts +11 -0
- package/cli/repl/core.js +101 -3
- package/cli/repl/execute.js +3 -2
- package/cli/repl/parser/slice-query-parser.d.ts +16 -0
- package/cli/repl/parser/slice-query-parser.js +52 -0
- package/cli/repl/print-version.d.ts +3 -1
- package/cli/repl/print-version.js +21 -2
- package/cli/repl/server/connection.d.ts +3 -0
- package/cli/repl/server/connection.js +65 -31
- package/cli/repl/server/messages/message-analysis.d.ts +10 -0
- package/cli/repl/server/messages/message-analysis.js +6 -2
- package/cli/repl/server/messages/message-slice.d.ts +1 -1
- package/cli/script-core/summarizer-core.js +13 -32
- package/cli/wiki.d.ts +3 -1
- package/cli/wiki.js +6 -1
- package/config.d.ts +22 -10
- package/config.js +33 -7
- package/control-flow/diff-cfg.d.ts +1 -1
- package/control-flow/diff-cfg.js +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +2 -0
- package/control-flow/simple-visitor.js +6 -5
- package/control-flow/useless-loop.js +2 -2
- package/core/print/dataflow-printer.d.ts +2 -2
- package/core/print/dataflow-printer.js +2 -2
- package/core/steps/all/static-slicing/00-slice.js +1 -1
- package/data/pkgdb/pkgdb-latest.json.br +0 -0
- package/data/pkgdb/pkgdb-tiny.json.br +0 -0
- package/dataflow/environments/append.d.ts +2 -2
- package/dataflow/environments/append.js +4 -10
- package/dataflow/environments/apply-kill.d.ts +21 -0
- package/dataflow/environments/apply-kill.js +155 -0
- package/dataflow/environments/built-in-proc-name.d.ts +4 -0
- package/dataflow/environments/built-in-proc-name.js +4 -0
- package/dataflow/environments/built-in.d.ts +4 -0
- package/dataflow/environments/built-in.js +4 -0
- package/dataflow/environments/default-builtin-config.d.ts +183 -67
- package/dataflow/environments/default-builtin-config.js +358 -147
- package/dataflow/environments/environment.d.ts +49 -31
- package/dataflow/environments/environment.js +144 -25
- package/dataflow/environments/identifier.d.ts +65 -2
- package/dataflow/environments/identifier.js +37 -2
- package/dataflow/environments/overwrite.js +2 -10
- package/dataflow/environments/reference-to-maybe.d.ts +2 -0
- package/dataflow/environments/reference-to-maybe.js +56 -11
- package/dataflow/environments/resolve-by-name.d.ts +1 -1
- package/dataflow/environments/resolve-by-name.js +23 -9
- package/dataflow/environments/scoping.d.ts +9 -2
- package/dataflow/environments/scoping.js +15 -2
- package/dataflow/eval/values/general.js +4 -0
- package/dataflow/extractor.js +35 -4
- package/dataflow/graph/df-helper.d.ts +14 -0
- package/dataflow/graph/df-helper.js +41 -0
- package/dataflow/graph/graph.d.ts +4 -1
- package/dataflow/graph/graph.js +6 -2
- package/dataflow/info.d.ts +27 -1
- package/dataflow/internal/linker.d.ts +5 -1
- package/dataflow/internal/linker.js +34 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +19 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +1 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +7 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.d.ts +9 -48
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +30 -47
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +17 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +7 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +61 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +9 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +37 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +391 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.d.ts +13 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-namespace-access.js +58 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +132 -25
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +9 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +25 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +94 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +11 -4
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +30 -0
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +279 -0
- package/dataflow/internal/process/functions/call/known-call-handling.js +4 -3
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +1 -1
- package/dataflow/internal/process/functions/call/named-call-handling.js +23 -0
- package/dataflow/origin/dfg-get-origin.d.ts +1 -1
- package/dataflow/origin/dfg-get-origin.js +1 -1
- package/dataflow/processor.d.ts +6 -0
- package/documentation/data/faq/faqs.d.ts +2 -1
- package/documentation/data/faq/faqs.js +78 -57
- package/documentation/data/interface/doc-writing-code.js +4 -80
- package/documentation/data/server/doc-data-server-messages.d.ts +2 -1
- package/documentation/data/server/doc-data-server-messages.js +15 -7
- package/documentation/doc-readme.js +15 -15
- package/documentation/doc-util/doc-cfg.d.ts +3 -1
- package/documentation/doc-util/doc-cfg.js +3 -3
- package/documentation/doc-util/doc-dfg.d.ts +3 -1
- package/documentation/doc-util/doc-dfg.js +3 -3
- package/documentation/doc-util/doc-files.d.ts +3 -1
- package/documentation/doc-util/doc-files.js +9 -6
- package/documentation/doc-util/doc-normalized-ast.d.ts +3 -1
- package/documentation/doc-util/doc-normalized-ast.js +2 -2
- package/documentation/doc-util/doc-query.d.ts +2 -1
- package/documentation/doc-util/doc-query.js +2 -2
- package/documentation/doc-util/doc-repl.js +1 -0
- package/documentation/doc-util/doc-structure.js +1 -2
- package/documentation/doc-util/doc-types.d.ts +6 -6
- package/documentation/doc-util/doc-types.js +11 -9
- package/documentation/issue-linting-rule.js +1 -2
- package/documentation/wiki-analyzer.js +9 -9
- package/documentation/wiki-cfg.js +40 -41
- package/documentation/wiki-core.js +121 -32
- package/documentation/wiki-create-linting-rules.d.ts +6 -0
- package/documentation/wiki-create-linting-rules.js +95 -0
- package/documentation/wiki-dataflow-graph.js +112 -77
- package/documentation/wiki-engine.js +1 -2
- package/documentation/wiki-faq.d.ts +2 -1
- package/documentation/wiki-faq.js +4 -4
- package/documentation/wiki-interface.js +22 -8
- package/documentation/wiki-linter.d.ts +1 -1
- package/documentation/wiki-linter.js +16 -6
- package/documentation/wiki-linting-and-testing.js +2 -2
- package/documentation/wiki-mk/doc-context.d.ts +3 -3
- package/documentation/wiki-mk/doc-maker.d.ts +2 -0
- package/documentation/wiki-mk/doc-maker.js +7 -1
- package/documentation/wiki-normalized-ast.js +5 -5
- package/documentation/wiki-onboarding.d.ts +2 -1
- package/documentation/wiki-onboarding.js +5 -5
- package/documentation/wiki-overview.js +4 -17
- package/documentation/wiki-package-database.d.ts +9 -0
- package/documentation/wiki-package-database.js +63 -0
- package/documentation/wiki-query.js +86 -84
- package/documentation/wiki-search.js +4 -5
- package/documentation/wiki-setup.js +6 -7
- package/gas.d.ts +74 -0
- package/gas.js +18 -0
- package/linter/linter-executor.js +2 -8
- package/linter/linter-format.d.ts +4 -11
- package/linter/linter-rules.d.ts +111 -86
- package/linter/linter-rules.js +9 -1
- package/linter/rules/absolute-path.d.ts +2 -7
- package/linter/rules/absolute-path.js +8 -5
- package/linter/rules/dataframe-access-validation.d.ts +1 -6
- package/linter/rules/dataframe-access-validation.js +8 -6
- package/linter/rules/dead-code.d.ts +2 -11
- package/linter/rules/dead-code.js +16 -11
- package/linter/rules/deprecated-functions.d.ts +3 -3
- package/linter/rules/file-path-validity.d.ts +1 -6
- package/linter/rules/file-path-validity.js +5 -5
- package/linter/rules/function-finder-util.d.ts +7 -11
- package/linter/rules/function-finder-util.js +9 -6
- package/linter/rules/naming-convention.d.ts +2 -7
- package/linter/rules/naming-convention.js +3 -2
- package/linter/rules/network-functions.d.ts +2 -7
- package/linter/rules/network-functions.js +14 -12
- package/linter/rules/no-leaked-credentials.d.ts +36 -0
- package/linter/rules/no-leaked-credentials.js +75 -0
- package/linter/rules/problematic-inputs.d.ts +1 -8
- package/linter/rules/problematic-inputs.js +5 -4
- package/linter/rules/roxygen-arguments.d.ts +2 -7
- package/linter/rules/roxygen-arguments.js +13 -20
- package/linter/rules/seeded-randomness.d.ts +2 -7
- package/linter/rules/seeded-randomness.js +7 -4
- package/linter/rules/software-has-license.d.ts +31 -0
- package/linter/rules/software-has-license.js +46 -0
- package/linter/rules/software-has-tests.d.ts +38 -0
- package/linter/rules/software-has-tests.js +48 -0
- package/linter/rules/stop-with-call-arg.d.ts +2 -7
- package/linter/rules/stop-with-call-arg.js +3 -2
- package/linter/rules/undefined-symbol.d.ts +39 -0
- package/linter/rules/undefined-symbol.js +80 -0
- package/linter/rules/unused-definition.d.ts +3 -8
- package/linter/rules/unused-definition.js +7 -5
- package/linter/rules/useless-loop.d.ts +2 -7
- package/linter/rules/useless-loop.js +5 -2
- package/package.json +5 -5
- package/project/cache/flowr-analyzer-cache.d.ts +2 -0
- package/project/cache/flowr-analyzer-cache.js +9 -1
- package/project/context/flowr-analyzer-context.d.ts +13 -14
- package/project/context/flowr-analyzer-context.js +4 -0
- package/project/context/flowr-analyzer-dependencies-context.d.ts +16 -8
- package/project/context/flowr-analyzer-dependencies-context.js +36 -4
- package/project/context/flowr-analyzer-environment-context.d.ts +2 -4
- package/project/context/flowr-analyzer-environment-context.js +3 -4
- package/project/context/flowr-analyzer-files-context.d.ts +13 -0
- package/project/context/flowr-analyzer-files-context.js +12 -2
- package/project/context/flowr-analyzer-gas-context.d.ts +28 -0
- package/project/context/flowr-analyzer-gas-context.js +101 -0
- package/project/context/flowr-file.d.ts +2 -0
- package/project/context/flowr-file.js +2 -0
- package/project/flowr-analyzer-builder.js +3 -0
- package/project/flowr-analyzer.d.ts +2 -1
- package/project/flowr-analyzer.js +3 -1
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +13 -15
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +36 -13
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +13 -7
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +56 -11
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.d.ts +27 -0
- package/project/plugins/file-plugins/flowr-analyzer-virtualenv-file-plugin.js +41 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +2 -2
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +2 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +5 -5
- package/project/plugins/flowr-analyzer-plugin.d.ts +15 -8
- package/project/plugins/flowr-analyzer-plugin.js +14 -7
- package/project/plugins/gas-plugins/flowr-analyzer-gas-plugin.d.ts +19 -0
- package/project/plugins/gas-plugins/flowr-analyzer-gas-plugin.js +35 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +18 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +62 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.d.ts +63 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-pkgdb-plugin.js +174 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.d.ts +10 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-plugin.js +6 -0
- package/project/plugins/package-version-plugins/package.d.ts +3 -0
- package/project/plugins/package-version-plugins/package.js +12 -0
- package/project/plugins/package-version-plugins/pkgdb.d.ts +133 -0
- package/project/plugins/package-version-plugins/pkgdb.js +370 -0
- package/project/plugins/plugin-registry.d.ts +5 -1
- package/project/plugins/plugin-registry.js +10 -1
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.d.ts +22 -0
- package/project/plugins/project-discovery/flowr-analyzer-gitignore-project-discovery-plugin.js +47 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +62 -8
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +4 -2
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -0
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +8 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +31 -3
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +3 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +3 -2
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/other-path-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/other-path-functions.js +27 -0
- package/queries/catalog/dependencies-query/function-info/read-functions.js +5 -4
- package/queries/catalog/dependencies-query/function-info/test-functions.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/test-functions.js +18 -177
- package/queries/catalog/dependencies-query/function-info/visualize-functions.js +3 -1
- package/queries/catalog/df-shape-query/df-shape-query-format.js +1 -1
- package/queries/catalog/dice-query/dice-query-executor.d.ts +8 -0
- package/queries/catalog/dice-query/dice-query-executor.js +52 -0
- package/queries/catalog/dice-query/dice-query-format.d.ts +53 -0
- package/queries/catalog/dice-query/dice-query-format.js +102 -0
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +2 -0
- package/queries/catalog/input-sources-query/input-sources-query-format.js +1 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -0
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +1 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -0
- package/queries/catalog/linter-query/linter-query-executor.js +8 -0
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -0
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -0
- package/queries/catalog/origin-query/origin-query-format.d.ts +2 -0
- package/queries/catalog/origin-query/origin-query-format.js +1 -0
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -0
- package/queries/catalog/provenance-query/provenance-query-format.js +1 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +2 -0
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.js +1 -0
- package/queries/query.d.ts +18 -1
- package/queries/query.js +3 -1
- package/r-bridge/data/data.d.ts +7 -2
- package/r-bridge/data/data.js +8 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +0 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +13 -4
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +55 -44
- package/r-bridge/parser.js +2 -9
- package/r-bridge/shell.d.ts +8 -1
- package/r-bridge/shell.js +26 -7
- package/search/flowr-search-builder.d.ts +2 -2
- package/search/flowr-search-builder.js +1 -1
- package/search/flowr-search-filters.d.ts +30 -9
- package/search/flowr-search-filters.js +26 -21
- package/search/search-executor/search-enrichers.d.ts +601 -1
- package/search/search-executor/search-enrichers.js +30 -6
- package/slicing/static/static-slicer.d.ts +39 -11
- package/slicing/static/static-slicer.js +44 -14
- package/util/collections/queue.d.ts +16 -0
- package/util/collections/queue.js +38 -0
- package/util/log.d.ts +1 -1
- package/util/log.js +1 -1
- package/util/mermaid/dfg.d.ts +2 -2
- package/util/mermaid/dfg.js +2 -2
- package/util/mermaid/mermaid.d.ts +4 -0
- package/util/mermaid/mermaid.js +8 -1
- package/util/objects.d.ts +9 -0
- package/util/objects.js +54 -0
- package/util/proc.d.ts +6 -0
- package/util/proc.js +20 -0
- package/util/version.js +10 -2
- package/cli/common/features.d.ts +0 -9
- package/cli/common/features.js +0 -35
- package/cli/script-core/statistics-core.d.ts +0 -6
- package/cli/script-core/statistics-core.js +0 -103
- package/cli/script-core/statistics-helper-core.d.ts +0 -6
- package/cli/script-core/statistics-helper-core.js +0 -85
- package/cli/statistics-app.d.ts +0 -11
- package/cli/statistics-app.js +0 -16
- package/cli/statistics-helper-app.d.ts +0 -11
- package/cli/statistics-helper-app.js +0 -14
- package/statistics/features/common-syntax-probability.d.ts +0 -38
- package/statistics/features/common-syntax-probability.js +0 -169
- package/statistics/features/feature.d.ts +0 -179
- package/statistics/features/feature.js +0 -38
- package/statistics/features/post-processing.d.ts +0 -18
- package/statistics/features/post-processing.js +0 -26
- package/statistics/features/supported/assignments/assignments.d.ts +0 -12
- package/statistics/features/supported/assignments/assignments.js +0 -56
- package/statistics/features/supported/assignments/post-process.d.ts +0 -6
- package/statistics/features/supported/assignments/post-process.js +0 -126
- package/statistics/features/supported/comments/comments.d.ts +0 -18
- package/statistics/features/supported/comments/comments.js +0 -143
- package/statistics/features/supported/comments/post-process.d.ts +0 -6
- package/statistics/features/supported/comments/post-process.js +0 -51
- package/statistics/features/supported/control-flow/control-flow.d.ts +0 -17
- package/statistics/features/supported/control-flow/control-flow.js +0 -69
- package/statistics/features/supported/control-flow/post-process.d.ts +0 -6
- package/statistics/features/supported/control-flow/post-process.js +0 -66
- package/statistics/features/supported/data-access/data-access.d.ts +0 -15
- package/statistics/features/supported/data-access/data-access.js +0 -122
- package/statistics/features/supported/data-access/post-process.d.ts +0 -6
- package/statistics/features/supported/data-access/post-process.js +0 -108
- package/statistics/features/supported/defined-functions/defined-functions.d.ts +0 -34
- package/statistics/features/supported/defined-functions/defined-functions.js +0 -145
- package/statistics/features/supported/defined-functions/post-process.d.ts +0 -6
- package/statistics/features/supported/defined-functions/post-process.js +0 -168
- package/statistics/features/supported/expression-list/post-process.d.ts +0 -6
- package/statistics/features/supported/expression-list/post-process.js +0 -45
- package/statistics/features/supported/expression-list/statistics-expression-list.d.ts +0 -9
- package/statistics/features/supported/expression-list/statistics-expression-list.js +0 -37
- package/statistics/features/supported/loops/loops.d.ts +0 -20
- package/statistics/features/supported/loops/loops.js +0 -81
- package/statistics/features/supported/loops/post-process.d.ts +0 -6
- package/statistics/features/supported/loops/post-process.js +0 -73
- package/statistics/features/supported/used-functions/post-process.d.ts +0 -6
- package/statistics/features/supported/used-functions/post-process.js +0 -176
- package/statistics/features/supported/used-functions/used-functions.d.ts +0 -24
- package/statistics/features/supported/used-functions/used-functions.js +0 -99
- package/statistics/features/supported/used-packages/post-process.d.ts +0 -6
- package/statistics/features/supported/used-packages/post-process.js +0 -122
- package/statistics/features/supported/used-packages/used-packages.d.ts +0 -16
- package/statistics/features/supported/used-packages/used-packages.js +0 -140
- package/statistics/features/supported/values/post-process.d.ts +0 -6
- package/statistics/features/supported/values/post-process.js +0 -73
- package/statistics/features/supported/values/values.d.ts +0 -14
- package/statistics/features/supported/values/values.js +0 -111
- package/statistics/features/supported/variables/post-process.d.ts +0 -15
- package/statistics/features/supported/variables/post-process.js +0 -126
- package/statistics/features/supported/variables/variables.d.ts +0 -15
- package/statistics/features/supported/variables/variables.js +0 -62
- package/statistics/meta-statistics.d.ts +0 -32
- package/statistics/meta-statistics.js +0 -16
- package/statistics/output/file-provider.d.ts +0 -36
- package/statistics/output/file-provider.js +0 -96
- package/statistics/output/print-stats.d.ts +0 -29
- package/statistics/output/print-stats.js +0 -81
- package/statistics/output/statistics-file.d.ts +0 -36
- package/statistics/output/statistics-file.js +0 -68
- package/statistics/statistics.d.ts +0 -29
- package/statistics/statistics.js +0 -108
- package/statistics/summarizer/auto-detect.d.ts +0 -5
- package/statistics/summarizer/auto-detect.js +0 -34
- package/statistics/summarizer/first-phase/process.d.ts +0 -6
- package/statistics/summarizer/first-phase/process.js +0 -81
- package/statistics/summarizer/post-process/clusterer.d.ts +0 -25
- package/statistics/summarizer/post-process/clusterer.js +0 -40
- package/statistics/summarizer/post-process/file-based-count.d.ts +0 -16
- package/statistics/summarizer/post-process/file-based-count.js +0 -47
- package/statistics/summarizer/post-process/histogram.d.ts +0 -57
- package/statistics/summarizer/post-process/histogram.js +0 -126
- package/statistics/summarizer/post-process/post-process-output.d.ts +0 -14
- package/statistics/summarizer/post-process/post-process-output.js +0 -102
- package/statistics/summarizer/second-phase/process.d.ts +0 -15
- package/statistics/summarizer/second-phase/process.js +0 -118
- package/statistics/summarizer/summarizer.d.ts +0 -34
- package/statistics/summarizer/summarizer.js +0 -141
|
@@ -39,7 +39,6 @@ ${ctx.code(staticSliceExample, { dropLinesEnd: 2, dropLinesStart: 1, hideDefined
|
|
|
39
39
|
|
|
40
40
|
For more information, please have a look at the ${ctx.linkPage('wiki/Analyzer')} wiki page, which explains how to construct and use the ${ctx.link(flowr_analyzer_1.FlowrAnalyzer)} in more detail.
|
|
41
41
|
To work with specific perspectives, you can also consult the respective pages like the ${ctx.linkPage('wiki/Dataflow Graph')} or the ${ctx.linkPage('wiki/Abstract Interpretation')} wiki pages.
|
|
42
|
-
|
|
43
42
|
### The Pipeline Executor (Low-Level Interface)
|
|
44
43
|
|
|
45
44
|
Once, in the beginning, _flowR_ was meant to produce a dataflow graph merely to provide *program slices*.
|
|
@@ -71,7 +70,7 @@ The ${ctx.link(pipeline_executor_1.PipelineExecutor)}...
|
|
|
71
70
|
|
|
72
71
|
See the in-code documentation for more information.
|
|
73
72
|
|
|
74
|
-
|
|
73
|
+
`)}
|
|
75
74
|
|
|
76
75
|
### Using the ${ctx.link(shell_1.RShell)} to Interact with R
|
|
77
76
|
|
|
@@ -90,86 +89,11 @@ You can start a new "session" simply by constructing a new object with ${(0, doc
|
|
|
90
89
|
However, there are several options that may be of interest
|
|
91
90
|
(e.g., to automatically revive the shell in case of errors or to control the name location of the R process on the system).
|
|
92
91
|
|
|
93
|
-
With a shell object (let's call it \`shell\`), you can execute R code by using ${ctx.linkM(shell_1.RShell, 'sendCommand', { realNameWrapper: 'i' })},
|
|
94
|
-
for example ${(0, doc_code_1.codeInline)('shell.' + ctx.linkM(shell_1.RShell, 'sendCommand', { codeFont: false, hideClass: true }) + '("1 + 1")')}.
|
|
92
|
+
With a shell object (let's call it \`shell\`), you can execute R code by using ${ctx.linkM(shell_1.RShell, 'sendCommand', { realNameWrapper: 'i' })},
|
|
93
|
+
for example ${(0, doc_code_1.codeInline)('shell.' + ctx.linkM(shell_1.RShell, 'sendCommand', { codeFont: false, hideClass: true }) + '("1 + 1")')}.
|
|
95
94
|
However, this does not return anything, so if you want to collect the output of your command, use
|
|
96
95
|
${ctx.linkM(shell_1.RShell, 'sendCommandWithOutput', { realNameWrapper: 'i' })} instead.
|
|
97
96
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
### Generate Statistics (No longer a Focus of flowR)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
<details>
|
|
105
|
-
|
|
106
|
-
<summary>Adding a New Feature to Extract</summary>
|
|
107
|
-
|
|
108
|
-
In this example, we construct a new feature to extract, with the name "*example*".
|
|
109
|
-
Whenever this name appears, you may substitute this with whatever name fits your feature best (as long as the name is unique).
|
|
110
|
-
|
|
111
|
-
1. **Create a new file in \`src/statistics/features/supported\`**\\
|
|
112
|
-
Create the file \`example.ts\`, and add its export to the \`index.ts\` file in the same directory (if not done automatically).
|
|
113
|
-
|
|
114
|
-
2. **Create the basic structure**\\
|
|
115
|
-
To get a better feel of what a feature must have, let's look
|
|
116
|
-
at the basic structure (of course, due to TypeScript syntax,
|
|
117
|
-
there are other ways to achieve the same goal):
|
|
118
|
-
|
|
119
|
-
\`\`\`ts
|
|
120
|
-
const initialExampleInfo = {
|
|
121
|
-
/* whatever start value is good for you */
|
|
122
|
-
someCounter: 0
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
export type ExampleInfo = Writable<typeof initialExampleInfo>
|
|
126
|
-
|
|
127
|
-
export const example: Feature<ExampleInfo> = {
|
|
128
|
-
name: 'Example Feature',
|
|
129
|
-
description: 'A longer example description',
|
|
130
|
-
|
|
131
|
-
process(existing: ExampleInfo, input: FeatureProcessorInput): ExampleInfo {
|
|
132
|
-
/* perform analysis on the input */
|
|
133
|
-
return existing
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
initialValue: initialExampleInfo
|
|
137
|
-
}
|
|
138
|
-
\`\`\`
|
|
139
|
-
|
|
140
|
-
The \`initialExampleInfo\` type holds the initial values for each counter that you want to maintain during the feature extraction (they will usually be initialized with 0). The resulting \`ExampleInfo\` type holds the structure of the data that is to be counted. Due to the vast amount of data processed, information like the name and location of a function call is not stored here, but instead written to disk (see below).
|
|
141
|
-
|
|
142
|
-
Every new feature must be of the \`Feature<Info>\` type, with \`Info\` referring to a \`FeatureInfo\` (like \`ExampleInfo\` in this example). Next to a \`name\` and a \`description\`, each Feature must provide:
|
|
143
|
-
|
|
144
|
-
- a processor that extracts the information from the input, adding it to the existing information.
|
|
145
|
-
- a function returning the initial value of the information (in this case, \`initialExampleInfo\`).
|
|
146
|
-
|
|
147
|
-
3. **Add it to the feature-mapping**\\
|
|
148
|
-
Now, in the \`feature.ts\` file in \`src/statistics/features\`, add your feature to the \`ALL_FEATURES\` object.
|
|
149
|
-
|
|
150
|
-
Now, we want to extract something. For the *example* feature created in the previous steps, we choose to count the amount of \`COMMENT\` tokens.
|
|
151
|
-
So we define a corresponding [XPath](https://developer.mozilla.org/en-US/docs/Web/XPath) query:
|
|
152
|
-
|
|
153
|
-
\`\`\`ts
|
|
154
|
-
const commentQuery: Query = xpath.parse('//COMMENT')
|
|
155
|
-
\`\`\`
|
|
156
|
-
|
|
157
|
-
Within our feature's \`process\` function, running the query is as simple as:
|
|
158
|
-
|
|
159
|
-
\`\`\`ts
|
|
160
|
-
const comments = commentQuery.select({ node: input.parsedRAst })
|
|
161
|
-
\`\`\`
|
|
162
|
-
|
|
163
|
-
Now we could do a lot of further processing, but for simplicity, we only record every comment found this way:
|
|
164
|
-
|
|
165
|
-
\`\`\`ts
|
|
166
|
-
appendStatisticsFile(example.name, 'comments', comments, input.filepath)
|
|
167
|
-
\`\`\`
|
|
168
|
-
|
|
169
|
-
We use \`example.name\` to avoid duplication with the name that we’ve assigned to the feature. It corresponds to the name of the folder in the statistics output.
|
|
170
|
-
\`'comments'\` refers to a freely chosen (but unique) name, that will be used as the name for the output file within the folder. The \`comments\` variable holds the result of the query, which is an array of nodes. Finally, we pass the \`filepath\` of the file that was analyzed (if known), so that it can be added to the statistics file (as additional information).
|
|
171
|
-
|
|
172
|
-
</details>
|
|
173
|
-
`;
|
|
97
|
+
`;
|
|
174
98
|
}
|
|
175
99
|
//# sourceMappingURL=doc-writing-code.js.map
|
|
@@ -20,7 +20,7 @@ const identify_link_to_last_call_relation_1 = require("../../../queries/catalog/
|
|
|
20
20
|
/**
|
|
21
21
|
*
|
|
22
22
|
*/
|
|
23
|
-
function documentAllServerMessages() {
|
|
23
|
+
function documentAllServerMessages(ctx) {
|
|
24
24
|
(0, doc_server_message_1.documentServerMessage)({
|
|
25
25
|
title: 'Hello',
|
|
26
26
|
type: 'response',
|
|
@@ -78,6 +78,14 @@ Furthermore, the request must contain either a \`content\` field to directly pas
|
|
|
78
78
|
If you add the \`id\` field, the answer will use the same \`id\` so you can match requests and the corresponding answers.
|
|
79
79
|
See the implementation of the request-file-analysis message for more information.
|
|
80
80
|
|
|
81
|
+
You can drop one or more stored file tokens by adding the \`invalidateToken\` field (a single token or an array of tokens).
|
|
82
|
+
The server frees the corresponding analyses _after_ it has answered the request.
|
|
83
|
+
|
|
84
|
+
> **Tip!**\\
|
|
85
|
+
> If you only want to drop tokens, you do not need a separate message: send a \`request-file-analysis\` that contains _just_ the \`invalidateToken\` field (and no \`content\` or \`filepath\`).
|
|
86
|
+
> Such a request behaves like an empty file analysis and the server replies with an empty \`results\` object.
|
|
87
|
+
> Because invalidation happens after the response, you may even pass the _current_ \`filetoken\` in \`invalidateToken\` to analyze a file once and have the server forget it right after you received the results.
|
|
88
|
+
|
|
81
89
|
${await (0, doc_server_message_1.documentServerMessageResponse)({
|
|
82
90
|
shell,
|
|
83
91
|
messageType: 'request-file-analysis',
|
|
@@ -101,8 +109,8 @@ ${await (0, doc_server_message_1.documentServerMessageResponse)({
|
|
|
101
109
|
The \`results\` field of the response effectively contains three keys of importance:
|
|
102
110
|
|
|
103
111
|
- \`parse\`: which contains 1:1 the parse result in CSV format that we received from the \`${shell_1.RShell.name}\` (i.e., the AST produced by the parser of the R interpreter).
|
|
104
|
-
- \`normalize\`: which contains the normalized AST, including ids (see the \`info\` field and the
|
|
105
|
-
- \`dataflow\`: especially important is the \`graph\` field which contains the dataflow graph as a set of root vertices (see the
|
|
112
|
+
- \`normalize\`: which contains the normalized AST, including ids (see the \`info\` field and the ${ctx.linkPage('wiki/Normalized AST', 'Normalized AST')} wiki page).
|
|
113
|
+
- \`dataflow\`: especially important is the \`graph\` field which contains the dataflow graph as a set of root vertices (see the ${ctx.linkPage('wiki/Dataflow Graph', 'Dataflow Graph')} wiki page).
|
|
106
114
|
`
|
|
107
115
|
}
|
|
108
116
|
]
|
|
@@ -172,7 +180,7 @@ If you are interested in a visual representation of the control flow graph, see
|
|
|
172
180
|
**Retrieve the Output as RDF N-Quads**
|
|
173
181
|
|
|
174
182
|
The default response is formatted as JSON.
|
|
175
|
-
However, by specifying \`format: "n-quads"\`, you can retrieve the individual results (e.g., the
|
|
183
|
+
However, by specifying \`format: "n-quads"\`, you can retrieve the individual results (e.g., the ${ctx.linkPage('wiki/Normalized AST', 'Normalized AST')}),
|
|
176
184
|
as [RDF N-Quads](https://www.w3.org/TR/n-quads/).
|
|
177
185
|
This works with and without the control flow graph as described [above](#analysis-include-cfg).
|
|
178
186
|
|
|
@@ -254,7 +262,7 @@ Please note, that the base message format is still JSON. Only the individual res
|
|
|
254
262
|
shortDescription: `${deprecatedByQuery} The server slices a file based on the given criteria.`,
|
|
255
263
|
text: async (shell) => {
|
|
256
264
|
return `
|
|
257
|
-
**We deprecated the slice request in favor of the \`static-slice\`
|
|
265
|
+
**We deprecated the slice request in favor of the \`static-slice\` ${ctx.linkPage('wiki/Query API', 'Query')}.**
|
|
258
266
|
|
|
259
267
|
To slice, you have to send a file analysis request first. The \`filetoken\` you assign is of use here as you can re-use it to repeatedly slice the same file.
|
|
260
268
|
Besides that, you only need to add an array of slicing criteria, using one of the formats described on the [terminology wiki page](${doc_files_1.FlowrWikiBaseRef}/Terminology#slicing-criterion)
|
|
@@ -353,7 +361,7 @@ Within a document that is to be sliced, you can use magic comments to influence
|
|
|
353
361
|
|
|
354
362
|
|
|
355
363
|
The REPL execution message allows to send a REPL command to receive its output.
|
|
356
|
-
For more on the REPL, see the
|
|
364
|
+
For more on the REPL, see the ${ctx.linkPage('wiki/Overview', 'introduction', 'the-read-eval-print-loop-repl')}, or the [description below](#using-the-repl).
|
|
357
365
|
You only have to pass the command you want to execute in the \`expression\` field.
|
|
358
366
|
Furthermore, you can set the \`ansi\` field to \`true\` if you are interested in output formatted using [ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code).
|
|
359
367
|
We strongly recommend you to make use of the \`id\` field to link answers with requests as you can theoretically request the execution of multiple scripts at the same time, which then happens in parallel.
|
|
@@ -423,7 +431,7 @@ ${(0, doc_code_1.codeBlock)('text', msg.result)}
|
|
|
423
431
|
text: async (shell) => {
|
|
424
432
|
return `
|
|
425
433
|
To send queries, you have to send an [analysis request](#message-request-file-analysis) first. The \`filetoken\` you assign is of use here as you can re-use it to repeatedly query the same file.
|
|
426
|
-
This message provides direct access to _flowR_'s Query API. Please consult the
|
|
434
|
+
This message provides direct access to _flowR_'s Query API. Please consult the ${ctx.linkPage('wiki/Query API', 'Query API documentation')} for more information.
|
|
427
435
|
|
|
428
436
|
${await (0, doc_server_message_1.documentServerMessageResponse)({
|
|
429
437
|
shell,
|
|
@@ -143,14 +143,14 @@ class DocReadme extends doc_maker_1.DocMaker {
|
|
|
143
143
|
[](https://zenodo.org/doi/10.5281/zenodo.13319290)
|
|
144
144
|
|
|
145
145
|
_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/),
|
|
146
|
-
available for
|
|
147
|
-
and
|
|
146
|
+
available for ${ctx.linkPage('flowr:vscode', 'VSCode')}, ${ctx.linkPage('flowr:positron', 'Positron')}, ${ctx.linkPage('flowr:rstudio-addin', 'RStudio')},
|
|
147
|
+
and ${ctx.linkPage('flowr:docker', 'Docker')}.
|
|
148
148
|
It offers a wide variety of features, for example:
|
|
149
149
|
|
|
150
150
|
* 🐞 **code linting**\\
|
|
151
|
-
Analyze your R scripts for common issues and potential bugs (see the
|
|
151
|
+
Analyze your R scripts for common issues and potential bugs (see the ${ctx.linkPage('wiki/Linter', 'wiki page')} for more information on the currently supported linters).
|
|
152
152
|
|
|
153
|
-
${(0, doc_general_1.prefixLines)((0, doc_structure_1.details)('Example: Linting code with flowR', `To lint your code, you can use the
|
|
153
|
+
${(0, doc_general_1.prefixLines)((0, doc_structure_1.details)('Example: Linting code with flowR', `To lint your code, you can use the ${ctx.linkPage('wiki/Interface', 'REPL', 'using-the-repl')} or the ${ctx.linkPage('flowr:vscode', 'Visual Studio Code extension')} (see [vscode-flowr#283](https://github.com/flowr-analysis/vscode-flowr/pull/283)).
|
|
154
154
|
|
|
155
155
|
${await (async () => {
|
|
156
156
|
const code = 'read.csv("/root/x.txt")';
|
|
@@ -174,8 +174,8 @@ ${res}
|
|
|
174
174
|
for the computation of the point of interest.
|
|
175
175
|
|
|
176
176
|
${(0, doc_general_1.prefixLines)((0, doc_structure_1.details)('Example: Slicing with flowR', `
|
|
177
|
-
The simplest way to retrieve slices is with flowR's
|
|
178
|
-
However, you can slice using the
|
|
177
|
+
The simplest way to retrieve slices is with flowR's ${ctx.linkPage('flowr:vscode', 'Visual Studio Code extension')}.
|
|
178
|
+
However, you can slice using the ${ctx.linkPage('wiki/Interface', 'REPL', 'using-the-repl')} as well.
|
|
179
179
|
This can help you if you want to reuse specific parts of an existing analysis within another context or if you want to understand
|
|
180
180
|
what is happening in the code.
|
|
181
181
|
|
|
@@ -195,11 +195,11 @@ ${await (0, doc_repl_1.documentReplSession)(treeSitter, [{
|
|
|
195
195
|
|
|
196
196
|
* 📚 **dependency analysis**\\
|
|
197
197
|
Given your analysis project, flowR offers a plethora of so-called ${ctx.linkPage('wiki/Query API', 'queries')} to get more information about your code.
|
|
198
|
-
An important query is the
|
|
198
|
+
An important query is the ${ctx.linkPage('wiki/Query API', 'dependencies query', 'dependencies-query')}, which shows you the library your project needs,
|
|
199
199
|
the data files it reads, the scripts it sources, and the data it outputs.
|
|
200
200
|
|
|
201
201
|
${(0, doc_general_1.prefixLines)((0, doc_structure_1.details)('Example: Dependency Analysis with flowR', `
|
|
202
|
-
The following showcases the dependency view of the
|
|
202
|
+
The following showcases the dependency view of the ${ctx.linkPage('flowr:vscode', 'Visual Studio Code extension')}:
|
|
203
203
|
|
|
204
204
|

|
|
205
205
|
|
|
@@ -211,7 +211,7 @@ The following showcases the dependency view of the [Visual Studio Code extension
|
|
|
211
211
|
and consult the ${ctx.linkPage('wiki/Dataflow Graph', 'wiki pages')} for more details on the ${ctx.linkPage('wiki/Dataflow Graph', 'dataflow graphs')} as well as ${ctx.linkPage('wiki/Dataflow Graph', 'call graphs', 'perspectives-cg')}.
|
|
212
212
|
|
|
213
213
|
${(0, doc_general_1.prefixLines)((0, doc_structure_1.details)('Example: Generating a dataflow graph with flowR', `
|
|
214
|
-
You can investigate flowR's analyses using the
|
|
214
|
+
You can investigate flowR's analyses using the ${ctx.linkPage('wiki/Interface', 'REPL', 'using-the-repl')}.
|
|
215
215
|
Commands like ${(0, doc_cli_option_1.getReplCommand)('dataflow*')} allow you to view a ${ctx.linkPage('wiki/Dataflow Graph', 'dataflow graph')} for a given R script.
|
|
216
216
|
|
|
217
217
|
Let's have a look at the following example:
|
|
@@ -231,11 +231,11 @@ ${await (0, doc_dfg_1.printDfGraphForCode)(treeSitter, (0, doc_files_1.getFileCo
|
|
|
231
231
|
|
|
232
232
|
If you want to use flowR and the features it provides, feel free to check out the:
|
|
233
233
|
|
|
234
|
-
-
|
|
235
|
-
-
|
|
236
|
-
-
|
|
237
|
-
-
|
|
238
|
-
-
|
|
234
|
+
- ${ctx.linkPage('flowr:vscode', 'Visual Studio Code')}/${ctx.linkPage('flowr:positron', 'Positron')}: provides access to flowR directly in VS Code and Positron (or [vscode.dev](https://vscode.dev/))
|
|
235
|
+
- ${ctx.linkPage('flowr:rstudio-addin', 'RStudio Addin')}: integrates flowR into [RStudio](https://posit.co/downloads/)
|
|
236
|
+
- ${ctx.linkPage('flowr:radapter', 'R package')}: use flowR in your R scripts
|
|
237
|
+
- ${ctx.linkPage('flowr:docker', 'Docker image')}: run flowR in a container, this also includes ${ctx.linkPage('wiki/Interface', "flowR's server", 'communicating-with-the-server')}
|
|
238
|
+
- ${ctx.linkPage('flowr:npm', 'NPM package')}: include flowR in your TypeScript and JavaScript projects
|
|
239
239
|
|
|
240
240
|
|
|
241
241
|
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).
|
|
@@ -302,7 +302,7 @@ and received an unrestricted gift from [Posit](https://posit.co/), the open-sour
|
|
|
302
302
|
|
|
303
303
|
Please notice that this file was generated automatically using the file ${(0, doc_auto_gen_1.fileNameForGenHeader)(module.filename)} as a source.\\
|
|
304
304
|
If you want to make changes please edit the source file (the CI will take care of the rest).
|
|
305
|
-
In fact, many files in the
|
|
305
|
+
In fact, many files in the ${ctx.linkPage('flowr:wiki', 'wiki')} are generated, so make sure to check for the source file if you want to make changes.
|
|
306
306
|
|
|
307
307
|
`.trim();
|
|
308
308
|
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { NormalizedAst } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
2
2
|
import type { KnownParser } from '../../r-bridge/parser';
|
|
3
|
+
import type { GeneralDocContext } from '../wiki-mk/doc-context';
|
|
3
4
|
import type { DataflowInformation } from '../../dataflow/info';
|
|
4
5
|
import type { ControlFlowInformation } from '../../control-flow/control-flow-graph';
|
|
5
6
|
import { type CfgSimplificationPassName } from '../../control-flow/cfg-simplification';
|
|
@@ -21,9 +22,10 @@ export interface PrintCfgOptions {
|
|
|
21
22
|
readonly simplifications?: readonly CfgSimplificationPassName[];
|
|
22
23
|
readonly simplify?: boolean;
|
|
23
24
|
readonly useDfg?: boolean;
|
|
25
|
+
readonly ctx?: GeneralDocContext;
|
|
24
26
|
}
|
|
25
27
|
/**
|
|
26
28
|
* Generates and prints the control flow graph for the given code, along with optional metadata and the original code.
|
|
27
29
|
*/
|
|
28
|
-
export declare function printCfgCode(parser: KnownParser, code: string, { showCode, openCode, prefix, simplifications, simplify, useDfg }?: PrintCfgOptions): Promise<string>;
|
|
30
|
+
export declare function printCfgCode(parser: KnownParser, code: string, { showCode, openCode, prefix, simplifications, simplify, useDfg, ctx }?: PrintCfgOptions): Promise<string>;
|
|
29
31
|
export {};
|
|
@@ -36,12 +36,12 @@ ${(0, doc_code_1.codeBlock)('mermaid', (0, cfg_1.cfgToMermaid)(cfg, ast, { prefi
|
|
|
36
36
|
/**
|
|
37
37
|
* Generates and prints the control flow graph for the given code, along with optional metadata and the original code.
|
|
38
38
|
*/
|
|
39
|
-
async function printCfgCode(parser, code, { showCode = true, openCode = false, prefix = 'flowchart BT\n', simplifications = [], simplify = false, useDfg = true } = {}) {
|
|
39
|
+
async function printCfgCode(parser, code, { showCode = true, openCode = false, prefix = 'flowchart BT\n', simplifications = [], simplify = false, useDfg = true, ctx } = {}) {
|
|
40
40
|
const now = performance.now();
|
|
41
41
|
const res = await getCfg(parser, code, simplifications, useDfg);
|
|
42
42
|
const duration = performance.now() - now;
|
|
43
|
-
const metaInfo = `The analysis required _${(0, time_1.printAsMs)(duration)}_ (including the ${useDfg ? 'dataflow analysis, ' : ''} normalization${useDfg ? ', ' : ''} and parsing with the [${parser.name}](${doc_files_1.FlowrWikiBaseRef}/Engines) engine) within the generation environment.
|
|
44
|
-
We used the following simplification${(simplifications?.length ?? 0) + cfg_simplification_1.DefaultCfgSimplificationOrder.length
|
|
43
|
+
const metaInfo = `The analysis required _${(0, time_1.printAsMs)(duration)}_ (including the ${useDfg ? 'dataflow analysis, ' : ''} normalization${useDfg ? ', ' : ''} and parsing with the ${ctx ? ctx.linkPage('wiki/Engines', parser.name) : `[${parser.name}](${doc_files_1.FlowrWikiBaseRef}/Engines)`} engine) within the generation environment.
|
|
44
|
+
We used the following simplification${(simplifications?.length ?? 0) + cfg_simplification_1.DefaultCfgSimplificationOrder.length !== 1 ? 's' : ''}: ${[...cfg_simplification_1.DefaultCfgSimplificationOrder, ...simplifications].map(s => '`' + s + '`').join(', ')} ${simplify ? ' and render a simplified/compacted version' : ''}.
|
|
45
45
|
`;
|
|
46
46
|
return '\n\n' + printCfg(res.info, res.ast, prefix, simplify) + (showCode ? `
|
|
47
47
|
<details${openCode ? ' open' : ''}>
|
|
@@ -2,10 +2,11 @@ import type { DataflowGraph, UnknownSideEffect } from '../../dataflow/graph/grap
|
|
|
2
2
|
import type { DEFAULT_DATAFLOW_PIPELINE } from '../../core/steps/pipeline/default-pipelines';
|
|
3
3
|
import type { PipelineOutput } from '../../core/steps/pipeline/pipeline';
|
|
4
4
|
import type { KnownParser } from '../../r-bridge/parser';
|
|
5
|
+
import type { GeneralDocContext } from '../wiki-mk/doc-context';
|
|
5
6
|
import type { MermaidMarkdownMark } from '../../util/mermaid/info';
|
|
6
7
|
/**
|
|
7
8
|
* Visualizes the dataflow graph as a mermaid graph inside a markdown code block.
|
|
8
|
-
* Please use this only for documentation purposes, for programmatic usage use {@link
|
|
9
|
+
* Please use this only for documentation purposes, for programmatic usage use {@link DataflowMermaid.convert} directly.
|
|
9
10
|
*/
|
|
10
11
|
export declare function printDfGraph(graph: DataflowGraph, mark?: ReadonlySet<MermaidMarkdownMark>, simplified?: boolean): string;
|
|
11
12
|
/**
|
|
@@ -19,6 +20,7 @@ export interface PrintDataflowGraphOptions {
|
|
|
19
20
|
readonly switchCodeAndGraph?: boolean;
|
|
20
21
|
readonly simplified?: boolean;
|
|
21
22
|
readonly callGraph?: boolean;
|
|
23
|
+
readonly ctx?: GeneralDocContext;
|
|
22
24
|
}
|
|
23
25
|
/**
|
|
24
26
|
* Visualizes a side effect for documentation purposes.
|
|
@@ -15,7 +15,7 @@ const df_helper_1 = require("../../dataflow/graph/df-helper");
|
|
|
15
15
|
const call_graph_1 = require("../../dataflow/graph/call-graph");
|
|
16
16
|
/**
|
|
17
17
|
* Visualizes the dataflow graph as a mermaid graph inside a markdown code block.
|
|
18
|
-
* Please use this only for documentation purposes, for programmatic usage use {@link
|
|
18
|
+
* Please use this only for documentation purposes, for programmatic usage use {@link DataflowMermaid.convert} directly.
|
|
19
19
|
*/
|
|
20
20
|
function printDfGraph(graph, mark, simplified = false) {
|
|
21
21
|
return `
|
|
@@ -43,7 +43,7 @@ function formatSideEffect(ef) {
|
|
|
43
43
|
* This function returns a markdown string containing the dataflow graph as a mermaid code block,
|
|
44
44
|
* along with the R code itself in a collapsible section.
|
|
45
45
|
*/
|
|
46
|
-
async function printDfGraphForCode(parser, code, { callGraph = false, simplified = false, mark, showCode = true, codeOpen = false, exposeResult, switchCodeAndGraph = false } = {}) {
|
|
46
|
+
async function printDfGraphForCode(parser, code, { callGraph = false, simplified = false, mark, showCode = true, codeOpen = false, exposeResult, switchCodeAndGraph = false, ctx } = {}) {
|
|
47
47
|
const now = performance.now();
|
|
48
48
|
const result = await (0, default_pipelines_1.createDataflowPipeline)(parser, {
|
|
49
49
|
context: (0, flowr_analyzer_context_1.contextFromInput)(code)
|
|
@@ -52,7 +52,7 @@ async function printDfGraphForCode(parser, code, { callGraph = false, simplified
|
|
|
52
52
|
if (switchCodeAndGraph) {
|
|
53
53
|
(0, assert_1.guard)(showCode, 'can not switch code and graph if code is not shown');
|
|
54
54
|
}
|
|
55
|
-
const metaInfo = `The analysis required _${(0, time_1.printAsMs)(duration)}_ (including parse and normalize, using the [${parser.name}](${doc_files_1.FlowrWikiBaseRef}/Engines) engine) within the generation environment.`;
|
|
55
|
+
const metaInfo = `The analysis required _${(0, time_1.printAsMs)(duration)}_ (including parse and normalize, using the ${ctx ? ctx.linkPage('wiki/Engines', parser.name) : `[${parser.name}](${doc_files_1.FlowrWikiBaseRef}/Engines)`} engine) within the generation environment.`;
|
|
56
56
|
const graph = callGraph ? call_graph_1.CallGraph.compute(result.dataflow.graph) : result.dataflow.graph;
|
|
57
57
|
const dfGraph = printDfGraph(graph, mark, simplified);
|
|
58
58
|
const simplyText = simplified ? '(simplified) ' : '';
|
|
@@ -11,10 +11,12 @@ export declare const FlowrVsCode = "https://marketplace.visualstudio.com/items?i
|
|
|
11
11
|
export declare const FlowrPositron = "https://open-vsx.org/extension/code-inspect/vscode-flowr";
|
|
12
12
|
export declare const FlowrRStudioAddin = "https://github.com/flowr-analysis/rstudio-addin-flowr";
|
|
13
13
|
export declare const FlowrRAdapter = "https://github.com/flowr-analysis/flowr-r-adapter";
|
|
14
|
+
/** Converts backslashes to forward slashes (Windows paths). */
|
|
15
|
+
export declare function toPosixPath(p: string): string;
|
|
14
16
|
/**
|
|
15
17
|
* Returns a markdown link to the given file path relative to the project root.
|
|
16
18
|
*/
|
|
17
|
-
export declare function getFilePathMd(
|
|
19
|
+
export declare function getFilePathMd(filePath: string): string;
|
|
18
20
|
/**
|
|
19
21
|
* Returns the content of a file located at the given path relative to the project root.
|
|
20
22
|
* This reads the file synchronously from disk.
|
|
@@ -4,10 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.FlowrRAdapter = exports.FlowrRStudioAddin = exports.FlowrPositron = exports.FlowrVsCode = exports.FlowrCodecovRef = exports.FlowrDockerRef = exports.FlowrNpmRef = exports.FlowrGithubRef = exports.FlowrWikiBaseRef = exports.RemoteFlowrFilePathBaseRef = exports.FlowrSiteBaseRef = exports.FlowrGithubBaseRef = exports.FlowrGithubGroupName = void 0;
|
|
7
|
+
exports.toPosixPath = toPosixPath;
|
|
7
8
|
exports.getFilePathMd = getFilePathMd;
|
|
8
9
|
exports.getFileContentFromRoot = getFileContentFromRoot;
|
|
9
10
|
exports.linkFlowRSourceFile = linkFlowRSourceFile;
|
|
10
11
|
const fs_1 = __importDefault(require("fs"));
|
|
12
|
+
const path_1 = __importDefault(require("path"));
|
|
11
13
|
exports.FlowrGithubGroupName = 'flowr-analysis';
|
|
12
14
|
exports.FlowrGithubBaseRef = `https://github.com/${exports.FlowrGithubGroupName}`;
|
|
13
15
|
exports.FlowrSiteBaseRef = `https://${exports.FlowrGithubGroupName}.github.io/flowr`;
|
|
@@ -21,16 +23,17 @@ exports.FlowrVsCode = 'https://marketplace.visualstudio.com/items?itemName=code-
|
|
|
21
23
|
exports.FlowrPositron = 'https://open-vsx.org/extension/code-inspect/vscode-flowr';
|
|
22
24
|
exports.FlowrRStudioAddin = `${exports.FlowrGithubBaseRef}/rstudio-addin-flowr`;
|
|
23
25
|
exports.FlowrRAdapter = `${exports.FlowrGithubBaseRef}/flowr-r-adapter`;
|
|
26
|
+
/** Converts backslashes to forward slashes (Windows paths). */
|
|
27
|
+
function toPosixPath(p) {
|
|
28
|
+
return p.replaceAll('\\', '/');
|
|
29
|
+
}
|
|
24
30
|
/**
|
|
25
31
|
* Returns a markdown link to the given file path relative to the project root.
|
|
26
32
|
*/
|
|
27
|
-
function getFilePathMd(
|
|
33
|
+
function getFilePathMd(filePath) {
|
|
28
34
|
// we go one up as we are in doc-util now :D #convenience
|
|
29
|
-
const fullpath = require.resolve('../' +
|
|
30
|
-
|
|
31
|
-
const cwd = process.cwd().replaceAll('\\', '/');
|
|
32
|
-
const relative = fullpath.replaceAll('\\', '/').replace(cwd, '.');
|
|
33
|
-
/* remove project prefix */
|
|
35
|
+
const fullpath = require.resolve('../' + filePath);
|
|
36
|
+
const relative = './' + toPosixPath(path_1.default.relative(process.cwd(), fullpath));
|
|
34
37
|
return `[\`${relative}\`](${exports.RemoteFlowrFilePathBaseRef}${relative})`;
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { type ParentInformation, type RNodeWithParent } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
2
2
|
import type { KnownParser } from '../../r-bridge/parser';
|
|
3
|
+
import type { GeneralDocContext } from '../wiki-mk/doc-context';
|
|
3
4
|
import type { RProject } from '../../r-bridge/lang-4.x/ast/model/nodes/r-project';
|
|
4
5
|
/**
|
|
5
6
|
* Visualizes the normalized AST using mermaid syntax.
|
|
@@ -9,9 +10,10 @@ export declare function printNormalizedAst(ast: RProject<ParentInformation> | RN
|
|
|
9
10
|
export interface PrintNormalizedAstOptions {
|
|
10
11
|
readonly showCode?: boolean;
|
|
11
12
|
readonly prefix?: string;
|
|
13
|
+
readonly ctx?: GeneralDocContext;
|
|
12
14
|
}
|
|
13
15
|
/**
|
|
14
16
|
* Generates and prints the normalized AST for the given code, along with optional metadata and the original code.
|
|
15
17
|
* This is intended for documentation purposes.
|
|
16
18
|
*/
|
|
17
|
-
export declare function printNormalizedAstForCode(parser: KnownParser, code: string, { showCode, prefix }?: PrintNormalizedAstOptions): Promise<string>;
|
|
19
|
+
export declare function printNormalizedAstForCode(parser: KnownParser, code: string, { showCode, prefix, ctx }?: PrintNormalizedAstOptions): Promise<string>;
|
|
@@ -22,13 +22,13 @@ ${(0, ast_1.normalizedAstToMermaid)(ast, { prefix })}
|
|
|
22
22
|
* Generates and prints the normalized AST for the given code, along with optional metadata and the original code.
|
|
23
23
|
* This is intended for documentation purposes.
|
|
24
24
|
*/
|
|
25
|
-
async function printNormalizedAstForCode(parser, code, { showCode = true, prefix = 'flowchart TD\n' } = {}) {
|
|
25
|
+
async function printNormalizedAstForCode(parser, code, { showCode = true, prefix = 'flowchart TD\n', ctx } = {}) {
|
|
26
26
|
const now = performance.now();
|
|
27
27
|
const result = await (0, default_pipelines_1.createNormalizePipeline)(parser, {
|
|
28
28
|
context: (0, flowr_analyzer_context_1.contextFromInput)(code)
|
|
29
29
|
}).allRemainingSteps();
|
|
30
30
|
const duration = performance.now() - now;
|
|
31
|
-
const metaInfo = `The analysis required _${(0, time_1.printAsMs)(duration)}_ (including parsing with the [${parser.name}](${doc_files_1.FlowrWikiBaseRef}/Engines) engine) within the generation environment.`;
|
|
31
|
+
const metaInfo = `The analysis required _${(0, time_1.printAsMs)(duration)}_ (including parsing with the ${ctx ? ctx.linkPage('wiki/Engines', parser.name) : `[${parser.name}](${doc_files_1.FlowrWikiBaseRef}/Engines)`} engine) within the generation environment.`;
|
|
32
32
|
return '\n\n' + printNormalizedAst(result.normalize.ast, prefix) + (showCode ? `
|
|
33
33
|
<details>
|
|
34
34
|
|
|
@@ -10,11 +10,12 @@ export interface ShowQueryOptions {
|
|
|
10
10
|
readonly collapseResult?: boolean;
|
|
11
11
|
readonly collapseQuery?: boolean;
|
|
12
12
|
readonly shorthand?: string;
|
|
13
|
+
readonly ctx?: GeneralDocContext;
|
|
13
14
|
}
|
|
14
15
|
/**
|
|
15
16
|
* Visualizes a query and its results in markdown format.
|
|
16
17
|
*/
|
|
17
|
-
export declare function showQuery<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>>(parser: KnownParser, code: string, queries: Queries<Base, VirtualArguments>, { showCode, collapseResult, collapseQuery, shorthand }?: ShowQueryOptions): Promise<string>;
|
|
18
|
+
export declare function showQuery<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>>(parser: KnownParser, code: string, queries: Queries<Base, VirtualArguments>, { showCode, collapseResult, collapseQuery, shorthand, ctx }?: ShowQueryOptions): Promise<string>;
|
|
18
19
|
export interface QueryDocumentation {
|
|
19
20
|
readonly name: string;
|
|
20
21
|
readonly type: 'virtual' | 'active';
|
|
@@ -19,7 +19,7 @@ const doc_cli_option_1 = require("./doc-cli-option");
|
|
|
19
19
|
/**
|
|
20
20
|
* Visualizes a query and its results in markdown format.
|
|
21
21
|
*/
|
|
22
|
-
async function showQuery(parser, code, queries, { showCode, collapseResult, collapseQuery, shorthand } = {}) {
|
|
22
|
+
async function showQuery(parser, code, queries, { showCode, collapseResult, collapseQuery, shorthand, ctx } = {}) {
|
|
23
23
|
const now = performance.now();
|
|
24
24
|
const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder().setParser(parser).build();
|
|
25
25
|
analyzer.addRequest(code);
|
|
@@ -53,7 +53,7 @@ ${await (0, query_print_1.asciiSummaryOfQueryResult)(ansi_1.markdownFormatter, d
|
|
|
53
53
|
${metaInfo}
|
|
54
54
|
|
|
55
55
|
In general, the JSON contains the Ids of the nodes in question as they are present in the normalized AST or the dataflow graph of flowR.
|
|
56
|
-
Please consult the [Interface](${doc_files_1.FlowrWikiBaseRef}/Interface) wiki page for more information on how to get those.
|
|
56
|
+
Please consult the ${ctx ? ctx.linkPage('wiki/Interface', 'Interface') : `[Interface](${doc_files_1.FlowrWikiBaseRef}/Interface)`} wiki page for more information on how to get those.
|
|
57
57
|
|
|
58
58
|
${(0, doc_code_1.jsonWithLimit)(results)}
|
|
59
59
|
|
|
@@ -59,6 +59,7 @@ async function documentReplSession(parser, commands, options) {
|
|
|
59
59
|
const entry = { command, lines: [] };
|
|
60
60
|
const collectingOutput = {
|
|
61
61
|
formatter: ansi_1.voidFormatter,
|
|
62
|
+
allowClipboard: false,
|
|
62
63
|
stdout(msg) {
|
|
63
64
|
entry.lines.push(dropAnsiEscapeCodesAndCodeTags(msg));
|
|
64
65
|
},
|
|
@@ -57,7 +57,7 @@ export declare function removeCommentSymbolsFromTypeScriptComment(comment: strin
|
|
|
57
57
|
export declare function getStartLineOfTypeScriptNode(node: ts.Node, sourceFile: ts.SourceFile): number;
|
|
58
58
|
/**
|
|
59
59
|
* Return the link to the type in the source code.
|
|
60
|
-
* If you create a wiki, please refer to the functions provided by the {@link
|
|
60
|
+
* If you create a wiki, please refer to the functions provided by the {@link GeneralDocContext}.
|
|
61
61
|
*/
|
|
62
62
|
export declare function getTypePathLink(elem: Pick<TypeElementInSource, 'filePath' | 'lineNumber'>, relative?: boolean): string;
|
|
63
63
|
export interface MermaidClassDiagramArguments {
|
|
@@ -111,7 +111,7 @@ export interface PrintHierarchyArguments {
|
|
|
111
111
|
export declare const mermaidHide: string[];
|
|
112
112
|
/**
|
|
113
113
|
* Print the hierarchy of types starting from the given root.
|
|
114
|
-
* If you create a wiki, please refer to the functions provided by the {@link
|
|
114
|
+
* If you create a wiki, please refer to the functions provided by the {@link GeneralDocContext}.
|
|
115
115
|
*/
|
|
116
116
|
export declare function printHierarchy({ program, info, root, ignoredTypes, collapseFromNesting, initialNesting, maxDepth, skipNesting, openTop, showImplSnippet, reverse }: PrintHierarchyArguments): string;
|
|
117
117
|
/**
|
|
@@ -135,14 +135,14 @@ export interface FnElementInfo {
|
|
|
135
135
|
}
|
|
136
136
|
/**
|
|
137
137
|
* Print an element from the info as code block.
|
|
138
|
-
* If you create a wiki, please refer to the functions provided by the {@link
|
|
138
|
+
* If you create a wiki, please refer to the functions provided by the {@link GeneralDocContext}.
|
|
139
139
|
*
|
|
140
140
|
* This is great to show examples that are directly taken from the source code.
|
|
141
141
|
*/
|
|
142
142
|
export declare function printCodeOfElement(info: FnElementInfo, name: string): string;
|
|
143
143
|
/**
|
|
144
144
|
* Print a source file as code block.
|
|
145
|
-
* If you create a wiki, please refer to the functions provided by the {@link
|
|
145
|
+
* If you create a wiki, please refer to the functions provided by the {@link GeneralDocContext}.
|
|
146
146
|
*
|
|
147
147
|
* This is great to show examples that are directly taken from the source code.
|
|
148
148
|
*/
|
|
@@ -161,7 +161,7 @@ export declare function printCodeOfFile(info: FnElementInfo, relativePath: strin
|
|
|
161
161
|
export declare function shortLink(name: string, hierarchy: readonly TypeElementInSource[], codeStyle?: boolean, realNameWrapper?: string, fuzzy?: boolean, type?: TypeElementKind): string;
|
|
162
162
|
/**
|
|
163
163
|
* Create a short link to a type in the documentation.
|
|
164
|
-
* If you create a wiki, please refer to the functions provided by the {@link
|
|
164
|
+
* If you create a wiki, please refer to the functions provided by the {@link GeneralDocContext}.
|
|
165
165
|
* @param name - The name of the type, e.g. `MyType`, may include a container, e.g.,`MyContainer::MyType` (this works with function nestings too)
|
|
166
166
|
* Use `:::` if you want to access a scoped function, but the name should be displayed without the scope
|
|
167
167
|
* @param hierarchy - The hierarchy of types to search in
|
|
@@ -173,7 +173,7 @@ export interface GetDocumentationForTypeFilters {
|
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
175
|
* Retrieve documentation comments for a type.
|
|
176
|
-
* If you create a wiki, please refer to the functions provided by the {@link
|
|
176
|
+
* If you create a wiki, please refer to the functions provided by the {@link GeneralDocContext}.
|
|
177
177
|
* @param name - The name of the type, e.g. `MyType`, may include a container, e.g.,`MyContainer::MyType` (this works with function nestings too)
|
|
178
178
|
* Use `:::` if you want to access a scoped function, but the name should be displayed without the scope
|
|
179
179
|
* @param hierarchy - The hierarchy of types to search in
|