@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
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.computeCallGraphSummaries = computeCallGraphSummaries;
|
|
4
|
+
exports.linkMaterializedExportsToLoaders = linkMaterializedExportsToLoaders;
|
|
5
|
+
exports.reResolveOpenReferences = reResolveOpenReferences;
|
|
6
|
+
exports.propagateTransitiveSideEffects = propagateTransitiveSideEffects;
|
|
7
|
+
const vertex_1 = require("../../../../../graph/vertex");
|
|
8
|
+
const edge_1 = require("../../../../../graph/edge");
|
|
9
|
+
const node_id_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
10
|
+
const environment_1 = require("../../../../../environments/environment");
|
|
11
|
+
const built_in_library_1 = require("./built-in-library");
|
|
12
|
+
const define_1 = require("../../../../../environments/define");
|
|
13
|
+
const resolve_by_name_1 = require("../../../../../environments/resolve-by-name");
|
|
14
|
+
/**
|
|
15
|
+
* The function-definition vertices a `call` resolves to (via {@link EdgeType.Calls}).
|
|
16
|
+
*/
|
|
17
|
+
function calledDefinitions(graph, call) {
|
|
18
|
+
const targets = [];
|
|
19
|
+
for (const [target, edge] of graph.outgoingEdges(call) ?? []) {
|
|
20
|
+
if ((edge.types & edge_1.EdgeType.Calls) !== 0 && graph.getVertex(target)?.tag === vertex_1.VertexType.FunctionDefinition) {
|
|
21
|
+
targets.push(target);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return targets;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Computes, for every function-definition vertex `F`, `summary(F) = own(F)` unioned with `summary(G)` over every transitive callee `G`.
|
|
28
|
+
* @param graph - the fully linked dataflow graph
|
|
29
|
+
* @param own - the effects a single function definition produces itself (its contribution to the summary)
|
|
30
|
+
* @returns a map from each function-definition vertex to its transitive-effect summary
|
|
31
|
+
*/
|
|
32
|
+
function computeCallGraphSummaries(graph, own) {
|
|
33
|
+
const summary = new Map();
|
|
34
|
+
const callees = new Map();
|
|
35
|
+
for (const [id, vertex] of graph.vertices(true)) {
|
|
36
|
+
if (vertex.tag !== vertex_1.VertexType.FunctionDefinition) {
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
39
|
+
summary.set(id, new Set(own(id, vertex)));
|
|
40
|
+
const targets = [];
|
|
41
|
+
for (const node of vertex.subflow.graph) {
|
|
42
|
+
if (graph.getVertex(node)?.tag === vertex_1.VertexType.FunctionCall) {
|
|
43
|
+
targets.push(...calledDefinitions(graph, node));
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
callees.set(id, targets);
|
|
47
|
+
}
|
|
48
|
+
if (summary.size === 0) {
|
|
49
|
+
return summary;
|
|
50
|
+
}
|
|
51
|
+
// reverse edges: callers of each function
|
|
52
|
+
const callers = new Map();
|
|
53
|
+
for (const [id, targets] of callees) {
|
|
54
|
+
for (const callee of targets) {
|
|
55
|
+
const existing = callers.get(callee);
|
|
56
|
+
if (existing === undefined) {
|
|
57
|
+
callers.set(callee, [id]);
|
|
58
|
+
}
|
|
59
|
+
else {
|
|
60
|
+
existing.push(id);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// worklist fixpoint: pull each callee's summary, re-enqueue callers when a function grew
|
|
65
|
+
const queue = [...summary.keys()];
|
|
66
|
+
const queued = new Set(queue);
|
|
67
|
+
while (queue.length > 0) {
|
|
68
|
+
const id = queue.pop();
|
|
69
|
+
queued.delete(id);
|
|
70
|
+
const effects = summary.get(id);
|
|
71
|
+
let grew = false;
|
|
72
|
+
for (const callee of callees.get(id) ?? []) {
|
|
73
|
+
for (const effect of summary.get(callee) ?? []) {
|
|
74
|
+
if (!effects.has(effect)) {
|
|
75
|
+
effects.add(effect);
|
|
76
|
+
grew = true;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
if (grew) {
|
|
81
|
+
for (const caller of callers.get(id) ?? []) {
|
|
82
|
+
if (!queued.has(caller)) {
|
|
83
|
+
queued.add(caller);
|
|
84
|
+
queue.push(caller);
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return summary;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Links every materialized package-export vertex back to the `library()`/`use()` call that loaded it,
|
|
93
|
+
* reading the loading call from the export binding's `definedAt` in the (final, authoritative) environment.
|
|
94
|
+
* Only vertices created on demand (exports actually referenced) get an edge, keeping the graph small.
|
|
95
|
+
*/
|
|
96
|
+
function linkMaterializedExportsToLoaders(graph, environment) {
|
|
97
|
+
// export node id -> its loading `library()`/`use()` call, from the final environment
|
|
98
|
+
const loaders = new Map();
|
|
99
|
+
for (let e = environment.current; e !== undefined && !e.builtInEnv; e = e.parent) {
|
|
100
|
+
if (e.t !== environment_1.EnvType.Namespace) {
|
|
101
|
+
continue;
|
|
102
|
+
}
|
|
103
|
+
for (const defs of e.memory.values()) {
|
|
104
|
+
for (const d of defs) {
|
|
105
|
+
if (!node_id_1.NodeId.isBuiltIn(d.definedAt)) {
|
|
106
|
+
loaders.set(d.nodeId, d.definedAt);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
// only exports actually called (a materialized vertex or the target of a `calls` edge) get a loader edge
|
|
112
|
+
for (const [id, loadedAt] of loaders) {
|
|
113
|
+
const called = graph.hasVertex(id)
|
|
114
|
+
|| [...graph.ingoingEdges(id)?.values() ?? []].some(e => edge_1.DfEdge.includesType(e, edge_1.EdgeType.Calls));
|
|
115
|
+
if (called) {
|
|
116
|
+
graph.addEdge(id, loadedAt, edge_1.EdgeType.Reads | edge_1.EdgeType.Calls);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
/** The packages (see {@link EnvType}) attached directly within a function body, i.e. its own `library()` calls. */
|
|
121
|
+
function attachedPackages(_id, fdef) {
|
|
122
|
+
const packages = [];
|
|
123
|
+
for (let e = fdef.subflow.environment.current; e !== undefined && !e.builtInEnv; e = e.parent) {
|
|
124
|
+
if (e.t === environment_1.EnvType.Namespace && e.n !== undefined) {
|
|
125
|
+
// an export binding carries the loading `library()` call in `definedAt`
|
|
126
|
+
let definedAt = node_id_1.NodeId.toBuiltIn(e.n);
|
|
127
|
+
for (const defs of e.memory.values()) {
|
|
128
|
+
const real = defs.find(d => !node_id_1.NodeId.isBuiltIn(d.definedAt));
|
|
129
|
+
if (real !== undefined) {
|
|
130
|
+
definedAt = real.definedAt;
|
|
131
|
+
break;
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
packages.push({ pack: e.n, definedAt });
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
return packages;
|
|
138
|
+
}
|
|
139
|
+
/** The non-built-in definitions a function body lets escape to an outer scope (e.g. a `<<-` super-assignment). */
|
|
140
|
+
function escapedDefinitions(_id, fdef) {
|
|
141
|
+
const defs = [];
|
|
142
|
+
// skip the function's own frame; outer-scope definitions escaped
|
|
143
|
+
for (let e = fdef.subflow.environment.current.parent; e !== undefined && !e.builtInEnv; e = e.parent) {
|
|
144
|
+
for (const definitions of e.memory.values()) {
|
|
145
|
+
for (const def of definitions) {
|
|
146
|
+
if (!node_id_1.NodeId.isBuiltIn(def.nodeId)) {
|
|
147
|
+
defs.push(def.nodeId);
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
return defs;
|
|
153
|
+
}
|
|
154
|
+
/** Emits {@link EdgeType.SideEffectOnCall} edges for definitions that escape a function transitively. */
|
|
155
|
+
function propagateTransitiveDefinitions(graph, environment, ctx) {
|
|
156
|
+
const summary = computeCallGraphSummaries(graph, escapedDefinitions);
|
|
157
|
+
for (const [id, vertex] of graph.vertices(true)) {
|
|
158
|
+
if (vertex.tag !== vertex_1.VertexType.FunctionCall) {
|
|
159
|
+
continue;
|
|
160
|
+
}
|
|
161
|
+
for (const target of calledDefinitions(graph, id)) {
|
|
162
|
+
for (const def of summary.get(target) ?? []) {
|
|
163
|
+
// an escaping package export is only in the environment; materialize its vertex on demand
|
|
164
|
+
if (node_id_1.NodeId.isBuiltIn(def)) {
|
|
165
|
+
(0, built_in_library_1.attachExportVertex)(graph, def, environment, ctx);
|
|
166
|
+
}
|
|
167
|
+
graph.addEdge(def, id, edge_1.EdgeType.SideEffectOnCall);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Attaches packages transitively loaded by top-level calls to `environment`.
|
|
174
|
+
* `g <- function() library(A); f <- function() g(); f()` makes `A` available after `f()`.
|
|
175
|
+
* @returns the enriched environment and whether it grew (so the caller can re-link and re-run to a fixpoint).
|
|
176
|
+
*/
|
|
177
|
+
function propagateTransitivePackages(graph, environment, ctx) {
|
|
178
|
+
const summary = computeCallGraphSummaries(graph, attachedPackages);
|
|
179
|
+
const reachable = new Map(); // package -> its loading `library()` call
|
|
180
|
+
for (const [id, vertex] of graph.vertices(true)) {
|
|
181
|
+
if (vertex.tag !== vertex_1.VertexType.FunctionCall || !graph.isRoot(id)) {
|
|
182
|
+
continue;
|
|
183
|
+
}
|
|
184
|
+
for (const target of calledDefinitions(graph, id)) {
|
|
185
|
+
for (const { pack, definedAt } of summary.get(target) ?? []) {
|
|
186
|
+
if (!reachable.has(pack)) {
|
|
187
|
+
reachable.set(pack, definedAt);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
let grew = false;
|
|
193
|
+
for (const [pack, definedAt] of reachable) {
|
|
194
|
+
const dependency = ctx.deps.getDependency(pack);
|
|
195
|
+
if (dependency === undefined) {
|
|
196
|
+
continue;
|
|
197
|
+
}
|
|
198
|
+
const next = (0, built_in_library_1.attachDependencyToEnvironment)(dependency, environment, ctx, {}, definedAt);
|
|
199
|
+
if (next !== environment) {
|
|
200
|
+
environment = next;
|
|
201
|
+
grew = true;
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
return { environment, grew };
|
|
205
|
+
}
|
|
206
|
+
/** Maps each escaped definition's node id to its full (name-carrying) definition. */
|
|
207
|
+
function escapedDefinitionMap(graph) {
|
|
208
|
+
const map = new Map();
|
|
209
|
+
for (const [, vertex] of graph.vertices(true)) {
|
|
210
|
+
if (vertex.tag !== vertex_1.VertexType.FunctionDefinition) {
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
for (let e = vertex.subflow.environment.current.parent; e !== undefined && !e.builtInEnv; e = e.parent) {
|
|
214
|
+
for (const definitions of e.memory.values()) {
|
|
215
|
+
for (const def of definitions) {
|
|
216
|
+
if (!node_id_1.NodeId.isBuiltIn(def.nodeId) && def.name !== undefined) {
|
|
217
|
+
map.set(def.nodeId, def);
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
return map;
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Folds the `<<-` definitions that escape transitively from top-level calls into `environment`.
|
|
227
|
+
* `f <- function() x <<- 1; g <- function() f(); g(); print(x)` makes `x` resolvable.
|
|
228
|
+
* @returns the enriched environment and whether it grew (so the extractor can re-resolve open reads and re-run).
|
|
229
|
+
*/
|
|
230
|
+
function propagateTransitiveEscapedDefinitions(graph, environment) {
|
|
231
|
+
const summary = computeCallGraphSummaries(graph, escapedDefinitions);
|
|
232
|
+
const defs = escapedDefinitionMap(graph);
|
|
233
|
+
const names = new Set();
|
|
234
|
+
let grew = false;
|
|
235
|
+
for (const [id, vertex] of graph.vertices(true)) {
|
|
236
|
+
if (vertex.tag !== vertex_1.VertexType.FunctionCall || !graph.isRoot(id)) {
|
|
237
|
+
continue;
|
|
238
|
+
}
|
|
239
|
+
for (const target of calledDefinitions(graph, id)) {
|
|
240
|
+
for (const nodeId of summary.get(target) ?? []) {
|
|
241
|
+
const def = defs.get(nodeId);
|
|
242
|
+
if (def === undefined) {
|
|
243
|
+
continue;
|
|
244
|
+
}
|
|
245
|
+
names.add(def.name);
|
|
246
|
+
if ((0, resolve_by_name_1.resolveByName)(def.name, environment, def.type)?.some(d => d.nodeId === nodeId)) {
|
|
247
|
+
continue;
|
|
248
|
+
}
|
|
249
|
+
environment = (0, define_1.define)(def, false, environment);
|
|
250
|
+
grew = true;
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
return { environment, grew, names };
|
|
255
|
+
}
|
|
256
|
+
/** Re-resolves still-open reads whose name is one of the transitively escaped `<<-` definitions in `escapedNames`, adding {@link EdgeType.Reads} edges. */
|
|
257
|
+
function reResolveOpenReferences(graph, environment, references, escapedNames) {
|
|
258
|
+
for (const ref of references) {
|
|
259
|
+
if (ref.name === undefined || !escapedNames.has(String(ref.name))) {
|
|
260
|
+
continue;
|
|
261
|
+
}
|
|
262
|
+
for (const { nodeId } of (0, resolve_by_name_1.resolveByName)(ref.name, environment, ref.type) ?? []) {
|
|
263
|
+
if (!node_id_1.NodeId.isBuiltIn(nodeId) && nodeId !== ref.nodeId) {
|
|
264
|
+
graph.addEdge(ref.nodeId, nodeId, edge_1.EdgeType.Reads);
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* Propagates every function's escaped side effects (attached packages and `<<-` definitions) to its transitive callers.
|
|
271
|
+
* @returns the enriched top-level environment and whether it grew (so the extractor can re-link and re-run to a fixpoint).
|
|
272
|
+
*/
|
|
273
|
+
function propagateTransitiveSideEffects(graph, environment, ctx) {
|
|
274
|
+
propagateTransitiveDefinitions(graph, environment, ctx);
|
|
275
|
+
const packages = propagateTransitivePackages(graph, environment, ctx);
|
|
276
|
+
const escaped = propagateTransitiveEscapedDefinitions(graph, packages.environment);
|
|
277
|
+
return { environment: escaped.environment, grew: packages.grew || escaped.grew, escapedNames: escaped.names };
|
|
278
|
+
}
|
|
279
|
+
//# sourceMappingURL=transitive-side-effects.js.map
|
|
@@ -40,13 +40,14 @@ function processKnownFunctionCall({ name, args, rootId, data, reverseOrder = fal
|
|
|
40
40
|
if (markAsNSE) {
|
|
41
41
|
markNonStandardEvaluationEdges(markAsNSE, processedArguments, finalGraph, rootId);
|
|
42
42
|
}
|
|
43
|
+
const onlyBuiltin = data.builtInNoEnv === rootId;
|
|
43
44
|
finalGraph.addVertex({
|
|
44
45
|
tag: vertex_1.VertexType.FunctionCall,
|
|
45
46
|
id: rootId,
|
|
46
|
-
environment: data.environment,
|
|
47
|
+
environment: onlyBuiltin ? undefined : data.environment,
|
|
47
48
|
name: functionCallName,
|
|
48
|
-
/*
|
|
49
|
-
onlyBuiltin
|
|
49
|
+
/* may still be overwritten by markAsOnlyBuiltIn */
|
|
50
|
+
onlyBuiltin,
|
|
50
51
|
cds: data.cds,
|
|
51
52
|
args: reverseOrder ? callArgs.toReversed() : callArgs,
|
|
52
53
|
origin: origin === 'default' ? [built_in_proc_name_1.BuiltInProcName.Function] : [origin]
|
|
@@ -3,7 +3,7 @@ import { DataflowInformation } from '../../../../info';
|
|
|
3
3
|
import type { ParentInformation } from '../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
4
|
import type { PotentiallyEmptyRArgument } from '../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
|
|
5
5
|
import type { RSymbol } from '../../../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
|
|
6
|
-
import
|
|
6
|
+
import { NodeId } from '../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
7
7
|
import type { DataflowGraph } from '../../../../graph/graph';
|
|
8
8
|
/**
|
|
9
9
|
* Marks the given function call node as only calling built-in functions.
|
|
@@ -5,9 +5,12 @@ exports.processNamedCall = processNamedCall;
|
|
|
5
5
|
const info_1 = require("../../../../info");
|
|
6
6
|
const known_call_handling_1 = require("./known-call-handling");
|
|
7
7
|
const append_1 = require("../../../../environments/append");
|
|
8
|
+
const node_id_1 = require("../../../../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
8
9
|
const resolve_by_name_1 = require("../../../../environments/resolve-by-name");
|
|
9
10
|
const vertex_1 = require("../../../../graph/vertex");
|
|
10
11
|
const identifier_1 = require("../../../../environments/identifier");
|
|
12
|
+
const edge_1 = require("../../../../graph/edge");
|
|
13
|
+
const built_in_library_1 = require("./built-in/built-in-library");
|
|
11
14
|
function mergeInformation(info, newInfo) {
|
|
12
15
|
if (info === undefined) {
|
|
13
16
|
return newInfo;
|
|
@@ -46,6 +49,12 @@ function markAsOnlyBuiltIn(graph, rootId) {
|
|
|
46
49
|
function processNamedCall(name, args, rootId, data) {
|
|
47
50
|
const resolved = (0, resolve_by_name_1.resolveByName)(name.content, data.environment, identifier_1.ReferenceType.Function) ?? [];
|
|
48
51
|
let defaultProcessor = resolved.length === 0;
|
|
52
|
+
/* if this call will be marked as built-in only (see below), its vertex needs no environment snapshot */
|
|
53
|
+
if (resolved.length > 0
|
|
54
|
+
&& resolved.every(r => r.type === identifier_1.ReferenceType.BuiltInFunction && typeof r.processor === 'function')
|
|
55
|
+
&& resolved.some(r => r.type === identifier_1.ReferenceType.BuiltInFunction && r.config?.libFn !== true)) {
|
|
56
|
+
data = { ...data, builtInNoEnv: rootId };
|
|
57
|
+
}
|
|
49
58
|
let information = undefined;
|
|
50
59
|
let builtIn = false;
|
|
51
60
|
for (const resolvedFunction of resolved) {
|
|
@@ -64,6 +73,20 @@ function processNamedCall(name, args, rootId, data) {
|
|
|
64
73
|
// mark the function call as built in only
|
|
65
74
|
markAsOnlyBuiltIn(information.graph, rootId);
|
|
66
75
|
}
|
|
76
|
+
// on demand: materialize the built-in vertex for any package export this call resolves to and, when we
|
|
77
|
+
// already know the loading call here, link to it (a function-local export is invisible to the later
|
|
78
|
+
// top-level linkMaterializedExportsToLoaders pass, so we must catch it at the call site)
|
|
79
|
+
if (information) {
|
|
80
|
+
for (const r of resolved) {
|
|
81
|
+
if (r.type === identifier_1.ReferenceType.Function && r.nodeId !== undefined && node_id_1.NodeId.isBuiltIn(r.nodeId)) {
|
|
82
|
+
(0, built_in_library_1.attachExportVertex)(information.graph, r.nodeId, data.environment, data.ctx, data.cds);
|
|
83
|
+
const definedAt = r.definedAt;
|
|
84
|
+
if (definedAt !== undefined && !node_id_1.NodeId.isBuiltIn(definedAt)) {
|
|
85
|
+
information.graph.addEdge(r.nodeId, definedAt, edge_1.EdgeType.Reads | edge_1.EdgeType.Calls);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
67
90
|
return information ?? info_1.DataflowInformation.initialize(rootId, data);
|
|
68
91
|
}
|
|
69
92
|
//# sourceMappingURL=named-call-handling.js.map
|
|
@@ -70,7 +70,7 @@ export type Origin = SimpleOrigin | FunctionCallOrigin | BuiltInFunctionOrigin;
|
|
|
70
70
|
* }
|
|
71
71
|
* print(x)
|
|
72
72
|
* ```
|
|
73
|
-
* Requesting the origin of `x` in the `print(x)` node yields two {@link
|
|
73
|
+
* Requesting the origin of `x` in the `print(x)` node yields two {@link SimpleOrigin|variable origins} for both
|
|
74
74
|
* definitions of `x`.
|
|
75
75
|
* Similarly, requesting the origin of `print` returns a {@link BuiltInFunctionOrigin|`BuiltInFunctionOrigin`}.
|
|
76
76
|
*
|
|
@@ -16,7 +16,7 @@ const assert_1 = require("../../util/assert");
|
|
|
16
16
|
* }
|
|
17
17
|
* print(x)
|
|
18
18
|
* ```
|
|
19
|
-
* Requesting the origin of `x` in the `print(x)` node yields two {@link
|
|
19
|
+
* Requesting the origin of `x` in the `print(x)` node yields two {@link SimpleOrigin|variable origins} for both
|
|
20
20
|
* definitions of `x`.
|
|
21
21
|
* Similarly, requesting the origin of `print` returns a {@link BuiltInFunctionOrigin|`BuiltInFunctionOrigin`}.
|
|
22
22
|
*
|
package/dataflow/processor.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import type { REnvironmentInformation } from './environments/environment';
|
|
|
7
7
|
import type { RNode } from '../r-bridge/lang-4.x/ast/model/model';
|
|
8
8
|
import type { KnownParserType, Parser } from '../r-bridge/parser';
|
|
9
9
|
import type { FlowrAnalyzerContext } from '../project/context/flowr-analyzer-context';
|
|
10
|
+
import type { NodeId } from '../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
10
11
|
export interface DataflowProcessorInformation<OtherInfo> {
|
|
11
12
|
readonly parser: Parser<KnownParserType>;
|
|
12
13
|
/**
|
|
@@ -35,6 +36,11 @@ export interface DataflowProcessorInformation<OtherInfo> {
|
|
|
35
36
|
* The flowr context used for environment seeding, files, and precision control, ...
|
|
36
37
|
*/
|
|
37
38
|
readonly ctx: FlowrAnalyzerContext;
|
|
39
|
+
/**
|
|
40
|
+
* If set, the function call with this id is known to resolve to built-ins only,
|
|
41
|
+
* so its vertex needs no environment snapshot (it would be discarded by markAsOnlyBuiltIn anyway).
|
|
42
|
+
*/
|
|
43
|
+
readonly builtInNoEnv?: NodeId;
|
|
38
44
|
}
|
|
39
45
|
export type DataflowProcessor<OtherInfo, NodeType extends RNodeWithParent<OtherInfo>> = (node: NodeType, data: DataflowProcessorInformation<OtherInfo>) => DataflowInformation;
|
|
40
46
|
type NodeWithKey<OtherInfo, Key> = RNode<OtherInfo & ParentInformation> & {
|
|
@@ -8,79 +8,100 @@ const recommended_configs_1 = require("./recommended-configs");
|
|
|
8
8
|
/**
|
|
9
9
|
*
|
|
10
10
|
*/
|
|
11
|
-
function registerFaqs() {
|
|
11
|
+
function registerFaqs(ctx) {
|
|
12
12
|
const wikiFaq = new wiki_faq_store_1.FaqStore();
|
|
13
13
|
wikiFaq.withTopic('flowr.development')
|
|
14
|
-
.addFaq('What are *test labels*?', `
|
|
15
|
-
Tests are labeled based on the *flowR* capabilities that they test for.
|
|
16
|
-
The list of supported capabilities can be found on the
|
|
17
|
-
For more extensive information on test labels, see the
|
|
14
|
+
.addFaq('What are *test labels*?', `
|
|
15
|
+
Tests are labeled based on the *flowR* capabilities that they test for.
|
|
16
|
+
The list of supported capabilities can be found on the ${ctx.linkPage('wiki/Capabilities', 'Capabilities')} wiki page.
|
|
17
|
+
For more extensive information on test labels, see the ${ctx.linkPage('wiki/Linting and Testing', 'test labels wiki section', 'test-labels')}.
|
|
18
18
|
`)
|
|
19
|
-
.addFaq('How to get a REPL with debug-info/*hot-reload*?', `
|
|
20
|
-
To enter the development repl, execute \`npm run main-dev\` in contrast to \`npm run flowr\`
|
|
21
|
-
this will use an unminified build (keeping debug info) and also watches the source files for changes.
|
|
22
|
-
In case of a change, this mode automatically recompiles.
|
|
23
|
-
Please note, that this may have negative performance implications (so do not use this for e.g., benchmarking).
|
|
19
|
+
.addFaq('How to get a REPL with debug-info/*hot-reload*?', `
|
|
20
|
+
To enter the development repl, execute \`npm run main-dev\` in contrast to \`npm run flowr\`
|
|
21
|
+
this will use an unminified build (keeping debug info) and also watches the source files for changes.
|
|
22
|
+
In case of a change, this mode automatically recompiles.
|
|
23
|
+
Please note, that this may have negative performance implications (so do not use this for e.g., benchmarking).
|
|
24
24
|
`)
|
|
25
|
-
.addFaq('How to generate *mermaid diagrams*?', `
|
|
26
|
-
There are several ways to generate mermaid diagrams based on the input data that you want to use.
|
|
27
|
-
- From the AST (abstract syntax tree): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/ast.ts')}
|
|
28
|
-
- From the CFG (control flow graph): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/cfg.ts')}
|
|
29
|
-
- From the DFG (dataflow graph): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/dfg.ts')}
|
|
25
|
+
.addFaq('How to generate *mermaid diagrams*?', `
|
|
26
|
+
There are several ways to generate mermaid diagrams based on the input data that you want to use.
|
|
27
|
+
- From the AST (abstract syntax tree): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/ast.ts')}
|
|
28
|
+
- From the CFG (control flow graph): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/cfg.ts')}
|
|
29
|
+
- From the DFG (dataflow graph): ${(0, doc_files_1.getFilePathMd)('../util/mermaid/dfg.ts')}
|
|
30
30
|
`)
|
|
31
|
-
.addFaq('How to create *new wiki* pages?', `
|
|
32
|
-
To create an automatically generated wiki page, you can follow these steps:
|
|
33
|
-
- Create a new file in \`src/documentation\` with a name like \`wiki-thename.ts\`.
|
|
34
|
-
- Register your new wiki page in the \`src/cli/wiki.ts\` file to have it executed by the wiki generation tool.
|
|
35
|
-
|
|
36
|
-
You can test your page by piping the wiki generation script to a file. For example, you can run the following command:
|
|
37
|
-
${(0, doc_code_1.codeBlock)('shell', 'npm run wiki')}
|
|
38
|
-
Alternatively use the following to generate a specific wiki page:
|
|
39
|
-
${(0, doc_code_1.codeBlock)('shell', 'npm run wiki -- --filter=Dataflow')}
|
|
40
|
-
Or, activate the watch mode to automatically regenerate the wiki on changes:
|
|
41
|
-
${(0, doc_code_1.codeBlock)('shell', 'npm run wiki:watch')}
|
|
42
|
-
|
|
31
|
+
.addFaq('How to create *new wiki* pages?', `
|
|
32
|
+
To create an automatically generated wiki page, you can follow these steps:
|
|
33
|
+
- Create a new file in \`src/documentation\` with a name like \`wiki-thename.ts\`.
|
|
34
|
+
- Register your new wiki page in the \`src/cli/wiki.ts\` file to have it executed by the wiki generation tool.
|
|
35
|
+
|
|
36
|
+
You can test your page by piping the wiki generation script to a file. For example, you can run the following command:
|
|
37
|
+
${(0, doc_code_1.codeBlock)('shell', 'npm run wiki')}
|
|
38
|
+
Alternatively use the following to generate a specific wiki page:
|
|
39
|
+
${(0, doc_code_1.codeBlock)('shell', 'npm run wiki -- --filter=Dataflow')}
|
|
40
|
+
Or, activate the watch mode to automatically regenerate the wiki on changes:
|
|
41
|
+
${(0, doc_code_1.codeBlock)('shell', 'npm run wiki:watch')}
|
|
42
|
+
|
|
43
43
|
`)
|
|
44
|
-
.addFaq('Why can\'t I pass *arguments* when running flowR *with npm*?', `
|
|
45
|
-
With \`npm\` you have to pass arguments in a specific way. The \`--\` operator is used to separate the \`npm\` arguments from the script arguments. For example, if you want to run \`flowR\` with the \`--help\` argument, you can use the following command:
|
|
46
|
-
${(0, doc_code_1.codeBlock)('shell', 'npm run flowR -- --help')}
|
|
44
|
+
.addFaq('Why can\'t I pass *arguments* when running flowR *with npm*?', `
|
|
45
|
+
With \`npm\` you have to pass arguments in a specific way. The \`--\` operator is used to separate the \`npm\` arguments from the script arguments. For example, if you want to run \`flowR\` with the \`--help\` argument, you can use the following command:
|
|
46
|
+
${(0, doc_code_1.codeBlock)('shell', 'npm run flowR -- --help')}
|
|
47
47
|
`)
|
|
48
|
-
.addFaq('How to do *logging* in flowR?', `
|
|
49
|
-
Check out the
|
|
48
|
+
.addFaq('How to do *logging* in flowR?', `
|
|
49
|
+
Check out the ${ctx.linkPage('wiki/Linting and Testing', 'Logging Section in the Linting and Testing wiki page', 'logging')} for more information on how to do logging in *flowR*.
|
|
50
|
+
`)
|
|
51
|
+
.addFaq('How to run *tests* with *verbose* logging?', `
|
|
52
|
+
Use the dedicated npm script to run all tests with trace-level log output:
|
|
53
|
+
${(0, doc_code_1.codeBlock)('shell', 'npm run test:verbose')}
|
|
54
|
+
Alternatively, set the \`FLOWR_VERBOSE\` environment variable directly:
|
|
55
|
+
${(0, doc_code_1.codeBlock)('shell', 'FLOWR_VERBOSE=true npm run test')}
|
|
56
|
+
Both forms accept the usual vitest filters (e.g. \`npm run test:verbose -- cli/server\`).
|
|
57
|
+
`)
|
|
58
|
+
.addFaq('How to add a *linting rule*?', `
|
|
59
|
+
To add a new linting rule, see ${ctx.linkPage('wiki/Create Linting Rules')}.
|
|
50
60
|
`);
|
|
51
61
|
wikiFaq.withTopic('flowr.use')
|
|
52
|
-
.addFaq('How to *
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
62
|
+
.addFaq('How to *watch* a file for changes in the REPL?', `
|
|
63
|
+
Replace the \`file://\` prefix with \`watch://\` when passing a path to any REPL command.
|
|
64
|
+
flowR will run the command immediately and then re-run it every time the file (or any file inside the specified folder) changes.
|
|
65
|
+
Press Ctrl+C or enter any other command to leave watch mode.
|
|
66
|
+
${(0, doc_code_1.codeBlock)('shell', ':df watch://path/to/analysis.R')}
|
|
67
|
+
For a folder, flowR uses the same project discovery as with \`file://\`:
|
|
68
|
+
${(0, doc_code_1.codeBlock)('shell', ':query @linter watch://path/to/project')}
|
|
69
|
+
`)
|
|
70
|
+
.addFaq('How to *query* an R project?', `
|
|
71
|
+
For this you can use flowR's ${ctx.linkPage('wiki/Query API', 'Query API')}.
|
|
72
|
+
If you want to create your own project using flowR as a library, check out the
|
|
73
|
+
[${doc_files_1.FlowrGithubGroupName}/sample-analyzer-project-query](${doc_files_1.FlowrGithubBaseRef}/sample-analyzer-project-query) repository for an example project setup.
|
|
56
74
|
`);
|
|
57
75
|
wikiFaq.withTopic('r.packages')
|
|
58
|
-
.addFaq('What is the R *prelude* and R *base* package?', `
|
|
59
|
-
The base package contains lots of base functions like \`source\` for example.
|
|
60
|
-
The R prelude includes the base package along with several other packages.
|
|
61
|
-
Packages that were loaded by the prelude can be called without prefixing the
|
|
62
|
-
function call with the package name and the \`::\` operator.
|
|
63
|
-
|
|
64
|
-
The packages loaded by the R prelude can be seen in the \`attached base packages\`
|
|
65
|
-
sections in the output of \`sessionInfo()\`.
|
|
76
|
+
.addFaq('What is the R *prelude* and R *base* package?', `
|
|
77
|
+
The base package contains lots of base functions like \`source\` for example.
|
|
78
|
+
The R prelude includes the base package along with several other packages.
|
|
79
|
+
Packages that were loaded by the prelude can be called without prefixing the
|
|
80
|
+
function call with the package name and the \`::\` operator.
|
|
81
|
+
|
|
82
|
+
The packages loaded by the R prelude can be seen in the \`attached base packages\`
|
|
83
|
+
sections in the output of \`sessionInfo()\`.
|
|
84
|
+
`)
|
|
85
|
+
.addFaq('How to get *documentation* for a function or package?', `
|
|
86
|
+
There are a couple of ways to get documentation for a function or package.
|
|
87
|
+
|
|
88
|
+
🖥️ Firstly, if you have already installed the package the function originated from you can simply run \`?<package name>::<function name>\` in an R session to print the
|
|
89
|
+
relevant documentation. If you don't know the origin of the package, you can use
|
|
90
|
+
\`??<function name>\` in an R shell to fuzzy find all documentations containing
|
|
91
|
+
\`<function name>\` or something similar.
|
|
92
|
+
|
|
93
|
+
🌐 Secondly, if you don't have or don't want to install the package you can simply google the fully qualified name of the function. Good sources include [rdrr.io](https://rdrr.io/)
|
|
94
|
+
or [rdocumentation.org](https://rdocumentation.org/). Additionally, the package documentation PDF can also
|
|
95
|
+
be downloaded directly from [cran](https://cran.r-project.org/).
|
|
66
96
|
`)
|
|
67
|
-
.addFaq('How
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
🖥️ Firstly, if you have already installed the package the function originated from you can simply run \`?<package name>::<function name>\` in an R session to print the
|
|
71
|
-
relevant documentation. If you don't know the origin of the package, you can use
|
|
72
|
-
\`??<function name>\` in an R shell to fuzzy find all documentations containing
|
|
73
|
-
\`<function name>\` or something similar.
|
|
74
|
-
|
|
75
|
-
🌐 Secondly, if you don't have or don't want to install the package you can simply google the fully qualified name of the function. Good sources include [rdrr.io](https://rdrr.io/)
|
|
76
|
-
or [rdocumentation.org](https://rdocumentation.org/). Additionally, the package documentation PDF can also
|
|
77
|
-
be downloaded directly from [cran](https://cran.r-project.org/).
|
|
97
|
+
.addFaq('How does flowR know a *package\'s exports*?', `
|
|
98
|
+
See the ${ctx.linkPage('wiki/Package Database', 'Package Database')} wiki page.
|
|
78
99
|
`);
|
|
79
100
|
wikiFaq.withTopic('editor.configs')
|
|
80
|
-
.addFaq('How can I make eslint and ZED work together?', `Use this project config (\`.zed/settings.json\`) to disable all formatters except eslint:
|
|
101
|
+
.addFaq('How can I make eslint and ZED work together?', `Use this project config (\`.zed/settings.json\`) to disable all formatters except eslint:
|
|
81
102
|
${(0, doc_code_1.codeBlock)('json', JSON.stringify(recommended_configs_1.recommendedZedConfig, null, 2))}`);
|
|
82
103
|
wikiFaq.withTopic('editor.configs')
|
|
83
|
-
.addFaq('How can I launch the flowr repl form vs code?', `You can use the following launch task (\`.vscode/launch.json\`):
|
|
104
|
+
.addFaq('How can I launch the flowr repl form vs code?', `You can use the following launch task (\`.vscode/launch.json\`):
|
|
84
105
|
${(0, doc_code_1.codeBlock)('json', JSON.stringify(recommended_configs_1.recommendedVsCodeTask, null, 2))}`);
|
|
85
106
|
return wikiFaq;
|
|
86
107
|
}
|