@eagleoutice/flowr 2.16.2 → 2.16.4
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 +15 -15
- package/abstract-interpretation/data-frame/arguments.js +4 -3
- package/abstract-interpretation/data-frame/dataframe-semantics.js +1 -2
- package/abstract-interpretation/data-frame/semantics.d.ts +2 -2
- package/abstract-interpretation/data-frame/semantics.js +2 -6
- package/benchmark/slicer.js +1 -3
- package/benchmark/summarizer/first-phase/input.js +1 -12
- package/benchmark/summarizer/second-phase/process.d.ts +7 -0
- package/benchmark/summarizer/second-phase/process.js +15 -12
- package/cli/repl/commands/repl-cfg.js +18 -49
- package/cli/repl/commands/repl-clipboard.d.ts +2 -0
- package/cli/repl/commands/repl-clipboard.js +5 -0
- package/cli/repl/commands/repl-commands.js +2 -2
- package/cli/repl/commands/repl-dataflow.js +21 -55
- package/cli/repl/commands/repl-normalize.js +15 -28
- package/cli/repl/commands/repl-parse.js +2 -2
- package/cli/repl/commands/repl-query.js +10 -10
- package/cli/repl/commands/repl-signature.js +4 -4
- package/cli/repl/server/connection.d.ts +1 -0
- package/cli/repl/server/connection.js +8 -30
- package/cli/repl/server/messages/message-analysis.js +1 -1
- package/config.d.ts +6 -0
- package/config.js +7 -4
- package/control-flow/cfg-dead-code.js +5 -14
- package/control-flow/cfg-to-basic-blocks.js +1 -6
- package/control-flow/control-flow-graph.d.ts +2 -16
- package/control-flow/control-flow-graph.js +8 -66
- package/control-flow/diff-cfg.js +10 -23
- package/control-flow/semantic-cfg-guided-visitor.js +5 -11
- package/control-flow/simple-visitor.js +2 -2
- package/core/steps/pipeline/default-pipelines.d.ts +138 -138
- package/data/r-base-packages.generated.js +0 -1
- package/data/r-base-primitives.generated.js +0 -1
- package/data/r-s3-generics.generated.d.ts +5 -0
- package/data/r-s3-generics.generated.js +103 -0
- package/dataflow/cluster.js +2 -1
- package/dataflow/environments/append.d.ts +1 -0
- package/dataflow/environments/built-in-props.d.ts +10 -0
- package/dataflow/environments/built-in-props.js +25 -1
- package/dataflow/environments/built-in.js +15 -9
- package/dataflow/environments/clone.d.ts +1 -0
- package/dataflow/environments/clone.js +1 -0
- package/dataflow/environments/default-builtin-config.d.ts +188 -14
- package/dataflow/environments/default-builtin-config.js +125 -65
- package/dataflow/environments/define.d.ts +1 -0
- package/dataflow/environments/define.js +1 -0
- package/dataflow/environments/environment.d.ts +27 -0
- package/dataflow/environments/environment.js +37 -16
- package/dataflow/environments/frame-memory.d.ts +9 -1
- package/dataflow/environments/frame-memory.js +12 -1
- package/dataflow/environments/identifier.d.ts +0 -2
- package/dataflow/environments/identifier.js +5 -7
- package/dataflow/environments/overwrite.js +1 -0
- package/dataflow/environments/query-fn-props.js +4 -4
- package/dataflow/environments/scoping.d.ts +3 -0
- package/dataflow/environments/scoping.js +3 -0
- package/dataflow/eval/resolve/alias-tracking.js +3 -3
- package/dataflow/eval/resolve/resolve-argument.d.ts +7 -3
- package/dataflow/eval/resolve/resolve-argument.js +16 -11
- package/dataflow/eval/resolve/resolve-numbers.js +5 -2
- package/dataflow/eval/resolve/resolve-strings.d.ts +1 -1
- package/dataflow/eval/resolve/resolve-working-directory.js +2 -2
- package/dataflow/eval/resolve/resolve.js +3 -8
- package/dataflow/eval/values/intervals/interval-constants.js +1 -6
- package/dataflow/eval/values/r-value.js +1 -6
- package/dataflow/extractor.js +17 -17
- package/dataflow/fn/argument-roles.js +15 -15
- package/dataflow/fn/class-declaration.js +7 -7
- package/dataflow/fn/frame-reflection.d.ts +1 -23
- package/dataflow/fn/frame-reflection.js +8 -95
- package/dataflow/fn/function-props.d.ts +0 -3
- package/dataflow/fn/function-props.js +9 -11
- package/dataflow/fn/function-semantics.d.ts +1 -0
- package/dataflow/fn/strict-function.js +15 -14
- package/dataflow/graph/call-graph.d.ts +8 -0
- package/dataflow/graph/call-graph.js +40 -25
- package/dataflow/graph/dataflowgraph-builder.d.ts +0 -60
- package/dataflow/graph/dataflowgraph-builder.js +15 -135
- package/dataflow/graph/df-helper.d.ts +56 -4
- package/dataflow/graph/df-helper.js +116 -1
- package/dataflow/graph/diff-dataflow-graph.js +13 -15
- package/dataflow/graph/graph-helper.d.ts +20 -0
- package/dataflow/graph/graph-helper.js +18 -0
- package/dataflow/graph/graph.js +3 -8
- package/dataflow/graph/match-args.d.ts +1 -1
- package/dataflow/graph/match-args.js +3 -3
- package/dataflow/internal/linker.d.ts +4 -10
- package/dataflow/internal/linker.js +21 -29
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +39 -22
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +19 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +3 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-env-contents.js +6 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +14 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +27 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +6 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +33 -35
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +3 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +6 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +12 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-list.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +7 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +7 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +5 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +4 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +8 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +4 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +36 -38
- package/dataflow/internal/process/functions/call/common.d.ts +3 -1
- package/dataflow/internal/process/functions/call/common.js +6 -7
- package/dataflow/internal/process/functions/call/deferred.js +8 -8
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +11 -4
- package/dataflow/internal/process/functions/call/known-call-handling.js +11 -7
- package/dataflow/internal/process/functions/call/named-call-handling.js +4 -3
- package/dataflow/internal/process/functions/call/nse.js +4 -4
- package/dataflow/internal/process/functions/call/quoted.js +16 -14
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +2 -2
- package/dataflow/internal/process/functions/process-parameter.js +2 -2
- package/dataflow/internal/process/process-named-call.js +1 -1
- package/dataflow/origin/dfg-get-origin.js +2 -2
- package/dataflow/origin/dfg-get-symbol-refs.d.ts +1 -0
- package/dataflow/origin/dfg-get-symbol-refs.js +3 -8
- package/documentation/data/faq/wiki-faq-store.js +2 -2
- package/documentation/doc-capabilities.js +2 -1
- package/documentation/doc-util/doc-functions.js +2 -2
- package/documentation/doc-util/doc-query.d.ts +1 -1
- package/documentation/doc-util/doc-query.js +3 -1
- package/documentation/doc-util/doc-repl.js +4 -4
- package/documentation/doc-util/doc-timings.js +3 -2
- package/documentation/doc-util/doc-types.js +2 -2
- package/documentation/wiki-absint.js +2 -1
- package/documentation/wiki-cfg.js +2 -1
- package/documentation/wiki-create-linting-rules.js +2 -2
- package/documentation/wiki-dataflow-graph.js +6 -6
- package/documentation/wiki-interface.js +3 -2
- package/documentation/wiki-linter.d.ts +14 -0
- package/documentation/wiki-linter.js +353 -88
- package/documentation/wiki-mk/doc-maker.js +1 -2
- package/documentation/wiki-query.js +25 -0
- package/documentation/wiki-search.js +2 -1
- package/documentation/wiki-signature-database.js +0 -2
- package/linter/linter-executor.js +4 -0
- package/linter/linter-rules.d.ts +552 -35
- package/linter/linter-rules.js +39 -1
- package/linter/linter-tags.d.ts +6 -0
- package/linter/linter-tags.js +6 -0
- package/linter/rules/absolute-path.d.ts +1 -1
- package/linter/rules/absolute-path.js +9 -6
- package/linter/rules/cmd-check/bogus-return.d.ts +29 -0
- package/linter/rules/cmd-check/bogus-return.js +63 -0
- package/linter/rules/cmd-check/call-arguments.d.ts +63 -0
- package/linter/rules/cmd-check/call-arguments.js +216 -0
- package/linter/rules/cmd-check/class-string-comparison.d.ts +48 -0
- package/linter/rules/cmd-check/class-string-comparison.js +135 -0
- package/linter/rules/cmd-check/cmd-check-util.d.ts +67 -0
- package/linter/rules/cmd-check/cmd-check-util.js +169 -0
- package/linter/rules/cmd-check/compiled-code.d.ts +86 -0
- package/linter/rules/cmd-check/compiled-code.js +350 -0
- package/linter/rules/cmd-check/conformance.d.ts +51 -0
- package/linter/rules/cmd-check/conformance.js +166 -0
- package/linter/rules/cmd-check/dependency-declaration.d.ts +95 -0
- package/linter/rules/cmd-check/dependency-declaration.js +299 -0
- package/linter/rules/cmd-check/description-metadata.d.ts +63 -0
- package/linter/rules/cmd-check/description-metadata.js +393 -0
- package/linter/rules/cmd-check/documentation-mismatch.d.ts +60 -0
- package/linter/rules/cmd-check/documentation-mismatch.js +407 -0
- package/linter/rules/cmd-check/file-checks.d.ts +29 -0
- package/linter/rules/cmd-check/file-checks.js +34 -0
- package/linter/rules/cmd-check/foreign-function-calls.d.ts +54 -0
- package/linter/rules/cmd-check/foreign-function-calls.js +115 -0
- package/linter/rules/cmd-check/global-environment-modification.d.ts +61 -0
- package/linter/rules/cmd-check/global-environment-modification.js +237 -0
- package/linter/rules/cmd-check/namespace-tampering.d.ts +52 -0
- package/linter/rules/cmd-check/namespace-tampering.js +162 -0
- package/linter/rules/cmd-check/non-ascii-code.d.ts +51 -0
- package/linter/rules/cmd-check/non-ascii-code.js +112 -0
- package/linter/rules/cmd-check/package-code.d.ts +30 -0
- package/linter/rules/cmd-check/package-code.js +141 -0
- package/linter/rules/cmd-check/package-data.d.ts +51 -0
- package/linter/rules/cmd-check/package-data.js +181 -0
- package/linter/rules/cmd-check/package-files.d.ts +41 -0
- package/linter/rules/cmd-check/package-files.js +157 -0
- package/linter/rules/cmd-check/package-hooks.d.ts +57 -0
- package/linter/rules/cmd-check/package-hooks.js +173 -0
- package/linter/rules/cmd-check/package-metafiles.d.ts +49 -0
- package/linter/rules/cmd-check/package-metafiles.js +292 -0
- package/linter/rules/cmd-check/package-runtime.d.ts +67 -0
- package/linter/rules/cmd-check/package-runtime.js +284 -0
- package/linter/rules/cmd-check/package-structure.d.ts +85 -0
- package/linter/rules/cmd-check/package-structure.js +320 -0
- package/linter/rules/cmd-check/rd-files.d.ts +83 -0
- package/linter/rules/cmd-check/rd-files.js +621 -0
- package/linter/rules/cmd-check/s-three-method-consistency.d.ts +72 -0
- package/linter/rules/cmd-check/s-three-method-consistency.js +206 -0
- package/linter/rules/cmd-check/true-false-abbreviation.d.ts +45 -0
- package/linter/rules/cmd-check/true-false-abbreviation.js +121 -0
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +1 -1
- package/linter/rules/dead-code.d.ts +4 -4
- package/linter/rules/dead-code.js +19 -4
- package/linter/rules/deprecated-functions.d.ts +1 -1
- package/linter/rules/deprecated-functions.js +5 -5
- package/linter/rules/file-path-validity.d.ts +6 -2
- package/linter/rules/file-path-validity.js +7 -3
- package/linter/rules/namespace-access.d.ts +3 -3
- package/linter/rules/namespace-access.js +12 -3
- package/linter/rules/naming-convention.d.ts +2 -2
- package/linter/rules/naming-convention.js +14 -15
- package/linter/rules/network-functions.d.ts +1 -1
- package/linter/rules/network-functions.js +1 -1
- package/linter/rules/no-leaked-credentials.d.ts +1 -1
- package/linter/rules/no-leaked-credentials.js +5 -5
- package/linter/rules/problematic-inputs.d.ts +2 -2
- package/linter/rules/problematic-inputs.js +4 -3
- package/linter/rules/roxygen-arguments.d.ts +2 -2
- package/linter/rules/roxygen-arguments.js +2 -2
- package/linter/rules/seeded-randomness.d.ts +2 -2
- package/linter/rules/seeded-randomness.js +7 -7
- package/linter/rules/software-has-license.d.ts +3 -3
- package/linter/rules/software-has-license.js +3 -3
- package/linter/rules/software-has-tests.d.ts +2 -2
- package/linter/rules/software-has-tests.js +2 -2
- package/linter/rules/stop-with-call-arg.d.ts +3 -3
- package/linter/rules/stop-with-call-arg.js +21 -4
- package/linter/rules/syntactically-valid.d.ts +1 -1
- package/linter/rules/syntactically-valid.js +1 -1
- package/linter/rules/unclosed-connection.d.ts +2 -2
- package/linter/rules/unclosed-connection.js +5 -5
- package/linter/rules/undefined-symbol-util.js +16 -32
- package/linter/rules/undefined-symbol.d.ts +3 -1
- package/linter/rules/undefined-symbol.js +34 -4
- package/linter/rules/unescaped-arguments.d.ts +1 -1
- package/linter/rules/unescaped-arguments.js +11 -10
- package/linter/rules/unused-definition.d.ts +1 -1
- package/linter/rules/unused-definition.js +14 -20
- package/linter/rules/unused-import.d.ts +1 -1
- package/linter/rules/unused-import.js +1 -1
- package/linter/rules/useless-loop.d.ts +1 -1
- package/linter/rules/useless-loop.js +1 -1
- package/package.json +1 -1
- package/project/cache/flowr-analyzer-cache.js +1 -1
- package/project/context/flowr-analyzer-context.js +1 -1
- package/project/context/flowr-analyzer-environment-context.d.ts +2 -2
- package/project/context/flowr-analyzer-environment-context.js +2 -1
- package/project/context/flowr-analyzer-files-context.d.ts +6 -0
- package/project/context/flowr-analyzer-files-context.js +15 -11
- package/project/context/flowr-analyzer-incremental-analysis-context.d.ts +0 -2
- package/project/context/flowr-analyzer-incremental-analysis-context.js +0 -4
- package/project/context/flowr-file.d.ts +4 -0
- package/project/context/flowr-file.js +4 -0
- package/project/flowr-analyzer-builder.js +1 -1
- package/project/plugins/file-plugins/files/flowr-description-file.js +2 -2
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +4 -0
- package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-manifest-files.js +11 -14
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +3 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +25 -15
- package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +44 -0
- package/project/plugins/file-plugins/files/flowr-rd-file.js +130 -61
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +0 -1
- package/project/plugins/file-plugins/files/flowr-rda-file.js +4 -16
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +4 -0
- package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +2 -0
- package/project/plugins/file-plugins/files/flowr-sweave-file.js +4 -0
- package/project/plugins/file-plugins/flowr-analyzer-test-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-vignette-file-plugin.js +1 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.d.ts +0 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +1 -5
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts +2 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +2 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-session-info-plugin.js +3 -7
- package/project/sigdb/build.js +16 -30
- package/project/sigdb/dict.d.ts +4 -6
- package/project/sigdb/dict.js +125 -31
- package/project/sigdb/reader.js +2 -18
- package/project/sigdb/sigdb-download.js +14 -23
- package/queries/base-query-format.d.ts +2 -0
- package/queries/base-query-format.js +10 -2
- package/queries/catalog/absint-query/absint-query-format.d.ts +1 -1
- package/queries/catalog/absint-query/absint-query-format.js +5 -7
- package/queries/catalog/call-context-query/call-context-query-executor.js +24 -32
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-format.js +1 -3
- package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -4
- package/queries/catalog/call-context-query/identify-link-to-nested-call-relation.js +1 -4
- package/queries/catalog/call-graph-query/call-graph-query-format.js +2 -3
- package/queries/catalog/config-query/config-query-format.js +3 -3
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +2 -3
- package/queries/catalog/dataflow-query/dataflow-query-format.js +2 -3
- package/queries/catalog/dependencies-query/data-flow.d.ts +45 -0
- package/queries/catalog/dependencies-query/data-flow.js +179 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +18 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +108 -12
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +17 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.js +14 -11
- package/queries/catalog/dependencies-query/function-info/derived-functions.js +2 -1
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +2 -0
- package/queries/catalog/dependencies-query/function-info/library-functions.js +13 -13
- package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -1
- package/queries/catalog/dependencies-query/function-info/remote-functions.js +3 -3
- package/queries/catalog/dependencies-query/function-info/source-functions.js +2 -2
- package/queries/catalog/dependencies-query/function-info/test-functions.js +8 -8
- package/queries/catalog/dependencies-query/function-info/transform-functions.d.ts +8 -0
- package/queries/catalog/dependencies-query/function-info/transform-functions.js +17 -0
- package/queries/catalog/dependencies-query/function-info/write-functions.js +4 -0
- package/queries/catalog/dependencies-query/implicit-echo.d.ts +5 -3
- package/queries/catalog/dependencies-query/implicit-echo.js +36 -35
- package/queries/catalog/dependencies-query/link-devices.d.ts +3 -2
- package/queries/catalog/dependencies-query/link-devices.js +9 -6
- package/queries/catalog/dependencies-query/plot-description.d.ts +10 -0
- package/queries/catalog/dependencies-query/plot-description.js +119 -0
- package/queries/catalog/dependencies-query/plot-objects.d.ts +13 -0
- package/queries/catalog/dependencies-query/plot-objects.js +61 -0
- package/queries/catalog/dice-query/dice-query-format.d.ts +2 -2
- package/queries/catalog/dice-query/dice-query-format.js +3 -40
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +1 -1
- package/queries/catalog/does-call-query/does-call-query-format.js +2 -2
- package/queries/catalog/function-info-query/function-info-query-format.js +2 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +2 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +2 -2
- package/queries/catalog/happens-before-query/happens-before-query-format.js +2 -2
- package/queries/catalog/id-map-query/id-map-query-format.js +1 -3
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +2 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.js +2 -3
- package/queries/catalog/input-sources-query/simple-input-classifier.js +28 -29
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +4 -7
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +1 -1
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +3 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +2 -2
- package/queries/catalog/linter-query/linter-query-executor.js +10 -3
- package/queries/catalog/linter-query/linter-query-format.d.ts +4 -1
- package/queries/catalog/linter-query/linter-query-format.js +32 -21
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +1 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -3
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +2 -3
- package/queries/catalog/origin-query/origin-query-executor.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-executor.js +3 -3
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-format.js +4 -5
- package/queries/catalog/project-query/project-query-format.js +2 -2
- package/queries/catalog/provenance-query/provenance-query-format.js +2 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +4 -4
- package/queries/catalog/search-query/search-query-format.js +1 -3
- package/queries/catalog/signature-query/signature-query-executor.js +3 -3
- package/queries/catalog/signature-query/signature-query-format.js +2 -2
- package/queries/catalog/slice-query-options.d.ts +16 -0
- package/queries/catalog/slice-query-options.js +28 -0
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +2 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -42
- package/queries/query-print.d.ts +4 -0
- package/queries/query-print.js +17 -1
- package/queries/query.d.ts +3 -3
- package/queries/query.js +3 -4
- package/r-bridge/lang-4.x/ast/model/model.d.ts +27 -3
- package/r-bridge/lang-4.x/ast/model/model.js +28 -1
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +20 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +25 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +18 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +15 -6
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +17 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +20 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +1 -0
- package/r-bridge/lang-4.x/ast/model/operators.js +0 -2
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +1 -6
- package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -6
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +4 -3
- package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-argument.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +4 -20
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-next.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-repeat.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.js +2 -9
- package/r-bridge/lang-4.x/ast/parser/main/internal/normalize-access.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-binary.js +2 -10
- package/r-bridge/lang-4.x/ast/parser/main/internal/operators/normalize-unary.js +2 -11
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.js +3 -11
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-symbol.js +1 -5
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +6 -1
- package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +7 -0
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.d.ts +0 -10
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +30 -82
- package/r-bridge/retriever.d.ts +0 -4
- package/r-bridge/retriever.js +0 -13
- package/r-bridge/roxygen2/documentation-provider.js +3 -7
- package/r-bridge/shell.js +3 -8
- package/reconstruct/auto-select/magic-comments.js +8 -7
- package/reconstruct/inline/source-inline-map.d.ts +3 -0
- package/reconstruct/inline/source-inline-map.js +8 -7
- package/reconstruct/reconstruct.d.ts +1 -1
- package/reconstruct/reconstruct.js +33 -109
- package/search/flowr-search-printer.js +4 -15
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/criterion/filters/all-variables.js +1 -2
- package/slicing/static/fingerprint.js +11 -2
- package/slicing/static/slice-call.d.ts +2 -8
- package/slicing/static/slice-call.js +8 -18
- package/slicing/static/static-slicer.js +81 -6
- package/util/collections/arrays.js +1 -1
- package/util/collections/set.js +1 -1
- package/util/diff-graph.d.ts +4 -0
- package/util/diff-graph.js +12 -0
- package/util/files.js +2 -6
- package/util/json.js +1 -15
- package/util/mermaid/cfg.js +10 -17
- package/util/mermaid/dfg.js +6 -8
- package/util/objects.d.ts +1 -1
- package/util/quads.js +4 -13
- package/util/r-author.js +5 -5
- package/util/range.d.ts +9 -0
- package/util/range.js +11 -0
- package/util/schema.js +3 -3
- package/util/simple-df/dfg-view.js +2 -1
- package/util/text/ansi.js +1 -2
- package/util/text/playground-link.js +2 -1
- package/util/text/r-highlight.js +2 -1
- package/util/text/strings.d.ts +2 -0
- package/util/text/strings.js +5 -0
- package/util/text/time.js +1 -2
- package/util/version.js +4 -3
- package/dataflow/fn/recursive-function.d.ts +0 -6
- package/dataflow/fn/recursive-function.js +0 -32
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +0 -16
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +0 -27
|
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.processFunctionParameter = processFunctionParameter;
|
|
4
4
|
const processor_1 = require("../../../processor");
|
|
5
5
|
const identifier_1 = require("../../../environments/identifier");
|
|
6
|
-
const define_1 = require("../../../environments/define");
|
|
7
6
|
const edge_1 = require("../../../graph/edge");
|
|
8
7
|
const control_flow_1 = require("../../control-flow");
|
|
9
8
|
const logic_1 = require("../../../../util/logic");
|
|
10
9
|
const r_function_definition_1 = require("../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-definition");
|
|
10
|
+
const environment_1 = require("../../../environments/environment");
|
|
11
11
|
function definedByDefault(parameter, defaultValue) {
|
|
12
12
|
if (defaultValue === undefined) {
|
|
13
13
|
return [];
|
|
@@ -34,7 +34,7 @@ function processFunctionParameter(parameter, data) {
|
|
|
34
34
|
for (const reference of name.unknownReferences) {
|
|
35
35
|
const written = { ...reference, type: identifier_1.ReferenceType.Parameter, definedAt: parameter.info.id };
|
|
36
36
|
graph.setDefinitionOfVertex(written, defaultValue === undefined ? [] : [defaultValue.entryPoint]);
|
|
37
|
-
environment =
|
|
37
|
+
environment = environment_1.REnvironment.define(written, false, environment);
|
|
38
38
|
for (const node of definedBy) {
|
|
39
39
|
graph.addEdge(written.nodeId, node, edge_1.EdgeType.DefinedBy);
|
|
40
40
|
}
|
|
@@ -42,7 +42,7 @@ function isChainNode(node) {
|
|
|
42
42
|
function chainLhsRaw(node) {
|
|
43
43
|
if (r_function_call_1.RFunctionCall.is(node)) {
|
|
44
44
|
const arg = node.arguments[0];
|
|
45
|
-
return r_argument_1.RArgument.
|
|
45
|
+
return r_argument_1.RArgument.valueOf(arg);
|
|
46
46
|
}
|
|
47
47
|
return r_argument_1.RArgument.is(node.lhs) ? node.lhs.value : node.lhs;
|
|
48
48
|
}
|
|
@@ -4,9 +4,9 @@ exports.getOriginInDfg = getOriginInDfg;
|
|
|
4
4
|
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
5
5
|
const vertex_1 = require("../graph/vertex");
|
|
6
6
|
const edge_1 = require("../graph/edge");
|
|
7
|
-
const linker_1 = require("../internal/linker");
|
|
8
7
|
const assert_1 = require("../../util/assert");
|
|
9
8
|
const vertex_2 = require("../graph/vertex");
|
|
9
|
+
const df_helper_1 = require("../graph/df-helper");
|
|
10
10
|
/**
|
|
11
11
|
* Obtain the (dataflow) origin of a given node in the dfg.
|
|
12
12
|
* @useInstead {@link Dataflow.origin}
|
|
@@ -112,7 +112,7 @@ function getCallTarget(dfg, call) {
|
|
|
112
112
|
id: call.id,
|
|
113
113
|
proc: o
|
|
114
114
|
})) : undefined;
|
|
115
|
-
const targets = new Set(
|
|
115
|
+
const targets = new Set(df_helper_1.Dataflow.callTargetsOf(call.id, dfg));
|
|
116
116
|
if (targets.size === 0) {
|
|
117
117
|
// resolve via variable use origin
|
|
118
118
|
return origins?.length === 0 ? getVariableUseOrigin(dfg, call) : origins;
|
|
@@ -14,6 +14,7 @@ import type { DataflowGraph } from '../graph/graph';
|
|
|
14
14
|
* @param graph - Dataflow Graph
|
|
15
15
|
* @param nodeId - NodeId of Symbol to resolve
|
|
16
16
|
* @returns List including the Definitions and References to that definition
|
|
17
|
+
* @useInstead {@link Dataflow.refsToSymbol}
|
|
17
18
|
* @example getAllRefsToSymbol('3\@y') returns ['3\@y', '4\@y']
|
|
18
19
|
*/
|
|
19
20
|
export declare function getAllRefsToSymbol(graph: DataflowGraph, nodeId: NodeId): NodeId[] | undefined;
|
|
@@ -18,6 +18,7 @@ const df_helper_1 = require("../graph/df-helper");
|
|
|
18
18
|
* @param graph - Dataflow Graph
|
|
19
19
|
* @param nodeId - NodeId of Symbol to resolve
|
|
20
20
|
* @returns List including the Definitions and References to that definition
|
|
21
|
+
* @useInstead {@link Dataflow.refsToSymbol}
|
|
21
22
|
* @example getAllRefsToSymbol('3\@y') returns ['3\@y', '4\@y']
|
|
22
23
|
*/
|
|
23
24
|
function getAllRefsToSymbol(graph, nodeId) {
|
|
@@ -34,14 +35,8 @@ function getAllRefsToSymbol(graph, nodeId) {
|
|
|
34
35
|
const res = new Set();
|
|
35
36
|
for (const { id } of definitiveOrigins) {
|
|
36
37
|
res.add(id);
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
.filter(([_, edge]) => edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads))
|
|
40
|
-
.forEach(([node, _]) => res.add(node));
|
|
41
|
-
graph.outgoingEdges(id)
|
|
42
|
-
?.entries()
|
|
43
|
-
.filter(([_, edge]) => edge_1.DfEdge.includesType(edge, edge_1.EdgeType.DefinedByOnCall))
|
|
44
|
-
.forEach(([node, _]) => res.add(node));
|
|
38
|
+
df_helper_1.Dataflow.sourcesOf(graph, id, edge_1.EdgeType.Reads).forEach(node => res.add(node));
|
|
39
|
+
df_helper_1.Dataflow.targetsOf(graph, id, edge_1.EdgeType.DefinedByOnCall).forEach(node => res.add(node));
|
|
45
40
|
}
|
|
46
41
|
return [...res];
|
|
47
42
|
}
|
|
@@ -4,6 +4,7 @@ exports.FaqStore = void 0;
|
|
|
4
4
|
const doc_structure_1 = require("../../doc-util/doc-structure");
|
|
5
5
|
const defaultmap_1 = require("../../../util/collections/defaultmap");
|
|
6
6
|
const assert_1 = require("../../../util/assert");
|
|
7
|
+
const strings_1 = require("../../../util/text/strings");
|
|
7
8
|
const FlowrFaqTopics = {
|
|
8
9
|
'flowr.use': '✨ Using <i>flowR</i>',
|
|
9
10
|
'flowr.development': '🧑💻 <i>flowR</i> Development',
|
|
@@ -33,8 +34,7 @@ class FaqStore {
|
|
|
33
34
|
}
|
|
34
35
|
printAllTopics(topicsRegex) {
|
|
35
36
|
const topics = Array.from(this.faqs.keys())
|
|
36
|
-
.filter(topic => topicsRegex.test(topic))
|
|
37
|
-
.sort((a, b) => a.localeCompare(b));
|
|
37
|
+
.filter(topic => topicsRegex.test(topic)).sort(strings_1.compareByCodeUnit);
|
|
38
38
|
let output = '';
|
|
39
39
|
for (const topic of topics) {
|
|
40
40
|
const faqs = this.faqs.get(topic).sort(([q1], [q2]) => q1.localeCompare(q2));
|
|
@@ -14,6 +14,7 @@ const playground_link_1 = require("../util/text/playground-link");
|
|
|
14
14
|
const operators_1 = require("../r-bridge/lang-4.x/ast/model/operators");
|
|
15
15
|
const r_highlight_1 = require("../util/text/r-highlight");
|
|
16
16
|
const defaultmap_1 = require("../util/collections/defaultmap");
|
|
17
|
+
const arrays_1 = require("../util/collections/arrays");
|
|
17
18
|
const testSuites = Object.values(summary_def_1.TestSuites);
|
|
18
19
|
const maxSignatureTests = 3;
|
|
19
20
|
const preferredContext = 'dataflow';
|
|
@@ -29,7 +30,7 @@ function claimedCapabilities(array) {
|
|
|
29
30
|
for (const [, , operator] of array.matchAll(operatorSpreadRegex)) {
|
|
30
31
|
ids.push(...operators_1.OperatorDatabase[operator]?.capabilities ?? []);
|
|
31
32
|
}
|
|
32
|
-
return
|
|
33
|
+
return (0, arrays_1.uniqueArray)(ids);
|
|
33
34
|
}
|
|
34
35
|
/** a test name as the source spells it, with its escapes (`\\name`) resolved */
|
|
35
36
|
function unescapeSource(name) {
|
|
@@ -9,7 +9,7 @@ const assert_1 = require("../../util/assert");
|
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
10
10
|
const path_1 = __importDefault(require("path"));
|
|
11
11
|
const doc_types_1 = require("./doc-types");
|
|
12
|
-
function
|
|
12
|
+
function collectFunctionHierarchy(sourceFiles, options, fname) {
|
|
13
13
|
const hierarchyList = [];
|
|
14
14
|
const visit = (node, sourceFile) => {
|
|
15
15
|
if (!node) {
|
|
@@ -56,7 +56,7 @@ function getFunctionsFromFolder(options) {
|
|
|
56
56
|
const { files, program } = (0, doc_types_1.getTypeScriptSourceFiles)(fileNames);
|
|
57
57
|
(0, assert_1.guard)(files.length > 0, () => `No source files found for ${JSON.stringify(fileNames)}`);
|
|
58
58
|
const withProgram = { ...options, program };
|
|
59
|
-
const hierarchyList =
|
|
59
|
+
const hierarchyList = collectFunctionHierarchy(files, withProgram, options.fname);
|
|
60
60
|
return {
|
|
61
61
|
info: hierarchyList,
|
|
62
62
|
program
|
|
@@ -12,7 +12,7 @@ export interface ShowQueryOptions {
|
|
|
12
12
|
readonly collapseQuery?: boolean;
|
|
13
13
|
readonly shorthand?: string;
|
|
14
14
|
readonly ctx?: GeneralDocContext;
|
|
15
|
-
/** additional in-memory files registered before the request, e.g. the targets of `source(...)` calls */
|
|
15
|
+
/** additional in-memory files registered before the request, e.g. the targets of `source(...)` calls; a `code` of `file://<name>` analyzes one of them */
|
|
16
16
|
readonly files?: readonly {
|
|
17
17
|
readonly name: string;
|
|
18
18
|
readonly content: string;
|
|
@@ -29,6 +29,7 @@ const query_print_1 = require("../../queries/query-print");
|
|
|
29
29
|
const flowr_analyzer_builder_1 = require("../../project/flowr-analyzer-builder");
|
|
30
30
|
const flowr_file_1 = require("../../project/context/flowr-file");
|
|
31
31
|
const doc_cli_option_1 = require("./doc-cli-option");
|
|
32
|
+
const retriever_1 = require("../../r-bridge/retriever");
|
|
32
33
|
const QueryDocFile = 'src/documentation/wiki-query.ts';
|
|
33
34
|
/**
|
|
34
35
|
* Visualizes a query and its results in markdown format.
|
|
@@ -41,7 +42,8 @@ async function showQuery(parser, code, queries, { showCode, collapseResult, coll
|
|
|
41
42
|
for (const file of files ?? []) {
|
|
42
43
|
analyzer.addFile(new flowr_file_1.FlowrInlineTextFile(file.name, file.content));
|
|
43
44
|
}
|
|
44
|
-
|
|
45
|
+
/* code naming one of the files above analyzes that file, as a package's code is analyzed */
|
|
46
|
+
analyzer.addRequest(files?.some(f => `${retriever_1.fileProtocol}${f.name}` === code) ? (0, retriever_1.requestFromInput)(code) : code);
|
|
45
47
|
const results = await analyzer.query(queries);
|
|
46
48
|
const duration = performance.now() - now;
|
|
47
49
|
const metaInfo = `
|
|
@@ -12,7 +12,7 @@ const prompt_1 = require("../../cli/repl/prompt");
|
|
|
12
12
|
const doc_code_1 = require("./doc-code");
|
|
13
13
|
const print_version_1 = require("../../cli/repl/print-version");
|
|
14
14
|
const flowr_analyzer_builder_1 = require("../../project/flowr-analyzer-builder");
|
|
15
|
-
function
|
|
15
|
+
function scriptHelpMarkdown(script, starredVersion) {
|
|
16
16
|
let base = `| **${(0, doc_cli_option_1.getReplCommand)(script[0], false, starredVersion !== undefined)}** | ${script[1].description}`;
|
|
17
17
|
if (starredVersion) {
|
|
18
18
|
base += ` (star: ${starredVersion.description})`;
|
|
@@ -34,7 +34,7 @@ function printReplHelpAsMarkdownTable() {
|
|
|
34
34
|
continue;
|
|
35
35
|
}
|
|
36
36
|
const starred = cmds[c[0] + '*'];
|
|
37
|
-
scriptHelp.push(
|
|
37
|
+
scriptHelp.push(scriptHelpMarkdown(c, starred));
|
|
38
38
|
}
|
|
39
39
|
return `
|
|
40
40
|
| Command | Description |
|
|
@@ -42,9 +42,9 @@ function printReplHelpAsMarkdownTable() {
|
|
|
42
42
|
${scriptHelp.sort().join('\n')}
|
|
43
43
|
`;
|
|
44
44
|
}
|
|
45
|
+
const AnsiEscapeCodes = new RegExp(`${String.fromCharCode(27)}\\[[0-9;]*[mK]`, 'g');
|
|
45
46
|
function dropAnsiEscapeCodesAndCodeTags(input) {
|
|
46
|
-
|
|
47
|
-
return input.replace(/\x1B\[[0-9;]*[mK]/g, '')
|
|
47
|
+
return input.replace(AnsiEscapeCodes, '')
|
|
48
48
|
.replace(/<\/?code>/g, '')
|
|
49
49
|
.replace(/\**([^*]+)\**/g, '$1')
|
|
50
50
|
.replace(/_([^_]+)_/g, '$1');
|
|
@@ -22,7 +22,7 @@ function docTook(ms) {
|
|
|
22
22
|
return exports.ShowDocTimings ? ` required _${(0, time_1.printAsMs)(ms)}_ and` : '';
|
|
23
23
|
}
|
|
24
24
|
const TimingPatterns = [
|
|
25
|
-
[/^(Query: [^\n(]*?) \([\d.]+ ?[a-zµ]+\)$/gm, '$1'],
|
|
25
|
+
[/^(Query: [^\n(]*?) \([\d.]+ ?[a-zµ]+\)(\\?)$/gm, '$1$2'],
|
|
26
26
|
[/^[^\n]*\bTook [\d.]+ ?[a-zµ]+[^\n]*\n?/gm, ''],
|
|
27
27
|
[/^_?All queries together required [^\n]*\n?/gm, ''],
|
|
28
28
|
[/^[^\n]*(?:searchTimeMs|processTimeMs): [\d.]+[^\n]*\n?/gm, ''],
|
|
@@ -39,6 +39,7 @@ function withoutTimings(text) {
|
|
|
39
39
|
if (exports.ShowDocTimings) {
|
|
40
40
|
return text;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
/* a removed line leaves the markdown line break before it with no line to break to */
|
|
43
|
+
return TimingPatterns.reduce((t, [pattern, replacement]) => t.replace(pattern, replacement), text).replace(/\\(?=\n[ \t]*(?:\n|$))/g, '');
|
|
43
44
|
}
|
|
44
45
|
//# sourceMappingURL=doc-timings.js.map
|
|
@@ -222,7 +222,7 @@ function heritageTypeNames(node, sourceFile) {
|
|
|
222
222
|
function genericNames(node, sourceFile) {
|
|
223
223
|
return node.typeParameters?.map(param => param.getText(sourceFile) ?? '') ?? [];
|
|
224
224
|
}
|
|
225
|
-
function
|
|
225
|
+
function collectTypeHierarchy(sourceFiles, options) {
|
|
226
226
|
const hierarchyList = [];
|
|
227
227
|
const typeChecker = options.program.getTypeChecker();
|
|
228
228
|
const visit = (node, sourceFile) => {
|
|
@@ -452,7 +452,7 @@ function getTypesFromFileAsMermaid(fileNames, options) {
|
|
|
452
452
|
const { files, program } = getTypeScriptSourceFiles(fileNames);
|
|
453
453
|
(0, assert_1.guard)(files.length > 0, () => `No source files found for ${JSON.stringify(fileNames)}`);
|
|
454
454
|
const withProgram = { ...options, program };
|
|
455
|
-
const hierarchyList =
|
|
455
|
+
const hierarchyList = collectTypeHierarchy(files, withProgram);
|
|
456
456
|
return {
|
|
457
457
|
mermaid: visualizeMermaidClassDiagram(hierarchyList, withProgram),
|
|
458
458
|
info: hierarchyList,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WikiAbsint = exports.IntervalAnalysis = exports.IntervalSemantics = void 0;
|
|
4
|
+
const range_1 = require("../util/range");
|
|
4
5
|
const absint_inference_1 = require("../abstract-interpretation/absint-inference");
|
|
5
6
|
const abstract_domain_1 = require("../abstract-interpretation/domains/abstract-domain");
|
|
6
7
|
const bounded_set_domain_1 = require("../abstract-interpretation/domains/bounded-set-domain");
|
|
@@ -69,7 +70,7 @@ async function inferIntervals() {
|
|
|
69
70
|
}
|
|
70
71
|
function nodeIdToSlicingCriterion(id, idMap) {
|
|
71
72
|
const node = idMap.get(id);
|
|
72
|
-
return `${node?.location
|
|
73
|
+
return `${range_1.SourceRange.getStartLine(node?.location)}@${node?.lexeme}`;
|
|
73
74
|
}
|
|
74
75
|
function multiValueExample() {
|
|
75
76
|
const domain = {
|
|
@@ -17,6 +17,7 @@ const cfg_properties_1 = require("../control-flow/cfg-properties");
|
|
|
17
17
|
const basic_cfg_guided_visitor_1 = require("../control-flow/basic-cfg-guided-visitor");
|
|
18
18
|
const syntax_cfg_guided_visitor_1 = require("../control-flow/syntax-cfg-guided-visitor");
|
|
19
19
|
const diff_cfg_1 = require("../control-flow/diff-cfg");
|
|
20
|
+
const node_id_1 = require("../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
20
21
|
const model_1 = require("../r-bridge/lang-4.x/ast/model/model");
|
|
21
22
|
const dfg_cfg_guided_visitor_1 = require("../control-flow/dfg-cfg-guided-visitor");
|
|
22
23
|
const semantic_cfg_guided_visitor_1 = require("../control-flow/semantic-cfg-guided-visitor");
|
|
@@ -536,7 +537,7 @@ so the vertex of an expression *is* its exit point ‐ there are no separate
|
|
|
536
537
|
${(0, doc_structure_1.details)('Example: Where an if joins again', await (async function () {
|
|
537
538
|
const expr = 'if(u) 3 else 2';
|
|
538
539
|
const cfg = await (0, doc_cfg_1.getCfg)(shell, expr);
|
|
539
|
-
const [ifVertexId, ifVertex] = [...cfg.info.graph.vertices()].filter(([n]) => cfg.ast.idMap
|
|
540
|
+
const [ifVertexId, ifVertex] = [...cfg.info.graph.vertices()].filter(([n]) => node_id_1.NodeId.recoverName(n, cfg.ast.idMap) === 'if')[0];
|
|
540
541
|
(0, assert_1.guard)(control_flow_graph_1.CfgVertex.isStatement(ifVertex) || control_flow_graph_1.CfgVertex.isExpression(ifVertex));
|
|
541
542
|
return `${await (0, doc_cfg_1.printCfgCode)(shell, expr, { showCode: true, prefix: 'flowchart LR\n', ctx })}
|
|
542
543
|
|
|
@@ -17,7 +17,7 @@ function lintingRuleInfoFields(ctx) {
|
|
|
17
17
|
}).join('\n');
|
|
18
18
|
}
|
|
19
19
|
function defineRule() {
|
|
20
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention
|
|
20
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- rule objects are named in upper snake case, as the text below says
|
|
21
21
|
const MY_NEW_RULE = {
|
|
22
22
|
createSearch: (_config) => flowr_search_builder_1.Q.all(),
|
|
23
23
|
processSearchResult: (_elements, _config, _data) => ({
|
|
@@ -80,7 +80,7 @@ After implementing the rule, register it by adding it to ${ctx.link('LintingRule
|
|
|
80
80
|
|
|
81
81
|
## Step 5: Add the rule to the linter wiki generation
|
|
82
82
|
|
|
83
|
-
After registering the rule, add
|
|
83
|
+
After registering the rule, add its entry to ${ctx.link('LintingRuleExamples')}: the names of its configuration and implementation types, its test file, and an example that produces a finding (and a quick fix, if the rule offers one). The compiler asks for an entry for every rule, and a test runs every example to check that it shows what it should. These entries generate the linter overview and the individual wiki pages for linting rules, which can then be inspected through ${ctx.linkPage('wiki/Linter')}.
|
|
84
84
|
|
|
85
85
|
## Step 6: Add tests for the rule
|
|
86
86
|
|
|
@@ -27,7 +27,6 @@ const control_flow_graph_1 = require("../control-flow/control-flow-graph");
|
|
|
27
27
|
const identifier_1 = require("../dataflow/environments/identifier");
|
|
28
28
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
29
29
|
const default_pipelines_1 = require("../core/steps/pipeline/default-pipelines");
|
|
30
|
-
const linker_1 = require("../dataflow/internal/linker");
|
|
31
30
|
const apply_kill_1 = require("../dataflow/environments/apply-kill");
|
|
32
31
|
const doc_normalized_ast_1 = require("./doc-util/doc-normalized-ast");
|
|
33
32
|
const identify_link_to_last_call_relation_1 = require("../queries/catalog/call-context-query/identify-link-to-last-call-relation");
|
|
@@ -49,6 +48,7 @@ const match_args_1 = require("../dataflow/graph/match-args");
|
|
|
49
48
|
const built_in_proc_name_1 = require("../dataflow/environments/built-in-proc-name");
|
|
50
49
|
const vertex_2 = require("../dataflow/graph/vertex");
|
|
51
50
|
const objects_1 = require("../util/objects");
|
|
51
|
+
const strings_1 = require("../util/text/strings");
|
|
52
52
|
async function subExplanation(parser, ctx, { description, code, expectedSubgraph }) {
|
|
53
53
|
expectedSubgraph = await (0, doc_dfg_1.verifyExpectedSubgraph)(parser, code, expectedSubgraph);
|
|
54
54
|
const marks = [];
|
|
@@ -344,8 +344,8 @@ For starters, let's have a look at the environment of the call to \`<-\` in the
|
|
|
344
344
|
${(0, doc_env_1.printEnvironmentToMarkdown)(env.current)}
|
|
345
345
|
|
|
346
346
|
Great, you should see a definition of \`<-\` which is constraint by the [control dependency](#branches) to the \`if\`.
|
|
347
|
-
Hence, trying to re-resolve the call using ${ctx.link(
|
|
348
|
-
the following target ids: { \`${[...
|
|
347
|
+
Hence, trying to re-resolve the call using ${ctx.link(df_helper_1.Dataflow.callTargetsOf)} (defined in ${(0, doc_files_1.getFilePathMd)('../dataflow/internal/linker.ts')}) with the id \`${id}\` of the call as starting point will present you with
|
|
348
|
+
the following target ids: { \`${[...df_helper_1.Dataflow.callTargetsOf(id, info.dataflow.graph)].join('`, `')}\` }.
|
|
349
349
|
This way we know that the call may refer to the built-in assignment operator or to the multiplication.
|
|
350
350
|
Similarly, trying to resolve the name with ${ctx.link(resolve_helper_1.Resolve.byNameAndType)}\` using the environment attached to the call vertex (filtering for any reference type) returns (in a similar fashion):
|
|
351
351
|
{ \`${resolve_helper_1.Resolve.byName(identifier_1.Identifier.make(name), env)?.map(d => d.nodeId).join('`, `')}\` } (however, the latter will not trace aliases).
|
|
@@ -356,7 +356,7 @@ Similarly, trying to resolve the name with ${ctx.link(resolve_helper_1.Resolve.b
|
|
|
356
356
|
`)}
|
|
357
357
|
|
|
358
358
|
|
|
359
|
-
Similar to finding the definitions read by a variable use, please use the ${ctx.link(
|
|
359
|
+
Similar to finding the definitions read by a variable use, please use the ${ctx.link(df_helper_1.Dataflow.callTargetsOf)} function to find all possible definitions of a function call,
|
|
360
360
|
as explained in the ${ctx.linkPage('wiki/Dataflow Graph', 'working with the dataflow graph', 'dfg-working')} section.`
|
|
361
361
|
})}
|
|
362
362
|
|
|
@@ -538,7 +538,7 @@ ${(0, doc_structure_1.block)({
|
|
|
538
538
|
content: `
|
|
539
539
|
A ${linkEdgeName(edge_1.EdgeType.Reads)} edge is not a transitive closure and only links the "directly read" definition(s).
|
|
540
540
|
Our abstract domains resolving transitive ${linkEdgeName(edge_1.EdgeType.Reads)} edges (and for that matter, following ${linkEdgeName(edge_1.EdgeType.Returns)} as well)
|
|
541
|
-
are currently tailored to what we need in _flowR_. Hence, we offer a function like ${ctx.link(
|
|
541
|
+
are currently tailored to what we need in _flowR_. Hence, we offer a function like ${ctx.link(df_helper_1.Dataflow.callTargetsOf)},
|
|
542
542
|
as well as ${ctx.link(resolve_helper_1.Resolve.toBuiltIn)} which do this for specific cases.
|
|
543
543
|
Refer to ${ctx.link(df_helper_1.Dataflow.origin)} for a more general solution, as explained in ${ctx.linkPage('wiki/Dataflow Graph', 'working with the dataflow graph', 'dfg-working')}.
|
|
544
544
|
|
|
@@ -1191,7 +1191,7 @@ ${ctx.hierarchy('Origin', { openTop: true })}
|
|
|
1191
1191
|
|
|
1192
1192
|
Their respective uses are documented alongside their implementation:
|
|
1193
1193
|
|
|
1194
|
-
${['SimpleOrigin', 'FunctionCallOrigin', 'BuiltInFunctionOrigin'].sort(
|
|
1194
|
+
${['SimpleOrigin', 'FunctionCallOrigin', 'BuiltInFunctionOrigin'].sort(strings_1.compareByCodeUnit).map(key => `- ${ctx.link(key)}\\\n${ctx.doc(key, { type: 'interface' })}`).join('\n')}
|
|
1195
1195
|
|
|
1196
1196
|
Please note, the current structure of this function is biased by what implementations already exist in flowR.
|
|
1197
1197
|
Hence, we do not just track definitions and constants, but also the origins of function calls, albeit we do not yet track the origins of values (only resorting to
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WikiInterface = void 0;
|
|
4
|
+
const r_string_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-string");
|
|
4
5
|
const shell_1 = require("../r-bridge/shell");
|
|
5
6
|
const doc_query_1 = require("./doc-util/doc-query");
|
|
6
7
|
const doc_files_1 = require("./doc-util/doc-files");
|
|
@@ -66,7 +67,7 @@ ${(0, doc_code_1.codeBlock)('shell', 'nc 127.0.0.1 1042')}
|
|
|
66
67
|
|
|
67
68
|
Within the started session, type the following message (as a single line) and press enter to see the response:
|
|
68
69
|
|
|
69
|
-
${(0, doc_code_1.codeBlock)('json',
|
|
70
|
+
${(0, doc_code_1.codeBlock)('json', r_string_1.RString.unquote(JSON.stringify({ type: 'request-file-analysis', content: 'x <- 1', id: '1' })))}
|
|
70
71
|
|
|
71
72
|
</details>
|
|
72
73
|
</li>
|
|
@@ -84,7 +85,7 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
|
84
85
|
s.connect(('127.0.0.1', 1042))
|
|
85
86
|
print(s.recv(4096)) # for the hello message
|
|
86
87
|
|
|
87
|
-
s.send(b'${
|
|
88
|
+
s.send(b'${r_string_1.RString.unquote(JSON.stringify({ type: 'request-file-analysis', content: 'x <- 1', id: '1' }))}\\n')
|
|
88
89
|
|
|
89
90
|
print(s.recv(65536)) # for the response (please use a more sophisticated mechanism)
|
|
90
91
|
`)}
|
|
@@ -1,5 +1,19 @@
|
|
|
1
|
+
import { type LintingRuleNames } from '../linter/linter-rules';
|
|
1
2
|
import type { DocMakerArgs } from './wiki-mk/doc-maker';
|
|
2
3
|
import { DocMaker } from './wiki-mk/doc-maker';
|
|
4
|
+
/** an example that needs files besides its code shows them as a project, its code in `R/code.R` */
|
|
5
|
+
export interface PackageExample {
|
|
6
|
+
readonly code: string;
|
|
7
|
+
readonly files: Readonly<Record<string, string>>;
|
|
8
|
+
}
|
|
9
|
+
/** what the wiki shows for each linting rule: its configuration and implementation types, its tests, and an example with findings */
|
|
10
|
+
export declare const LintingRuleExamples: Readonly<Record<LintingRuleNames, {
|
|
11
|
+
readonly configType: string;
|
|
12
|
+
readonly ruleType: string;
|
|
13
|
+
readonly testfile: string;
|
|
14
|
+
readonly example: string | PackageExample;
|
|
15
|
+
readonly config?: object;
|
|
16
|
+
}>>;
|
|
3
17
|
/**
|
|
4
18
|
* https://github.com/flowr-analysis/flowr/wiki/Linter
|
|
5
19
|
*/
|