@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
|
@@ -8,6 +8,7 @@ exports.parseAnIndex = parseAnIndex;
|
|
|
8
8
|
exports.parseRdTopicIndex = parseRdTopicIndex;
|
|
9
9
|
exports.parseDataList = parseDataList;
|
|
10
10
|
exports.rdMetaOf = rdMetaOf;
|
|
11
|
+
exports.scanRd = scanRd;
|
|
11
12
|
exports.parseRdMacros = parseRdMacros;
|
|
12
13
|
exports.expandRdMacros = expandRdMacros;
|
|
13
14
|
exports.parseRdPage = parseRdPage;
|
|
@@ -269,73 +270,143 @@ function* groupPairsAt(text, marker) {
|
|
|
269
270
|
marker.lastIndex = second?.end ?? first.end;
|
|
270
271
|
}
|
|
271
272
|
}
|
|
272
|
-
/**
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
const
|
|
277
|
-
const
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
273
|
+
/** Scans an Rd source into a positioned tree, noting the problems the lexer of `R CMD check` reports. */
|
|
274
|
+
function scanRd(content, { specOf = () => undefined, lenient = false, macros } = {}) {
|
|
275
|
+
const stripped = stripRdComments(content);
|
|
276
|
+
const src = macros !== undefined && macros.size > 0 ? expandRdMacros(stripped, macros) : stripped;
|
|
277
|
+
const breaks = [...src.matchAll(/\n/g)].map(m => m.index);
|
|
278
|
+
const lineOf = (at) => 1 + breaks.filter(b => b < at).length;
|
|
279
|
+
const problems = [];
|
|
280
|
+
const syntax = (at, text) => problems.push({ at, kind: 'syntax', text });
|
|
281
|
+
let pos = 0;
|
|
282
|
+
let ended = false;
|
|
283
|
+
let closed = false;
|
|
284
|
+
const seq = (mode, closing, parent, open) => {
|
|
285
|
+
const nodes = [];
|
|
286
|
+
let buf = '';
|
|
287
|
+
let bufAt = pos;
|
|
288
|
+
let quote;
|
|
289
|
+
let quoteAt = 0;
|
|
290
|
+
let comment = false;
|
|
291
|
+
const flush = () => {
|
|
292
|
+
if (buf !== '') {
|
|
293
|
+
nodes.push({ type: 'text', text: buf, at: bufAt, mode });
|
|
294
|
+
}
|
|
295
|
+
buf = '';
|
|
296
|
+
};
|
|
297
|
+
const add = (n) => {
|
|
298
|
+
bufAt = buf === '' ? pos : bufAt;
|
|
299
|
+
buf += src.slice(pos, pos += n);
|
|
300
|
+
};
|
|
301
|
+
while (pos < src.length) {
|
|
302
|
+
const [c, n] = [src[pos], src[pos + 1] ?? ''];
|
|
303
|
+
if (c === '\\' && n !== '' && '\\%{}'.includes(n)) {
|
|
304
|
+
add(2);
|
|
305
|
+
}
|
|
306
|
+
else if (c === '\\' && quote === undefined && mode !== 'v' && !comment && /[A-Za-z]/.test(n)) {
|
|
307
|
+
flush();
|
|
308
|
+
macro(nodes, parent);
|
|
309
|
+
}
|
|
310
|
+
else if (c === '\\') {
|
|
311
|
+
add(quote !== undefined && n !== '' && n !== '\n' ? 2 : 1);
|
|
312
|
+
}
|
|
313
|
+
else if (c === '{' && quote === undefined) {
|
|
314
|
+
flush();
|
|
315
|
+
const at = pos++;
|
|
316
|
+
nodes.push({ type: 'group', children: seq(mode, true, parent, at), at });
|
|
284
317
|
}
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
RdMacroUseAt.lastIndex = i;
|
|
294
|
-
const use = RdMacroUseAt.exec(text);
|
|
295
|
-
if (use === null) {
|
|
296
|
-
i++; // a lone escape, e.g. `\{` or `\%`, is content, not a boundary
|
|
297
|
-
continue;
|
|
318
|
+
else if (c === '}' && quote === undefined) {
|
|
319
|
+
pos++;
|
|
320
|
+
if (closing) {
|
|
321
|
+
flush();
|
|
322
|
+
closed = true;
|
|
323
|
+
return nodes;
|
|
324
|
+
}
|
|
325
|
+
syntax(pos - 1, 'unexpected \'}\'');
|
|
298
326
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
327
|
+
else {
|
|
328
|
+
if (mode === 'r' && quote !== undefined) {
|
|
329
|
+
quote = c === quote ? undefined : quote;
|
|
330
|
+
}
|
|
331
|
+
else if (mode === 'r' && !comment && /["'`#]/.test(c)) {
|
|
332
|
+
[comment, quote, quoteAt] = c === '#' ? [true, undefined, quoteAt] : [false, c, pos];
|
|
333
|
+
}
|
|
334
|
+
comment &&= c !== '\n';
|
|
335
|
+
add(1);
|
|
336
|
+
if (c === '\n') {
|
|
337
|
+
flush();
|
|
338
|
+
}
|
|
302
339
|
}
|
|
303
|
-
found.push(...child.found);
|
|
304
|
-
i = child.end - 1;
|
|
305
340
|
}
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
const
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
341
|
+
flush();
|
|
342
|
+
if (!ended && (quote !== undefined || closing)) {
|
|
343
|
+
ended = true;
|
|
344
|
+
syntax(quote !== undefined ? quoteAt : open, quote !== undefined
|
|
345
|
+
? `Unexpected end of input (in ${quote} quoted string opened at line ${lineOf(quoteAt)})`
|
|
346
|
+
: `unexpected END_OF_INPUT (the '{' on line ${lineOf(open)} is never closed)`);
|
|
347
|
+
}
|
|
348
|
+
closed = false;
|
|
349
|
+
return nodes;
|
|
350
|
+
};
|
|
351
|
+
const macro = (nodes, parent) => {
|
|
352
|
+
const at = pos++;
|
|
353
|
+
RdMacroName.lastIndex = pos;
|
|
354
|
+
const name = RdMacroName.exec(src)?.[0] ?? '';
|
|
355
|
+
pos += name.length;
|
|
356
|
+
const spec = specOf(name, parent);
|
|
357
|
+
if (spec === undefined && !lenient) {
|
|
358
|
+
problems.push({ at, kind: 'unknown', text: `unknown macro '\\${name}'` });
|
|
359
|
+
}
|
|
360
|
+
let option;
|
|
361
|
+
if ((name === 'link' || name === 'Sexpr') && src[pos] === '[' && src.indexOf(']', pos) > 0) {
|
|
362
|
+
option = src.slice(pos + 1, src.indexOf(']', pos));
|
|
363
|
+
pos += option.length + 2;
|
|
320
364
|
}
|
|
321
|
-
|
|
322
|
-
const
|
|
323
|
-
|
|
324
|
-
|
|
365
|
+
const args = [];
|
|
366
|
+
const spans = [];
|
|
367
|
+
const count = spec?.length ?? (lenient ? Infinity : 1);
|
|
368
|
+
for (let i = 0; i < count; i++) {
|
|
369
|
+
const mode = spec?.[i] ?? 'T';
|
|
370
|
+
const [save, required] = [pos, /[a-z]/.test(mode)];
|
|
371
|
+
if ((i > 0 && required) || (i === 0 && !required && /^\s*\{/.test(src.slice(pos, pos + 64)))) {
|
|
372
|
+
while (Whitespace.test(src[pos] ?? '')) {
|
|
373
|
+
pos++;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
if (src[pos] !== '{') {
|
|
377
|
+
if (required && (i > 0 || /^\s+\{/.test(src.slice(save, save + 8)))) {
|
|
378
|
+
syntax(pos, 'bad markup (extra space?)');
|
|
379
|
+
}
|
|
380
|
+
break;
|
|
381
|
+
}
|
|
382
|
+
const from = ++pos;
|
|
383
|
+
args.push(seq(mode.toLowerCase(), true, spec === undefined ? parent : name, from - 1));
|
|
384
|
+
spans.push([from, closed ? pos - 1 : -1]);
|
|
325
385
|
}
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
break; // an unclosed group swallows the rest of the page; nothing past it can be trusted
|
|
386
|
+
if (spec !== undefined || lenient) {
|
|
387
|
+
nodes.push({ type: 'macro', name, at, option, args, spans });
|
|
329
388
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
389
|
+
};
|
|
390
|
+
const nodes = seq('t', false, undefined, 0);
|
|
391
|
+
return { text: src, nodes, problems, lineOf };
|
|
392
|
+
}
|
|
393
|
+
/** The bodies of every `\macro{...}` of a scan, keyed by macro and in order; a use inside a group of the same macro is no second use (`\alias{\alias{x}}`), and nothing in a macro left unclosed is trusted. */
|
|
394
|
+
function macroGroups(scan) {
|
|
395
|
+
const groups = new Map();
|
|
396
|
+
const visit = (nodes, inside) => {
|
|
397
|
+
for (const n of nodes) {
|
|
398
|
+
if (n.type === 'group') {
|
|
399
|
+
visit(n.children, inside);
|
|
400
|
+
}
|
|
401
|
+
else if (n.type === 'macro' && n.spans.length > 0 && n.spans.every(([, to]) => to >= 0)) {
|
|
402
|
+
if (!inside.has(n.name)) {
|
|
403
|
+
groups.set(n.name, [...groups.get(n.name) ?? [], scan.text.slice(...n.spans[0])]);
|
|
404
|
+
}
|
|
405
|
+
n.args.forEach(a => visit(a, new Set([...inside, n.name])));
|
|
333
406
|
}
|
|
334
|
-
recordedUntil.set(macro, end);
|
|
335
|
-
groups.set(macro, [...groups.get(macro) ?? [], body]);
|
|
336
407
|
}
|
|
337
|
-
|
|
338
|
-
|
|
408
|
+
};
|
|
409
|
+
visit(scan.nodes, new Set());
|
|
339
410
|
return groups;
|
|
340
411
|
}
|
|
341
412
|
/** the characters an Rd backslash escapes to their literal selves, rather than starting a macro */
|
|
@@ -557,9 +628,7 @@ function expandMacrosOnce(text, macros) {
|
|
|
557
628
|
}
|
|
558
629
|
/** Parses one `.Rd` manual page: `content` is the raw page, `fallbackName` the topic to assume when the page states no `\name{}` (usually the file's basename), and `macros` the package's own `\newcommand`s, so a page using them states what it renders. */
|
|
559
630
|
function parseRdPage(content, fallbackName = '', macros) {
|
|
560
|
-
const
|
|
561
|
-
const text = macros !== undefined && macros.size > 0 ? expandRdMacros(stripped, macros) : stripped;
|
|
562
|
-
const groups = macroGroups(text);
|
|
631
|
+
const groups = macroGroups(scanRd(content, { macros, lenient: true, specOf: n => n === 'usage' || n === 'examples' ? 'R' : undefined }));
|
|
563
632
|
const one = (macro) => groups.get(macro)?.[0];
|
|
564
633
|
const many = (macro) => (groups.get(macro) ?? []).map(plainText).filter(e => e.length > 0);
|
|
565
634
|
const [name, title, docType] = [one('name'), one('title'), one('docType')];
|
|
@@ -253,7 +253,6 @@ class RDAParser {
|
|
|
253
253
|
shortcut;
|
|
254
254
|
buffer;
|
|
255
255
|
currentDepth = 0;
|
|
256
|
-
static INITIAL_DEPTH = 1;
|
|
257
256
|
offset = 0;
|
|
258
257
|
static R_CODE_SET_MAX = 2 ** 6 - 1;
|
|
259
258
|
RWeakRefs = null;
|
|
@@ -309,23 +308,21 @@ class RDAParser {
|
|
|
309
308
|
const limit = secure_mode_1.SecureMode.decompressionLimit();
|
|
310
309
|
switch (compressionType) {
|
|
311
310
|
case CompressionType.CompGz: {
|
|
312
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
311
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports -- loaded on demand, so bundles without gzip files do not pull in zlib
|
|
313
312
|
const zlib = require('zlib');
|
|
314
313
|
try {
|
|
315
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
|
316
314
|
buffer = zlib.gunzipSync(fileContent, { maxOutputLength: limit });
|
|
317
315
|
}
|
|
318
316
|
catch (e) {
|
|
319
317
|
if (e.code === 'ERR_BUFFER_TOO_LARGE') {
|
|
320
318
|
throw e;
|
|
321
319
|
}
|
|
322
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment,@typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
|
323
320
|
buffer = zlib.inflateSync(fileContent, { maxOutputLength: limit });
|
|
324
321
|
}
|
|
325
322
|
break;
|
|
326
323
|
}
|
|
327
324
|
case CompressionType.CompBz: {
|
|
328
|
-
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
|
325
|
+
// eslint-disable-next-line @typescript-eslint/no-require-imports -- the untyped `bzip2` package has no module declaration, and is loaded on demand
|
|
329
326
|
const bzip2 = require('bzip2');
|
|
330
327
|
buffer = bunzip(bzip2, fileContent, limit);
|
|
331
328
|
break;
|
|
@@ -1523,18 +1520,9 @@ class RDAParser {
|
|
|
1523
1520
|
this.skipInteger();
|
|
1524
1521
|
type = this.assertInteger(this.inInteger());
|
|
1525
1522
|
}
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
case SexpType.AltLangSxp:
|
|
1529
|
-
type = SexpType.LangSxp;
|
|
1530
|
-
hasAttr = true;
|
|
1531
|
-
break;
|
|
1532
|
-
case SexpType.AttrListSxp:
|
|
1533
|
-
type = SexpType.ListSxp;
|
|
1534
|
-
hasAttr = true;
|
|
1535
|
-
break;
|
|
1523
|
+
if (type === SexpType.AltLangSxp || type === SexpType.AttrListSxp) {
|
|
1524
|
+
hasAttr = true;
|
|
1536
1525
|
}
|
|
1537
|
-
/* eslint-enable no-useless-assignment */
|
|
1538
1526
|
this.currentDepth++;
|
|
1539
1527
|
if (hasAttr) {
|
|
1540
1528
|
this.skipItem();
|
|
@@ -23,6 +23,8 @@ export declare class FlowrRMarkdownFile extends FlowrFile {
|
|
|
23
23
|
*/
|
|
24
24
|
get rmd(): RmdInfo;
|
|
25
25
|
get executableCells(): CodeBlock[];
|
|
26
|
+
/** The text of the document itself, as its content is only the code it holds. */
|
|
27
|
+
rawText(): string;
|
|
26
28
|
/**
|
|
27
29
|
* Loads and parses the content of the wrapped file.
|
|
28
30
|
* @returns RmdInfo
|
|
@@ -48,6 +48,10 @@ class FlowrRMarkdownFile extends flowr_file_1.FlowrFile {
|
|
|
48
48
|
const defaults = globalChunkOptions(this.rmd.options);
|
|
49
49
|
return this.rmd.blocks.filter(b => isExecutableCell(b, defaults));
|
|
50
50
|
}
|
|
51
|
+
/** The text of the document itself, as its content is only the code it holds. */
|
|
52
|
+
rawText() {
|
|
53
|
+
return this.wrapped.content().toString();
|
|
54
|
+
}
|
|
51
55
|
/**
|
|
52
56
|
* Loads and parses the content of the wrapped file.
|
|
53
57
|
* @returns RmdInfo
|
|
@@ -17,6 +17,8 @@ export declare class FlowrSweaveFile extends FlowrFile {
|
|
|
17
17
|
* The content of the Sweave file.
|
|
18
18
|
*/
|
|
19
19
|
get rnw(): SweaveInfo;
|
|
20
|
+
/** The text of the document itself, as its content is only the code it holds. */
|
|
21
|
+
rawText(): string;
|
|
20
22
|
/**
|
|
21
23
|
* Loads and parses the content of the wrapped file.
|
|
22
24
|
* @returns the content of the Sweave file, which is the R code without the latex code, no-eval blocks, ...
|
|
@@ -31,6 +31,10 @@ class FlowrSweaveFile extends flowr_file_1.FlowrFile {
|
|
|
31
31
|
(0, assert_1.guard)(this.data);
|
|
32
32
|
return this.data;
|
|
33
33
|
}
|
|
34
|
+
/** The text of the document itself, as its content is only the code it holds. */
|
|
35
|
+
rawText() {
|
|
36
|
+
return this.wrapped.content().toString();
|
|
37
|
+
}
|
|
34
38
|
/**
|
|
35
39
|
* Loads and parses the content of the wrapped file.
|
|
36
40
|
* @returns the content of the Sweave file, which is the R code without the latex code, no-eval blocks, ...
|
|
@@ -4,7 +4,7 @@ exports.FlowrAnalyzerMetaTestFilesPlugin = void 0;
|
|
|
4
4
|
const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
|
|
5
5
|
const semver_1 = require("semver");
|
|
6
6
|
const flowr_file_1 = require("../../context/flowr-file");
|
|
7
|
-
const TestPathPattern = /tests
|
|
7
|
+
const TestPathPattern = /(^|\/)tests?(\/|$)/i;
|
|
8
8
|
/**
|
|
9
9
|
* This plugin provides supports for the identification of test files.
|
|
10
10
|
* If you use multiple plugins, this should be included *before* other plugins.
|
|
@@ -4,7 +4,7 @@ exports.FlowrAnalyzerMetaVignetteFilesPlugin = void 0;
|
|
|
4
4
|
const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
|
|
5
5
|
const semver_1 = require("semver");
|
|
6
6
|
const flowr_file_1 = require("../../context/flowr-file");
|
|
7
|
-
const VignettePathPattern = /vignettes
|
|
7
|
+
const VignettePathPattern = /(^|\/)vignettes?(\/|$)/i;
|
|
8
8
|
/**
|
|
9
9
|
* This plugin provides supports for the loading of Vignette files.
|
|
10
10
|
* If you use multiple plugins, this should be included *before* other plugins.
|
|
@@ -10,5 +10,4 @@ export declare class FlowrAnalyzerPackageVersionsDescriptionFilePlugin extends F
|
|
|
10
10
|
readonly description = "Extracts package versions from DESCRIPTION files.";
|
|
11
11
|
readonly version: SemVer;
|
|
12
12
|
process(ctx: FlowrAnalyzerContext): void;
|
|
13
|
-
private retrieveVersionsFromField;
|
|
14
13
|
}
|
|
@@ -17,11 +17,7 @@ class FlowrAnalyzerPackageVersionsDescriptionFilePlugin extends flowr_analyzer_p
|
|
|
17
17
|
if (deps === undefined) {
|
|
18
18
|
return;
|
|
19
19
|
}
|
|
20
|
-
|
|
21
|
-
this.retrieveVersionsFromField(ctx, deps.imports() ?? []);
|
|
22
|
-
}
|
|
23
|
-
retrieveVersionsFromField(ctx, pkgs) {
|
|
24
|
-
for (const pkg of pkgs) {
|
|
20
|
+
for (const pkg of [...deps.depends() ?? [], ...deps.imports() ?? []]) {
|
|
25
21
|
ctx.deps.addDeclaredDependency(pkg);
|
|
26
22
|
}
|
|
27
23
|
}
|
package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.d.ts
CHANGED
|
@@ -2,6 +2,8 @@ import { FlowrAnalyzerPackageVersionsPlugin } from './flowr-analyzer-package-ver
|
|
|
2
2
|
import { SemVer } from 'semver';
|
|
3
3
|
import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
|
|
4
4
|
export declare const lockfileLog: import("tslog").Logger<import("tslog").ILogObj>;
|
|
5
|
+
/** Declares the dependency `name` pinned to the given `version`. */
|
|
6
|
+
export declare function pin(ctx: FlowrAnalyzerContext, name: string, version: string): void;
|
|
5
7
|
/** Reads package versions from an `renv.lock` (JSON). renv pins are exact. */
|
|
6
8
|
export declare class FlowrAnalyzerPackageVersionsRenvPlugin extends FlowrAnalyzerPackageVersionsPlugin {
|
|
7
9
|
readonly name = "flowr-analyzer-package-versions-renv-plugin";
|
package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowrAnalyzerPackageVersionsUvrPlugin = exports.FlowrAnalyzerPackageVersionsRvPlugin = exports.FlowrAnalyzerPackageVersionsPackratPlugin = exports.FlowrAnalyzerPackageVersionsRenvPlugin = exports.lockfileLog = void 0;
|
|
4
|
+
exports.pin = pin;
|
|
4
5
|
const flowr_analyzer_package_versions_plugin_1 = require("./flowr-analyzer-package-versions-plugin");
|
|
5
6
|
const semver_1 = require("semver");
|
|
6
7
|
const package_1 = require("./package");
|
|
@@ -15,6 +16,7 @@ exports.lockfileLog = log_1.log.getSubLogger({ name: 'flowr-analyzer-package-ver
|
|
|
15
16
|
function virtualEnvFiles(ctx, name) {
|
|
16
17
|
return ctx.files.getFilesByRole(flowr_file_1.FileRole.VirtualEnv).filter(f => (0, built_in_source_1.platformBasename)(f.path()).toLowerCase() === name);
|
|
17
18
|
}
|
|
19
|
+
/** Declares the dependency `name` pinned to the given `version`. */
|
|
18
20
|
function pin(ctx, name, version) {
|
|
19
21
|
const range = package_1.Package.parsePkgVersionRange(undefined, version);
|
|
20
22
|
ctx.deps.addDeclaredDependency(new package_1.Package({ name, versionConstraints: range ? [range] : undefined }));
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FlowrAnalyzerPackageVersionsSessionInfoPlugin = exports.sessionInfoLog = void 0;
|
|
4
4
|
const flowr_analyzer_package_versions_plugin_1 = require("./flowr-analyzer-package-versions-plugin");
|
|
5
5
|
const semver_1 = require("semver");
|
|
6
|
-
const
|
|
6
|
+
const flowr_analyzer_package_versions_lockfile_plugin_1 = require("./flowr-analyzer-package-versions-lockfile-plugin");
|
|
7
7
|
const flowr_file_1 = require("../../context/flowr-file");
|
|
8
8
|
const log_1 = require("../../../util/log");
|
|
9
9
|
exports.sessionInfoLog = log_1.log.getSubLogger({ name: 'flowr-analyzer-package-versions-session-info-plugin' });
|
|
@@ -15,10 +15,6 @@ const packageHeaderRe = /\b(?:other attached packages|loaded via a namespace \(a
|
|
|
15
15
|
const packageListingLineRe = /\[\d+\]\s*(.+)$/gm;
|
|
16
16
|
/** a single `name_version` token within a listing line, e.g. `dplyr_1.1.2` or `data.table_1.14.8` */
|
|
17
17
|
const packageTokenRe = /([A-Za-z][A-Za-z0-9.]*)_(\d+(?:[.-]\d+)+)/g;
|
|
18
|
-
function pin(ctx, name, version) {
|
|
19
|
-
const range = package_1.Package.parsePkgVersionRange(undefined, version);
|
|
20
|
-
ctx.deps.addDeclaredDependency(new package_1.Package({ name, versionConstraints: range ? [range] : undefined }));
|
|
21
|
-
}
|
|
22
18
|
/**
|
|
23
19
|
* Reads package (and R) versions from a pasted `sessionInfo()` output block within a source file (typically inside
|
|
24
20
|
* a comment). This is how R users record a reproducible environment, so when present it pins exact versions, just
|
|
@@ -51,10 +47,10 @@ class FlowrAnalyzerPackageVersionsSessionInfoPlugin extends flowr_analyzer_packa
|
|
|
51
47
|
return;
|
|
52
48
|
}
|
|
53
49
|
if (rVersionMatch) {
|
|
54
|
-
pin(ctx, 'R', rVersionMatch[1]);
|
|
50
|
+
(0, flowr_analyzer_package_versions_lockfile_plugin_1.pin)(ctx, 'R', rVersionMatch[1]);
|
|
55
51
|
}
|
|
56
52
|
for (const [name, version] of packages) {
|
|
57
|
-
pin(ctx, name, version);
|
|
53
|
+
(0, flowr_analyzer_package_versions_lockfile_plugin_1.pin)(ctx, name, version);
|
|
58
54
|
}
|
|
59
55
|
}
|
|
60
56
|
}
|
package/project/sigdb/build.js
CHANGED
|
@@ -497,23 +497,14 @@ function optimizeStringOrder(strings, blobs) {
|
|
|
497
497
|
}
|
|
498
498
|
/** flush a batch line once its serialized size reaches roughly this many bytes (keeps lines under the string cap) */
|
|
499
499
|
const NdjsonBatchBytes = 8_000_000;
|
|
500
|
-
|
|
501
|
-
* Batch the string dictionary into `["d", startIdx, "s1\ns2\n…"]` lines: one newline-delimited blob per line
|
|
502
|
-
* rather than a JSON array of quoted strings, which loads as a single `split('\n')` instead of parsing ~1.4M elements.
|
|
503
|
-
*/
|
|
504
|
-
function* dictLines(strings) {
|
|
505
|
-
/* a line holding no names would read back as one empty name */
|
|
506
|
-
if (strings.length === 0) {
|
|
507
|
-
return;
|
|
508
|
-
}
|
|
500
|
+
function* batched(count, part, line) {
|
|
509
501
|
let start = 0;
|
|
510
502
|
let parts = [];
|
|
511
503
|
let bytes = 0;
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
const s = strings[i];
|
|
504
|
+
for (let i = 0; i < count; i++) {
|
|
505
|
+
const s = part(i);
|
|
515
506
|
if (parts.length > 0 && bytes + s.length + 1 > NdjsonBatchBytes) {
|
|
516
|
-
yield line(start);
|
|
507
|
+
yield line(start, parts);
|
|
517
508
|
start = i;
|
|
518
509
|
parts = [];
|
|
519
510
|
bytes = 0;
|
|
@@ -521,26 +512,21 @@ function* dictLines(strings) {
|
|
|
521
512
|
parts.push(s);
|
|
522
513
|
bytes += s.length + 1;
|
|
523
514
|
}
|
|
524
|
-
yield line(start);
|
|
515
|
+
yield line(start, parts);
|
|
516
|
+
}
|
|
517
|
+
/**
|
|
518
|
+
* Batch the string dictionary into `["d", startIdx, "s1\ns2\n…"]` lines: one newline-delimited blob per line
|
|
519
|
+
* rather than a JSON array of quoted strings, which loads as a single `split('\n')` instead of parsing ~1.4M elements.
|
|
520
|
+
*/
|
|
521
|
+
function* dictLines(strings) {
|
|
522
|
+
/* a line holding no names would read back as one empty name */
|
|
523
|
+
if (strings.length > 0) {
|
|
524
|
+
yield* batched(strings.length, i => strings[i], (from, parts) => `["d",${from},${JSON.stringify(parts.join('\n'))}]`);
|
|
525
|
+
}
|
|
525
526
|
}
|
|
526
527
|
/** batch an array into `[tag, startIdx, [...]]` lines that never approach V8's string cap */
|
|
527
528
|
function* batchLines(tag, arr) {
|
|
528
|
-
|
|
529
|
-
let parts = [];
|
|
530
|
-
let bytes = 0;
|
|
531
|
-
const line = (from) => `["${tag}",${from},[${parts.join(',')}]]`;
|
|
532
|
-
for (let i = 0; i < arr.length; i++) {
|
|
533
|
-
const s = JSON.stringify(arr[i]);
|
|
534
|
-
if (parts.length > 0 && bytes + s.length + 1 > NdjsonBatchBytes) {
|
|
535
|
-
yield line(start);
|
|
536
|
-
start = i;
|
|
537
|
-
parts = [];
|
|
538
|
-
bytes = 0;
|
|
539
|
-
}
|
|
540
|
-
parts.push(s);
|
|
541
|
-
bytes += s.length + 1;
|
|
542
|
-
}
|
|
543
|
-
yield line(start);
|
|
529
|
+
yield* batched(arr.length, i => JSON.stringify(arr[i]), (from, parts) => `["${tag}",${from},[${parts.join(',')}]]`);
|
|
544
530
|
}
|
|
545
531
|
// large window shaves ~15% off the `.br`; every read path decodes with `BROTLI_DECODER_PARAM_LARGE_WINDOW`
|
|
546
532
|
const DefaultBrotliLgwin = 30;
|
package/project/sigdb/dict.d.ts
CHANGED
|
@@ -15,13 +15,11 @@ export declare class SigDict implements Iterable<string> {
|
|
|
15
15
|
/** The dictionary `names` spells out. */
|
|
16
16
|
static of(names: readonly string[]): SigDict;
|
|
17
17
|
/**
|
|
18
|
-
* The dictionary
|
|
19
|
-
*
|
|
18
|
+
* The dictionary a bundle's `d` lines spell out, each `["d", start, "name\nname..."]` (or the legacy `["d", start, [names]]`).
|
|
19
|
+
* The names are unescaped from the line's bytes straight into the dictionary, as parsing every line into a string only to
|
|
20
|
+
* encode it back took most of the time opening a database costs. The runs must cover the ids from `0` without a gap.
|
|
20
21
|
*/
|
|
21
|
-
static
|
|
22
|
-
start: number;
|
|
23
|
-
names: string;
|
|
24
|
-
}[]): SigDict;
|
|
22
|
+
static ofLines(lines: Buffer): SigDict;
|
|
25
23
|
/** how many names it holds */
|
|
26
24
|
get length(): number;
|
|
27
25
|
/** The name with the given id, `''` for an id the dictionary does not hold. */
|