@eagleoutice/flowr 2.14.4 → 2.15.1
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 +77 -64
- package/abstract-interpretation/absint-inference.d.ts +347 -0
- package/abstract-interpretation/{absint-visitor.js → absint-inference.js} +327 -97
- package/abstract-interpretation/abstract-semantics.d.ts +246 -0
- package/abstract-interpretation/abstract-semantics.js +3 -0
- package/abstract-interpretation/data-frame/{mappers/arguments.d.ts → arguments.d.ts} +18 -16
- package/abstract-interpretation/data-frame/{mappers/arguments.js → arguments.js} +20 -21
- package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +52 -0
- package/abstract-interpretation/data-frame/dataframe-semantics.js +1665 -0
- package/abstract-interpretation/data-frame/resolve-args.js +4 -4
- package/abstract-interpretation/data-frame/semantics.d.ts +15 -21
- package/abstract-interpretation/data-frame/semantics.js +27 -29
- package/abstract-interpretation/data-frame/shape-inference.d.ts +28 -24
- package/abstract-interpretation/data-frame/shape-inference.js +14 -79
- package/abstract-interpretation/domains/interval-domain.d.ts +5 -1
- package/abstract-interpretation/domains/interval-domain.js +25 -33
- package/abstract-interpretation/domains/multi-value-state-domain.d.ts +6 -3
- package/abstract-interpretation/domains/multi-value-state-domain.js +24 -4
- package/abstract-interpretation/domains/partial-product-domain.d.ts +12 -6
- package/abstract-interpretation/domains/partial-product-domain.js +26 -43
- package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -6
- package/abstract-interpretation/domains/positive-interval-domain.js +3 -29
- package/abstract-interpretation/domains/product-domain.d.ts +1 -1
- package/abstract-interpretation/domains/set-range-domain.d.ts +6 -0
- package/abstract-interpretation/domains/set-range-domain.js +29 -62
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +9 -2
- package/abstract-interpretation/domains/state-abstract-domain.js +26 -37
- package/abstract-interpretation/domains/{state-domain-like.d.ts → state-domain.d.ts} +10 -6
- package/abstract-interpretation/domains/{state-domain-like.js → state-domain.js} +1 -1
- package/abstract-interpretation/value-semantics.d.ts +113 -0
- package/abstract-interpretation/value-semantics.js +115 -0
- package/benchmark/slicer.js +12 -6
- package/benchmark/stats/feature-counts.d.ts +2 -1
- package/benchmark/stats/feature-counts.js +25 -1
- package/benchmark/stats/stats.d.ts +4 -0
- package/benchmark/summarizer/second-phase/graph.js +7 -0
- package/cli/repl/commands/repl-parse.js +11 -22
- package/cli/repl/parser/slice-query-parser.d.ts +2 -0
- package/cli/repl/parser/slice-query-parser.js +1 -0
- package/config.d.ts +30 -205
- package/config.js +37 -3
- package/control-flow/cfg-properties.d.ts +5 -0
- package/control-flow/cfg-properties.js +25 -7
- package/control-flow/control-flow-graph.d.ts +11 -37
- package/control-flow/control-flow-graph.js +33 -77
- package/control-flow/semantic-cfg-guided-visitor.d.ts +63 -320
- package/control-flow/semantic-cfg-guided-visitor.js +65 -320
- package/dataflow/environments/built-in-config.d.ts +2 -0
- package/dataflow/environments/built-in-proc-name.d.ts +4 -0
- package/dataflow/environments/built-in-proc-name.js +4 -0
- package/dataflow/environments/built-in-props.d.ts +192 -82
- package/dataflow/environments/built-in-props.js +336 -106
- package/dataflow/environments/built-in.d.ts +21 -9
- package/dataflow/environments/built-in.js +43 -12
- package/dataflow/environments/default-builtin-config.d.ts +3219 -313
- package/dataflow/environments/default-builtin-config.js +803 -1012
- package/dataflow/environments/environment.d.ts +26 -49
- package/dataflow/environments/environment.js +34 -47
- package/dataflow/environments/group-generics.d.ts +11 -2
- package/dataflow/environments/group-generics.js +22 -3
- package/dataflow/environments/identifier.d.ts +106 -6
- package/dataflow/environments/identifier.js +19 -1
- package/dataflow/environments/query-fn-props.d.ts +16 -8
- package/dataflow/environments/query-fn-props.js +45 -21
- package/dataflow/environments/resolve-by-name.js +9 -2
- package/dataflow/environments/scoping.d.ts +5 -0
- package/dataflow/environments/scoping.js +11 -0
- package/dataflow/eval/resolve/alias-tracking.d.ts +1 -1
- package/dataflow/eval/resolve/alias-tracking.js +24 -6
- package/dataflow/eval/resolve/resolve-numbers.d.ts +182 -7
- package/dataflow/eval/resolve/resolve-numbers.js +44 -9
- package/dataflow/eval/resolve/resolve-strings.d.ts +79 -2
- package/dataflow/eval/resolve/resolve-strings.js +16 -7
- package/dataflow/eval/resolve/resolve.d.ts +5 -22
- package/dataflow/eval/resolve/resolve.js +34 -34
- package/dataflow/eval/values/general.d.ts +9 -1
- package/dataflow/eval/values/general.js +22 -3
- package/dataflow/eval/values/sets/set-constants.d.ts +5 -0
- package/dataflow/eval/values/sets/set-constants.js +9 -1
- package/dataflow/eval/values/string/string-constants.d.ts +16 -15
- package/dataflow/eval/values/string/string-constants.js +59 -27
- package/dataflow/extractor.d.ts +2 -1
- package/dataflow/extractor.js +16 -4
- package/dataflow/fn/argument-roles.d.ts +35 -0
- package/dataflow/fn/argument-roles.js +252 -0
- package/dataflow/fn/class-declaration.d.ts +148 -0
- package/dataflow/fn/class-declaration.js +317 -0
- package/dataflow/fn/condition-handlers.d.ts +5 -0
- package/dataflow/fn/condition-handlers.js +13 -0
- package/dataflow/fn/exceptions-of-function.d.ts +21 -7
- package/dataflow/fn/exceptions-of-function.js +74 -43
- package/dataflow/fn/frame-reflection.d.ts +46 -0
- package/dataflow/fn/frame-reflection.js +169 -0
- package/dataflow/fn/function-props.d.ts +32 -0
- package/dataflow/fn/function-props.js +160 -0
- package/dataflow/fn/higher-order-function.d.ts +23 -5
- package/dataflow/fn/higher-order-function.js +64 -18
- package/dataflow/fn/strict-function.d.ts +24 -2
- package/dataflow/fn/strict-function.js +49 -19
- package/dataflow/graph/call-graph.js +10 -2
- package/dataflow/graph/df-helper.d.ts +1 -12
- package/dataflow/graph/df-helper.js +2 -19
- package/dataflow/graph/diff-dataflow-graph.d.ts +1 -1
- package/dataflow/graph/diff-dataflow-graph.js +2 -2
- package/dataflow/graph/graph.d.ts +39 -188
- package/dataflow/graph/graph.js +46 -163
- package/dataflow/graph/match-args.d.ts +34 -2
- package/dataflow/graph/match-args.js +45 -12
- package/dataflow/graph/vertex.d.ts +8 -0
- package/dataflow/info.d.ts +7 -5
- package/dataflow/info.js +1 -5
- package/dataflow/internal/control-flow.js +20 -17
- package/dataflow/internal/linker.d.ts +8 -37
- package/dataflow/internal/linker.js +22 -55
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +7 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +3 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +8 -14
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +43 -50
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.d.ts +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.d.ts +23 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-class-relation.js +24 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +0 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +73 -27
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +131 -92
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +17 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +187 -99
- package/dataflow/internal/process/functions/call/built-in/built-in-load.d.ts +4 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-load.js +2 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +4 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +0 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.d.ts +31 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-four.js +101 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +23 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +22 -1
- package/dataflow/internal/process/functions/call/common.d.ts +4 -6
- package/dataflow/internal/process/functions/call/common.js +2 -2
- package/dataflow/internal/process/functions/call/deferred.d.ts +1 -1
- package/dataflow/internal/process/functions/call/deferred.js +2 -2
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +5 -3
- package/dataflow/internal/process/functions/call/known-call-handling.js +6 -4
- package/dataflow/internal/process/functions/call/named-call-handling.js +19 -13
- package/dataflow/internal/process/functions/call/quoted.d.ts +2 -2
- package/dataflow/internal/process/functions/call/quoted.js +144 -28
- package/dataflow/origin/dfg-get-origin.js +23 -10
- package/dataflow/processor.d.ts +2 -1
- package/dataflow/processor.js +6 -0
- package/documentation/data/interface/doc-writing-code.js +2 -0
- package/documentation/doc-util/doc-search.js +1 -1
- package/documentation/wiki-absint.d.ts +11 -14
- package/documentation/wiki-absint.js +73 -59
- package/documentation/wiki-core.js +64 -24
- package/documentation/wiki-linter.js +1 -0
- package/documentation/wiki-query.js +82 -264
- package/documentation/wiki-signature-database.js +17 -5
- package/gas.d.ts +91 -47
- package/gas.js +97 -13
- package/index.d.ts +31 -0
- package/index.js +52 -0
- package/linter/linter-rules.d.ts +87 -23
- package/linter/linter-rules.js +3 -1
- package/linter/rules/absolute-path.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +10 -8
- package/linter/rules/dead-code.d.ts +1 -1
- package/linter/rules/deprecated-functions.js +14 -5
- package/linter/rules/file-path-validity.d.ts +1 -1
- package/linter/rules/naming-convention.d.ts +1 -1
- package/linter/rules/naming-convention.js +13 -2
- package/linter/rules/network-functions.d.ts +10 -5
- package/linter/rules/network-functions.js +48 -36
- package/linter/rules/no-leaked-credentials.d.ts +1 -1
- package/linter/rules/problematic-inputs.d.ts +1 -1
- package/linter/rules/problematic-inputs.js +1 -1
- package/linter/rules/seeded-randomness.d.ts +3 -2
- package/linter/rules/seeded-randomness.js +7 -3
- package/linter/rules/software-has-license.d.ts +1 -1
- package/linter/rules/software-has-tests.d.ts +1 -1
- package/linter/rules/stop-with-call-arg.d.ts +1 -1
- package/linter/rules/syntactically-valid.d.ts +1 -1
- package/linter/rules/unclosed-connection.d.ts +3 -3
- package/linter/rules/unclosed-connection.js +3 -4
- package/linter/rules/undefined-symbol.d.ts +1 -1
- package/linter/rules/unescaped-arguments.d.ts +161 -0
- package/linter/rules/unescaped-arguments.js +293 -0
- package/linter/rules/unused-definition.d.ts +1 -1
- package/linter/rules/unused-definition.js +49 -4
- package/linter/rules/unused-import.d.ts +1 -1
- package/linter/rules/useless-loop.d.ts +1 -1
- package/package.json +3 -198
- package/project/context/flowr-analyzer-environment-context.d.ts +12 -1
- package/project/context/flowr-analyzer-environment-context.js +33 -1
- package/project/context/flowr-analyzer-files-context.d.ts +24 -1
- package/project/context/flowr-analyzer-files-context.js +42 -21
- package/project/context/flowr-analyzer-functions-context.d.ts +8 -0
- package/project/context/flowr-analyzer-functions-context.js +2 -0
- package/project/context/flowr-analyzer-gas-context.d.ts +9 -1
- package/project/context/flowr-analyzer-gas-context.js +21 -0
- package/project/context/flowr-file.d.ts +16 -1
- package/project/context/flowr-file.js +26 -2
- package/project/plugins/file-plugins/files/flowr-description-file.d.ts +19 -20
- package/project/plugins/file-plugins/files/flowr-description-file.js +55 -41
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +9 -4
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +11 -3
- package/project/plugins/file-plugins/files/flowr-manifest-files.d.ts +6 -9
- package/project/plugins/file-plugins/files/flowr-manifest-files.js +5 -21
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +11 -12
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +48 -61
- package/project/plugins/file-plugins/files/flowr-news-file.d.ts +3 -12
- package/project/plugins/file-plugins/files/flowr-news-file.js +2 -19
- package/project/plugins/file-plugins/files/flowr-rd-file.d.ts +145 -0
- package/project/plugins/file-plugins/files/flowr-rd-file.js +676 -0
- package/project/plugins/file-plugins/files/flowr-rda-file.d.ts +122 -422
- package/project/plugins/file-plugins/files/flowr-rda-file.js +517 -1005
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.d.ts +8 -2
- package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +10 -1
- package/project/plugins/file-plugins/files/flowr-sweave-file.d.ts +7 -2
- package/project/plugins/file-plugins/files/flowr-sweave-file.js +9 -1
- package/project/plugins/file-plugins/files/flowr-sysdata-file.d.ts +17 -0
- package/project/plugins/file-plugins/files/flowr-sysdata-file.js +40 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +2 -0
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +3 -1
- package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.d.ts +58 -0
- package/project/plugins/file-plugins/flowr-analyzer-rd-file-plugin.js +95 -0
- package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.d.ts +23 -0
- package/project/plugins/file-plugins/flowr-analyzer-sysdata-file-plugin.js +33 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +33 -72
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +17 -15
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.d.ts +20 -37
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +29 -53
- package/project/plugins/package-version-plugins/package.js +2 -1
- package/project/plugins/plugin-registry.d.ts +3 -1
- package/project/plugins/plugin-registry.js +11 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +20 -4
- package/project/sigdb/build.d.ts +9 -15
- package/project/sigdb/build.js +101 -42
- package/project/sigdb/decode.d.ts +10 -4
- package/project/sigdb/decode.js +60 -21
- package/project/sigdb/memory-source.d.ts +4 -0
- package/project/sigdb/memory-source.js +8 -0
- package/project/sigdb/reader.d.ts +57 -100
- package/project/sigdb/reader.js +157 -108
- package/project/sigdb/schema.d.ts +90 -26
- package/project/sigdb/schema.js +12 -6
- package/queries/base-query-format.d.ts +7 -0
- package/queries/base-query-format.js +29 -0
- package/queries/catalog/absint-query/absint-query-executor.js +8 -6
- package/queries/catalog/absint-query/absint-query-format.d.ts +20 -9
- package/queries/catalog/absint-query/absint-query-format.js +32 -19
- package/queries/catalog/call-context-query/call-context-query-executor.js +3 -3
- package/queries/catalog/call-graph-query/call-graph-query-format.d.ts +1 -1
- package/queries/catalog/cluster-query/cluster-query-format.d.ts +1 -1
- package/queries/catalog/control-flow-query/control-flow-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +1 -1
- package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +33 -7
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/derived-functions.d.ts +2 -2
- package/queries/catalog/dependencies-query/function-info/derived-functions.js +14 -4
- package/queries/catalog/dependencies-query/function-info/read-functions.js +7 -121
- package/queries/catalog/dependencies-query/function-info/statistics-functions.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/statistics-functions.js +2 -2
- package/queries/catalog/dependencies-query/function-info/visualize-functions.js +4 -46
- package/queries/catalog/dependencies-query/function-info/write-functions.js +3 -76
- package/queries/catalog/dependencies-query/implicit-echo.js +2 -2
- package/queries/catalog/dependencies-query/link-devices.d.ts +2 -2
- package/queries/catalog/dependencies-query/link-devices.js +6 -7
- package/queries/catalog/dice-query/dice-query-executor.js +1 -1
- package/queries/catalog/dice-query/dice-query-format.d.ts +1 -1
- package/queries/catalog/does-call-query/does-call-query-executor.js +4 -0
- package/queries/catalog/does-call-query/does-call-query-format.d.ts +7 -1
- package/queries/catalog/files-query/files-query-format.d.ts +1 -1
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +1 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +1 -1
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +1 -1
- package/queries/catalog/input-sources-query/input-source-functions.d.ts +1 -1
- package/queries/catalog/input-sources-query/input-source-functions.js +2 -2
- package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +7 -17
- package/queries/catalog/input-sources-query/input-sources-query-format.js +11 -27
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +3 -8
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -11
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.d.ts +4 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +60 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.d.ts +35 -0
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +63 -0
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -6
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +3 -8
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +2 -11
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +3 -8
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +2 -12
- package/queries/catalog/linter-query/linter-query-format.d.ts +1 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +1 -1
- package/queries/catalog/origin-query/origin-query-format.d.ts +1 -1
- package/queries/catalog/project-query/project-query-format.d.ts +1 -1
- package/queries/catalog/provenance-query/provenance-query-format.d.ts +3 -8
- package/queries/catalog/provenance-query/provenance-query-format.js +2 -14
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +1 -1
- package/queries/catalog/search-query/search-query-format.d.ts +1 -1
- package/queries/catalog/signature-query/signature-query-executor.d.ts +5 -10
- package/queries/catalog/signature-query/signature-query-executor.js +87 -93
- package/queries/catalog/signature-query/signature-query-format.d.ts +20 -5
- package/queries/catalog/signature-query/signature-query-format.js +16 -4
- package/queries/catalog/signature-query/signature-query-render.js +18 -4
- package/queries/catalog/slice-query-options.d.ts +14 -0
- package/queries/catalog/slice-query-options.js +15 -0
- package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +2 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +3 -2
- package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +4 -3
- package/queries/catalog/static-slice-query/static-slice-query-format.js +7 -5
- package/queries/query-function-filter.d.ts +8 -3
- package/queries/query-function-filter.js +16 -6
- package/queries/query.d.ts +38 -38
- package/queries/query.js +30 -4
- package/r-bridge/lang-4.x/ast/model/model.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/model.js +14 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +1 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +17 -9
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +35 -27
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +33 -22
- package/reconstruct/reconstruct.d.ts +9 -20
- package/reconstruct/reconstruct.js +66 -28
- package/search/flowr-search-filters.d.ts +7 -6
- package/search/flowr-search-filters.js +6 -4
- package/search/search-executor/search-enrichers.d.ts +10 -10
- package/search/search-executor/search-enrichers.js +32 -3
- package/search/search-executor/search-transformer.js +15 -23
- package/slicing/criterion/parse.js +2 -12
- package/slicing/static/slice-call.js +1 -8
- package/slicing/static/static-slicer.js +1 -1
- package/util/collections/bimap.js +14 -6
- package/util/objects.js +16 -17
- package/util/r-value.d.ts +5 -4
- package/util/record.d.ts +38 -3
- package/util/record.js +48 -1
- package/util/simple-df/dfg-ascii.js +1 -1
- package/util/text/strings.d.ts +5 -0
- package/util/text/strings.js +10 -0
- package/util/version.js +2 -2
- package/abstract-interpretation/absint-visitor.d.ts +0 -223
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +0 -19
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +0 -151
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +0 -287
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +0 -1096
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +0 -15
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +0 -207
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.d.ts +0 -6
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-executor.js +0 -25
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.d.ts +0 -31
- package/queries/catalog/inspect-strictness-query/inspect-strictness-query-format.js +0 -56
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FlowrFileProvider } from '../../../context/flowr-file';
|
|
2
|
-
import { FlowrFile } from '../../../context/flowr-file';
|
|
2
|
+
import { FileRole, FlowrFile } from '../../../context/flowr-file';
|
|
3
3
|
import { type Node } from 'commonmark';
|
|
4
4
|
import type { FlowrAnalyzerContext } from '../../../context/flowr-analyzer-context';
|
|
5
5
|
/**
|
|
@@ -34,7 +34,13 @@ export declare class FlowrRMarkdownFile extends FlowrFile {
|
|
|
34
34
|
private postProcessCodeBlocks;
|
|
35
35
|
/** The paths this document splices into itself, only known once the content is loaded */
|
|
36
36
|
get includedFiles(): readonly string[];
|
|
37
|
-
|
|
37
|
+
/**
|
|
38
|
+
* Lifts a file to a {@link FlowrRMarkdownFile}, reusing it if already one and assigning roles.
|
|
39
|
+
* @param file - The file to lift or return if already an R Markdown file
|
|
40
|
+
* @param ctx - The analyzer context the chunks are read with
|
|
41
|
+
* @param role - An optional role to assign to the file
|
|
42
|
+
*/
|
|
43
|
+
static from(file: FlowrFileProvider<string> | FlowrRMarkdownFile, ctx: FlowrAnalyzerContext, role?: FileRole): FlowrRMarkdownFile;
|
|
38
44
|
}
|
|
39
45
|
export type CodeBlockOptions = Map<string, string>;
|
|
40
46
|
export interface CodeBlock {
|
|
@@ -101,7 +101,16 @@ class FlowrRMarkdownFile extends flowr_file_1.FlowrFile {
|
|
|
101
101
|
(0, assert_1.guard)(this.rmd !== undefined);
|
|
102
102
|
return this.included;
|
|
103
103
|
}
|
|
104
|
-
|
|
104
|
+
/**
|
|
105
|
+
* Lifts a file to a {@link FlowrRMarkdownFile}, reusing it if already one and assigning roles.
|
|
106
|
+
* @param file - The file to lift or return if already an R Markdown file
|
|
107
|
+
* @param ctx - The analyzer context the chunks are read with
|
|
108
|
+
* @param role - An optional role to assign to the file
|
|
109
|
+
*/
|
|
110
|
+
static from(file, ctx, role) {
|
|
111
|
+
if (role) {
|
|
112
|
+
file.assignRole(role);
|
|
113
|
+
}
|
|
105
114
|
return file instanceof FlowrRMarkdownFile ? file : new FlowrRMarkdownFile(file, ctx);
|
|
106
115
|
}
|
|
107
116
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { FlowrFileProvider } from '../../../context/flowr-file';
|
|
2
|
-
import { FlowrFile } from '../../../context/flowr-file';
|
|
2
|
+
import { FileRole, FlowrFile } from '../../../context/flowr-file';
|
|
3
3
|
/**
|
|
4
4
|
* This decorates a text file and parses its contents as a Sweave (latex with R code) file.
|
|
5
5
|
* Finally, it provides access to the single cells, and all cells fused together as one R file.
|
|
@@ -22,7 +22,12 @@ export declare class FlowrSweaveFile extends FlowrFile {
|
|
|
22
22
|
* @returns the content of the Sweave file, which is the R code without the latex code, no-eval blocks, ...
|
|
23
23
|
*/
|
|
24
24
|
protected loadContent(): string;
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Lifts a file to a {@link FlowrSweaveFile}, reusing it if already one and assigning roles.
|
|
27
|
+
* @param file - The file to lift or return if already a Sweave file
|
|
28
|
+
* @param role - An optional role to assign to the file
|
|
29
|
+
*/
|
|
30
|
+
static from(file: FlowrFileProvider<string> | FlowrSweaveFile, role?: FileRole): FlowrSweaveFile;
|
|
26
31
|
}
|
|
27
32
|
export interface SweaveInfo {
|
|
28
33
|
/**
|
|
@@ -39,7 +39,15 @@ class FlowrSweaveFile extends flowr_file_1.FlowrFile {
|
|
|
39
39
|
this.data = parseSweave(this.wrapped.content());
|
|
40
40
|
return this.data.content;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
/**
|
|
43
|
+
* Lifts a file to a {@link FlowrSweaveFile}, reusing it if already one and assigning roles.
|
|
44
|
+
* @param file - The file to lift or return if already a Sweave file
|
|
45
|
+
* @param role - An optional role to assign to the file
|
|
46
|
+
*/
|
|
47
|
+
static from(file, role) {
|
|
48
|
+
if (role) {
|
|
49
|
+
file.assignRole(role);
|
|
50
|
+
}
|
|
43
51
|
return file instanceof FlowrSweaveFile ? file : new FlowrSweaveFile(file);
|
|
44
52
|
}
|
|
45
53
|
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FlowrWrappedFile } from '../../../context/flowr-file';
|
|
2
|
+
import type { SexpType } from './flowr-rda-file';
|
|
3
|
+
/** One R object a package's system data provides. */
|
|
4
|
+
export interface SysdataObject {
|
|
5
|
+
readonly name: string;
|
|
6
|
+
/** `undefined` when only the name is known, i.e. for an installed package's `sysdata.rdx` */
|
|
7
|
+
readonly type?: SexpType;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Decorates a package's system data (`R/sysdata.rda`, or the `R/sysdata.rdx` an installed package ships) to
|
|
11
|
+
* expose the objects it lazy-loads into the package namespace.
|
|
12
|
+
* Prefer {@link FlowrSysdataFile.from}, which avoids re-wrapping and handles roles.
|
|
13
|
+
* @see https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Data-in-packages
|
|
14
|
+
*/
|
|
15
|
+
export declare class FlowrSysdataFile extends FlowrWrappedFile<readonly SysdataObject[]> {
|
|
16
|
+
protected loadContent(): readonly SysdataObject[];
|
|
17
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowrSysdataFile = void 0;
|
|
4
|
+
const flowr_file_1 = require("../../../context/flowr-file");
|
|
5
|
+
const flowr_rda_file_1 = require("./flowr-rda-file");
|
|
6
|
+
const log_1 = require("../../../../util/log");
|
|
7
|
+
const sysdataLog = log_1.log.getSubLogger({ name: 'flowr-sysdata-file' });
|
|
8
|
+
/** an installed package ships a lazy-load database, `sysdata.rdb`, with this index beside it */
|
|
9
|
+
const LazyLoadIndexPattern = /\.rdx$/i;
|
|
10
|
+
const LazyLoadVariablesEntry = 'variables';
|
|
11
|
+
/**
|
|
12
|
+
* Decorates a package's system data (`R/sysdata.rda`, or the `R/sysdata.rdx` an installed package ships) to
|
|
13
|
+
* expose the objects it lazy-loads into the package namespace.
|
|
14
|
+
* Prefer {@link FlowrSysdataFile.from}, which avoids re-wrapping and handles roles.
|
|
15
|
+
* @see https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Data-in-packages
|
|
16
|
+
*/
|
|
17
|
+
class FlowrSysdataFile extends flowr_file_1.FlowrWrappedFile {
|
|
18
|
+
loadContent() {
|
|
19
|
+
try {
|
|
20
|
+
return LazyLoadIndexPattern.test(this.path()) ? readLazyLoadIndex(this.wrapped) : readSavedImage(this.wrapped);
|
|
21
|
+
}
|
|
22
|
+
catch (e) {
|
|
23
|
+
sysdataLog.warn(`Failed to read ${JSON.stringify(this.path())} as package system data: ${String(e)}`);
|
|
24
|
+
return [];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
exports.FlowrSysdataFile = FlowrSysdataFile;
|
|
29
|
+
/** a source package's `sysdata.rda`, a saved image whose top-level objects are the system data */
|
|
30
|
+
function readSavedImage(file) {
|
|
31
|
+
return flowr_rda_file_1.FlowrRDAFile.from(file).content()
|
|
32
|
+
.filter((o) => o.name !== undefined)
|
|
33
|
+
.map(o => ({ name: o.name, type: o.type }));
|
|
34
|
+
}
|
|
35
|
+
/** an installed package's `sysdata.rdx`: the names of its `variables` are what the database holds */
|
|
36
|
+
function readLazyLoadIndex(file) {
|
|
37
|
+
const index = new flowr_rda_file_1.RDAParser(file, false).parseObject();
|
|
38
|
+
return (0, flowr_rda_file_1.namesOf)((0, flowr_rda_file_1.elementOf)(index, LazyLoadVariablesEntry)).map(name => ({ name }));
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=flowr-sysdata-file.js.map
|
|
@@ -31,6 +31,8 @@ export declare const PathPart: {
|
|
|
31
31
|
readonly Basename: typeof platformBasename;
|
|
32
32
|
/** The directory portion of the path. */
|
|
33
33
|
readonly Dirname: typeof platformDirname;
|
|
34
|
+
/** The whole path, for patterns that need both the folder and the file name. */
|
|
35
|
+
readonly Full: (p: string) => string;
|
|
34
36
|
};
|
|
35
37
|
/**
|
|
36
38
|
* Base class for all file plugins that select their files by a regular expression on the file path.
|
|
@@ -46,7 +46,9 @@ exports.PathPart = {
|
|
|
46
46
|
/** The file name including its extension. */
|
|
47
47
|
Basename: built_in_source_1.platformBasename,
|
|
48
48
|
/** The directory portion of the path. */
|
|
49
|
-
Dirname: built_in_source_1.platformDirname
|
|
49
|
+
Dirname: built_in_source_1.platformDirname,
|
|
50
|
+
/** The whole path, for patterns that need both the folder and the file name. */
|
|
51
|
+
Full: (p) => p
|
|
50
52
|
};
|
|
51
53
|
/**
|
|
52
54
|
* Base class for all file plugins that select their files by a regular expression on the file path.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { PathLike } from 'fs';
|
|
2
|
+
import { SemVer } from 'semver';
|
|
3
|
+
import { FlowrAnalyzerPatternFilePlugin } from './flowr-analyzer-file-plugin';
|
|
4
|
+
import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
|
|
5
|
+
import { type FlowrFileProvider } from '../../context/flowr-file';
|
|
6
|
+
import { FlowrDataListFile, FlowrRdFile, FlowrRdIndexFile, FlowrRdMacroFile, FlowrRdMetaFile, FlowrRdTopicIndexFile } from './files/flowr-rd-file';
|
|
7
|
+
/** Shared body of the `.Rd`-family plugins below; a concrete class only adds its name, description, default pattern, `lift`, and (twice) `applies`. */
|
|
8
|
+
declare abstract class FlowrAnalyzerRdFileBasePlugin<F extends FlowrFileProvider> extends FlowrAnalyzerPatternFilePlugin {
|
|
9
|
+
readonly version: SemVer;
|
|
10
|
+
/** Lifts a matched file into this plugin's `FlowrXFile`, tagged with its {@link FileRole}. */
|
|
11
|
+
protected abstract readonly lift: (file: FlowrFileProvider) => F;
|
|
12
|
+
process(_ctx: FlowrAnalyzerContext, file: FlowrFileProvider): F;
|
|
13
|
+
}
|
|
14
|
+
/** Support for R `.Rd` manual pages: a page states which names it documents (its `\alias{}`es); see {@link rdIndexOf}. */
|
|
15
|
+
export declare class FlowrAnalyzerRdFilePlugin extends FlowrAnalyzerRdFileBasePlugin<FlowrRdFile> {
|
|
16
|
+
readonly name = "flowr-analyzer-rd-file-plugin";
|
|
17
|
+
readonly description = "Reads .Rd manual pages into the Rd page format.";
|
|
18
|
+
constructor(filePattern?: RegExp);
|
|
19
|
+
applies(file: PathLike): boolean;
|
|
20
|
+
protected readonly lift: (file: FlowrFileProvider) => FlowrRdFile;
|
|
21
|
+
}
|
|
22
|
+
/** Support for an installed package's `help/AnIndex`: the same alias-to-topic mapping the `man/` sources give a checkout. */
|
|
23
|
+
export declare class FlowrAnalyzerRdIndexFilePlugin extends FlowrAnalyzerRdFileBasePlugin<FlowrRdIndexFile> {
|
|
24
|
+
readonly name = "flowr-analyzer-rd-index-file-plugin";
|
|
25
|
+
readonly description = "Reads an installed package's help/AnIndex into the alias-to-topic mapping.";
|
|
26
|
+
constructor(filePattern?: RegExp);
|
|
27
|
+
protected readonly lift: (file: FlowrFileProvider) => FlowrRdIndexFile;
|
|
28
|
+
}
|
|
29
|
+
/** Support for a package's `man/macros/` (installed: `help/macros/`) files, whose `\newcommand`s {@link rdIndexOf} expands before reading pages. */
|
|
30
|
+
export declare class FlowrAnalyzerRdMacroFilePlugin extends FlowrAnalyzerRdFileBasePlugin<FlowrRdMacroFile> {
|
|
31
|
+
readonly name = "flowr-analyzer-rd-macro-file-plugin";
|
|
32
|
+
readonly description = "Reads the \\newcommand definitions of man/macros/ files.";
|
|
33
|
+
constructor(filePattern?: RegExp);
|
|
34
|
+
applies(file: PathLike): boolean;
|
|
35
|
+
protected readonly lift: (file: FlowrFileProvider) => FlowrRdMacroFile;
|
|
36
|
+
}
|
|
37
|
+
/** Support for a package's `INDEX` and `demo/00Index`: the topic-and-title table R keeps even where no `man/` sources are. */
|
|
38
|
+
export declare class FlowrAnalyzerRdTopicIndexFilePlugin extends FlowrAnalyzerRdFileBasePlugin<FlowrRdTopicIndexFile> {
|
|
39
|
+
readonly name = "flowr-analyzer-rd-topic-index-file-plugin";
|
|
40
|
+
readonly description = "Reads INDEX/00Index topic tables into their topic-to-title mapping.";
|
|
41
|
+
constructor(filePattern?: RegExp);
|
|
42
|
+
protected readonly lift: (file: FlowrFileProvider) => FlowrRdTopicIndexFile;
|
|
43
|
+
}
|
|
44
|
+
/** Support for the `Meta/Rd.rds` help table an installed package serializes, states what the `man/` sources do -- topic, aliases, keywords, title. */
|
|
45
|
+
export declare class FlowrAnalyzerRdMetaFilePlugin extends FlowrAnalyzerRdFileBasePlugin<FlowrRdMetaFile> {
|
|
46
|
+
readonly name = "flowr-analyzer-rd-meta-file-plugin";
|
|
47
|
+
readonly description = "Reads an installed package's Meta/Rd.rds help table.";
|
|
48
|
+
constructor(filePattern?: RegExp);
|
|
49
|
+
protected readonly lift: (file: FlowrFileProvider) => FlowrRdMetaFile;
|
|
50
|
+
}
|
|
51
|
+
/** Support for a package's `data/datalist`: the only place a `data(<set>)` binding differently named objects is written down. */
|
|
52
|
+
export declare class FlowrAnalyzerDataListFilePlugin extends FlowrAnalyzerRdFileBasePlugin<FlowrDataListFile> {
|
|
53
|
+
readonly name = "flowr-analyzer-datalist-file-plugin";
|
|
54
|
+
readonly description = "Reads data/datalist into the objects each dataset provides.";
|
|
55
|
+
constructor(filePattern?: RegExp);
|
|
56
|
+
protected readonly lift: (file: FlowrFileProvider) => FlowrDataListFile;
|
|
57
|
+
}
|
|
58
|
+
export {};
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowrAnalyzerDataListFilePlugin = exports.FlowrAnalyzerRdMetaFilePlugin = exports.FlowrAnalyzerRdTopicIndexFilePlugin = exports.FlowrAnalyzerRdMacroFilePlugin = exports.FlowrAnalyzerRdIndexFilePlugin = exports.FlowrAnalyzerRdFilePlugin = void 0;
|
|
4
|
+
const semver_1 = require("semver");
|
|
5
|
+
const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
|
|
6
|
+
const flowr_file_1 = require("../../context/flowr-file");
|
|
7
|
+
const flowr_rd_file_1 = require("./files/flowr-rd-file");
|
|
8
|
+
/** `.Rd` manual pages, `NEWS.Rd` excluded: that one is a changelog and belongs to the NEWS plugin. */
|
|
9
|
+
const RdFilePattern = /^(?!NEWS\.rd$).+\.rd$/i;
|
|
10
|
+
/** a `man/macros/` (installed: `help/macros/`) file, which holds `\newcommand` definitions and documents nothing itself */
|
|
11
|
+
const RdMacroDirectory = /(^|[\\/])macros[\\/][^\\/]+$/i;
|
|
12
|
+
/** the alias-to-topic table an *installed* package carries instead of its `man/` sources */
|
|
13
|
+
const RdIndexFilePattern = /^AnIndex$/;
|
|
14
|
+
/** the `\newcommand` files of {@link RdMacroDirectory}, which state markup the package's pages use */
|
|
15
|
+
const RdMacroFilePattern = /\.rd$/i;
|
|
16
|
+
/** a package's `INDEX` and the `00Index` of its `demo/`: the same fixed-width `topic title` table */
|
|
17
|
+
const RdTopicIndexFilePattern = /^(INDEX|00Index)$/;
|
|
18
|
+
/** the help table an installed package serializes, the richest of the sources (aliases, keywords, titles) */
|
|
19
|
+
const RdMetaFilePattern = /^Rd\.rds$/i;
|
|
20
|
+
/** which R objects each of a package's datasets provides */
|
|
21
|
+
const DataListFilePattern = /^datalist$/i;
|
|
22
|
+
/** Shared body of the `.Rd`-family plugins below; a concrete class only adds its name, description, default pattern, `lift`, and (twice) `applies`. */
|
|
23
|
+
class FlowrAnalyzerRdFileBasePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerPatternFilePlugin {
|
|
24
|
+
version = new semver_1.SemVer('0.1.0');
|
|
25
|
+
process(_ctx, file) {
|
|
26
|
+
return this.lift(file);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
/** Support for R `.Rd` manual pages: a page states which names it documents (its `\alias{}`es); see {@link rdIndexOf}. */
|
|
30
|
+
class FlowrAnalyzerRdFilePlugin extends FlowrAnalyzerRdFileBasePlugin {
|
|
31
|
+
name = 'flowr-analyzer-rd-file-plugin';
|
|
32
|
+
description = 'Reads .Rd manual pages into the Rd page format.';
|
|
33
|
+
constructor(filePattern = RdFilePattern) {
|
|
34
|
+
super(filePattern);
|
|
35
|
+
}
|
|
36
|
+
applies(file) {
|
|
37
|
+
return super.applies(file) && !RdMacroDirectory.test(file.toString());
|
|
38
|
+
}
|
|
39
|
+
lift = (file) => flowr_rd_file_1.FlowrRdFile.from(file, flowr_file_1.FileRole.Documentation);
|
|
40
|
+
}
|
|
41
|
+
exports.FlowrAnalyzerRdFilePlugin = FlowrAnalyzerRdFilePlugin;
|
|
42
|
+
/** Support for an installed package's `help/AnIndex`: the same alias-to-topic mapping the `man/` sources give a checkout. */
|
|
43
|
+
class FlowrAnalyzerRdIndexFilePlugin extends FlowrAnalyzerRdFileBasePlugin {
|
|
44
|
+
name = 'flowr-analyzer-rd-index-file-plugin';
|
|
45
|
+
description = 'Reads an installed package\'s help/AnIndex into the alias-to-topic mapping.';
|
|
46
|
+
constructor(filePattern = RdIndexFilePattern) {
|
|
47
|
+
super(filePattern);
|
|
48
|
+
}
|
|
49
|
+
lift = (file) => flowr_rd_file_1.FlowrRdIndexFile.from(file, flowr_file_1.FileRole.Documentation);
|
|
50
|
+
}
|
|
51
|
+
exports.FlowrAnalyzerRdIndexFilePlugin = FlowrAnalyzerRdIndexFilePlugin;
|
|
52
|
+
/** Support for a package's `man/macros/` (installed: `help/macros/`) files, whose `\newcommand`s {@link rdIndexOf} expands before reading pages. */
|
|
53
|
+
class FlowrAnalyzerRdMacroFilePlugin extends FlowrAnalyzerRdFileBasePlugin {
|
|
54
|
+
name = 'flowr-analyzer-rd-macro-file-plugin';
|
|
55
|
+
description = 'Reads the \\newcommand definitions of man/macros/ files.';
|
|
56
|
+
constructor(filePattern = RdMacroFilePattern) {
|
|
57
|
+
super(filePattern);
|
|
58
|
+
}
|
|
59
|
+
applies(file) {
|
|
60
|
+
return super.applies(file) && RdMacroDirectory.test(file.toString());
|
|
61
|
+
}
|
|
62
|
+
lift = (file) => flowr_rd_file_1.FlowrRdMacroFile.from(file, flowr_file_1.FileRole.Documentation);
|
|
63
|
+
}
|
|
64
|
+
exports.FlowrAnalyzerRdMacroFilePlugin = FlowrAnalyzerRdMacroFilePlugin;
|
|
65
|
+
/** Support for a package's `INDEX` and `demo/00Index`: the topic-and-title table R keeps even where no `man/` sources are. */
|
|
66
|
+
class FlowrAnalyzerRdTopicIndexFilePlugin extends FlowrAnalyzerRdFileBasePlugin {
|
|
67
|
+
name = 'flowr-analyzer-rd-topic-index-file-plugin';
|
|
68
|
+
description = 'Reads INDEX/00Index topic tables into their topic-to-title mapping.';
|
|
69
|
+
constructor(filePattern = RdTopicIndexFilePattern) {
|
|
70
|
+
super(filePattern);
|
|
71
|
+
}
|
|
72
|
+
lift = (file) => flowr_rd_file_1.FlowrRdTopicIndexFile.from(file, flowr_file_1.FileRole.Documentation);
|
|
73
|
+
}
|
|
74
|
+
exports.FlowrAnalyzerRdTopicIndexFilePlugin = FlowrAnalyzerRdTopicIndexFilePlugin;
|
|
75
|
+
/** Support for the `Meta/Rd.rds` help table an installed package serializes, states what the `man/` sources do -- topic, aliases, keywords, title. */
|
|
76
|
+
class FlowrAnalyzerRdMetaFilePlugin extends FlowrAnalyzerRdFileBasePlugin {
|
|
77
|
+
name = 'flowr-analyzer-rd-meta-file-plugin';
|
|
78
|
+
description = 'Reads an installed package\'s Meta/Rd.rds help table.';
|
|
79
|
+
constructor(filePattern = RdMetaFilePattern) {
|
|
80
|
+
super(filePattern);
|
|
81
|
+
}
|
|
82
|
+
lift = (file) => flowr_rd_file_1.FlowrRdMetaFile.from(file, flowr_file_1.FileRole.Documentation);
|
|
83
|
+
}
|
|
84
|
+
exports.FlowrAnalyzerRdMetaFilePlugin = FlowrAnalyzerRdMetaFilePlugin;
|
|
85
|
+
/** Support for a package's `data/datalist`: the only place a `data(<set>)` binding differently named objects is written down. */
|
|
86
|
+
class FlowrAnalyzerDataListFilePlugin extends FlowrAnalyzerRdFileBasePlugin {
|
|
87
|
+
name = 'flowr-analyzer-datalist-file-plugin';
|
|
88
|
+
description = 'Reads data/datalist into the objects each dataset provides.';
|
|
89
|
+
constructor(filePattern = DataListFilePattern) {
|
|
90
|
+
super(filePattern);
|
|
91
|
+
}
|
|
92
|
+
lift = (file) => flowr_rd_file_1.FlowrDataListFile.from(file, flowr_file_1.FileRole.Data);
|
|
93
|
+
}
|
|
94
|
+
exports.FlowrAnalyzerDataListFilePlugin = FlowrAnalyzerDataListFilePlugin;
|
|
95
|
+
//# sourceMappingURL=flowr-analyzer-rd-file-plugin.js.map
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FlowrAnalyzerPatternFilePlugin } from './flowr-analyzer-file-plugin';
|
|
2
|
+
import { SemVer } from 'semver';
|
|
3
|
+
import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
|
|
4
|
+
import { type FlowrFileProvider } from '../../context/flowr-file';
|
|
5
|
+
import { FlowrSysdataFile } from './files/flowr-sysdata-file';
|
|
6
|
+
/**
|
|
7
|
+
* This plugin provides support for a package's system data, the objects R lazy-loads into the package namespace.
|
|
8
|
+
* It has to run before the {@link FlowrAnalyzerRdaFilePlugin}, which would otherwise claim the `.rda`.
|
|
9
|
+
* @see https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Data-in-packages
|
|
10
|
+
*/
|
|
11
|
+
export declare class FlowrAnalyzerSysdataFilePlugin extends FlowrAnalyzerPatternFilePlugin {
|
|
12
|
+
readonly name = "flowr-analyzer-sysdata-file-plugin";
|
|
13
|
+
readonly description = "Reads R/sysdata.rda into the objects it lazy-loads into the package namespace.";
|
|
14
|
+
readonly version: SemVer;
|
|
15
|
+
/**
|
|
16
|
+
* @param filePattern - The pattern to identify system data files, matched against the whole path.
|
|
17
|
+
*/
|
|
18
|
+
constructor(filePattern?: RegExp);
|
|
19
|
+
/**
|
|
20
|
+
* Processes the given file, assigning it the {@link FileRole.Data} role.
|
|
21
|
+
*/
|
|
22
|
+
process(_ctx: FlowrAnalyzerContext, file: FlowrFileProvider): FlowrSysdataFile;
|
|
23
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowrAnalyzerSysdataFilePlugin = void 0;
|
|
4
|
+
const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
|
|
5
|
+
const semver_1 = require("semver");
|
|
6
|
+
const flowr_file_1 = require("../../context/flowr-file");
|
|
7
|
+
const flowr_sysdata_file_1 = require("./files/flowr-sysdata-file");
|
|
8
|
+
/** a source package keeps its system data in `R/sysdata.rda`, an installed one in `R/sysdata.rdx` */
|
|
9
|
+
const SysdataFilePattern = /(^|[\\/])R[\\/]sysdata\.(rda|rdx)$/i;
|
|
10
|
+
/**
|
|
11
|
+
* This plugin provides support for a package's system data, the objects R lazy-loads into the package namespace.
|
|
12
|
+
* It has to run before the {@link FlowrAnalyzerRdaFilePlugin}, which would otherwise claim the `.rda`.
|
|
13
|
+
* @see https://cran.r-project.org/doc/manuals/r-release/R-exts.html#Data-in-packages
|
|
14
|
+
*/
|
|
15
|
+
class FlowrAnalyzerSysdataFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerPatternFilePlugin {
|
|
16
|
+
name = 'flowr-analyzer-sysdata-file-plugin';
|
|
17
|
+
description = 'Reads R/sysdata.rda into the objects it lazy-loads into the package namespace.';
|
|
18
|
+
version = new semver_1.SemVer('0.1.0');
|
|
19
|
+
/**
|
|
20
|
+
* @param filePattern - The pattern to identify system data files, matched against the whole path.
|
|
21
|
+
*/
|
|
22
|
+
constructor(filePattern = SysdataFilePattern) {
|
|
23
|
+
super(filePattern, flowr_analyzer_file_plugin_1.PathPart.Full);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Processes the given file, assigning it the {@link FileRole.Data} role.
|
|
27
|
+
*/
|
|
28
|
+
process(_ctx, file) {
|
|
29
|
+
return flowr_sysdata_file_1.FlowrSysdataFile.from(file, flowr_file_1.FileRole.Data);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
exports.FlowrAnalyzerSysdataFilePlugin = FlowrAnalyzerSysdataFilePlugin;
|
|
33
|
+
//# sourceMappingURL=flowr-analyzer-sysdata-file-plugin.js.map
|
package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js
CHANGED
|
@@ -9,6 +9,7 @@ const built_in_source_1 = require("../../../dataflow/internal/process/functions/
|
|
|
9
9
|
const log_1 = require("../../../util/log");
|
|
10
10
|
const smol_toml_1 = require("smol-toml");
|
|
11
11
|
const flowr_analyzer_meta_context_1 = require("../../context/flowr-analyzer-meta-context");
|
|
12
|
+
const flowr_description_file_1 = require("../file-plugins/files/flowr-description-file");
|
|
12
13
|
exports.lockfileLog = log_1.log.getSubLogger({ name: 'flowr-analyzer-package-versions-lockfile-plugin' });
|
|
13
14
|
/** The {@link FileRole.VirtualEnv} lockfiles named `name` (e.g. `renv.lock`), matched case-insensitively like the role is assigned. */
|
|
14
15
|
function virtualEnvFiles(ctx, name) {
|
|
@@ -42,36 +43,6 @@ class FlowrAnalyzerPackageVersionsRenvPlugin extends flowr_analyzer_package_vers
|
|
|
42
43
|
}
|
|
43
44
|
}
|
|
44
45
|
exports.FlowrAnalyzerPackageVersionsRenvPlugin = FlowrAnalyzerPackageVersionsRenvPlugin;
|
|
45
|
-
/** Unlike a `DESCRIPTION`, a `packrat.lock` holds one record per package, so the records must not be merged. */
|
|
46
|
-
function parseDCFRecords(content) {
|
|
47
|
-
const records = [];
|
|
48
|
-
let current = new Map();
|
|
49
|
-
let key;
|
|
50
|
-
for (const line of content.split(/\r?\n/)) {
|
|
51
|
-
if (line.trim().length === 0) {
|
|
52
|
-
if (current.size > 0) {
|
|
53
|
-
records.push(current);
|
|
54
|
-
current = new Map();
|
|
55
|
-
}
|
|
56
|
-
key = undefined;
|
|
57
|
-
}
|
|
58
|
-
else if (/^\s/.test(line) && key !== undefined) {
|
|
59
|
-
current.set(key, `${current.get(key) ?? ''} ${line.trim()}`);
|
|
60
|
-
}
|
|
61
|
-
else {
|
|
62
|
-
const colon = line.indexOf(':');
|
|
63
|
-
if (colon < 0) {
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
key = line.slice(0, colon).trim();
|
|
67
|
-
current.set(key, line.slice(colon + 1).trim());
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
if (current.size > 0) {
|
|
71
|
-
records.push(current);
|
|
72
|
-
}
|
|
73
|
-
return records;
|
|
74
|
-
}
|
|
75
46
|
/** Reads package versions from a `packrat.lock` (multi-record DCF, metadata first). packrat pins are exact. */
|
|
76
47
|
class FlowrAnalyzerPackageVersionsPackratPlugin extends flowr_analyzer_package_versions_plugin_1.FlowrAnalyzerPackageVersionsPlugin {
|
|
77
48
|
name = 'flowr-analyzer-package-versions-packrat-plugin';
|
|
@@ -79,13 +50,13 @@ class FlowrAnalyzerPackageVersionsPackratPlugin extends flowr_analyzer_package_v
|
|
|
79
50
|
version = new semver_1.SemVer('0.1.0');
|
|
80
51
|
process(ctx) {
|
|
81
52
|
for (const file of virtualEnvFiles(ctx, 'packrat.lock')) {
|
|
82
|
-
for (const record of
|
|
83
|
-
const rVersion = record.get('RVersion');
|
|
53
|
+
for (const record of (0, flowr_description_file_1.parseDCFRecords)(file)) {
|
|
54
|
+
const rVersion = record.get('RVersion')?.[0];
|
|
84
55
|
if (rVersion) {
|
|
85
56
|
ctx.meta.contribute({ rVersion }, flowr_analyzer_meta_context_1.MetaPriority.Lockfile);
|
|
86
57
|
}
|
|
87
|
-
const name = record.get('Package');
|
|
88
|
-
const version = record.get('Version');
|
|
58
|
+
const name = record.get('Package')?.[0];
|
|
59
|
+
const version = record.get('Version')?.[0];
|
|
89
60
|
if (name && version) {
|
|
90
61
|
pin(ctx, name, version);
|
|
91
62
|
}
|
|
@@ -94,31 +65,39 @@ class FlowrAnalyzerPackageVersionsPackratPlugin extends flowr_analyzer_package_v
|
|
|
94
65
|
}
|
|
95
66
|
}
|
|
96
67
|
exports.FlowrAnalyzerPackageVersionsPackratPlugin = FlowrAnalyzerPackageVersionsPackratPlugin;
|
|
68
|
+
/**
|
|
69
|
+
* Reads every TOML lockfile called `fileName`: contributes the R version it states and pins each `name`/`version`
|
|
70
|
+
* pair it lists. `read` says where that lockfile's dialect keeps the two, which is all they differ in.
|
|
71
|
+
*/
|
|
72
|
+
function pinFromTomlLock(ctx, fileName, read) {
|
|
73
|
+
for (const file of virtualEnvFiles(ctx, fileName)) {
|
|
74
|
+
let lock;
|
|
75
|
+
try {
|
|
76
|
+
lock = (0, smol_toml_1.parse)(file.content().toString());
|
|
77
|
+
}
|
|
78
|
+
catch (e) {
|
|
79
|
+
exports.lockfileLog.warn(`Could not parse ${fileName}: ${e.message}`);
|
|
80
|
+
continue;
|
|
81
|
+
}
|
|
82
|
+
const { rVersion, packages } = read(lock);
|
|
83
|
+
if (typeof rVersion === 'string') {
|
|
84
|
+
ctx.meta.contribute({ rVersion }, flowr_analyzer_meta_context_1.MetaPriority.Lockfile);
|
|
85
|
+
}
|
|
86
|
+
for (const pkg of Array.isArray(packages) ? packages : []) {
|
|
87
|
+
const { name, version } = pkg;
|
|
88
|
+
if (typeof name === 'string' && typeof version === 'string') {
|
|
89
|
+
pin(ctx, name, version);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
}
|
|
97
94
|
/** Reads package versions from an `rv.lock` (the resolved rv project lockfile, TOML). rv pins are exact. */
|
|
98
95
|
class FlowrAnalyzerPackageVersionsRvPlugin extends flowr_analyzer_package_versions_plugin_1.FlowrAnalyzerPackageVersionsPlugin {
|
|
99
96
|
name = 'flowr-analyzer-package-versions-rv-plugin';
|
|
100
97
|
description = 'Extracts package versions from an rv.lock lockfile.';
|
|
101
98
|
version = new semver_1.SemVer('0.1.0');
|
|
102
99
|
process(ctx) {
|
|
103
|
-
|
|
104
|
-
let lock;
|
|
105
|
-
try {
|
|
106
|
-
lock = (0, smol_toml_1.parse)(file.content().toString());
|
|
107
|
-
}
|
|
108
|
-
catch (e) {
|
|
109
|
-
exports.lockfileLog.warn(`Could not parse rv.lock: ${e.message}`);
|
|
110
|
-
continue;
|
|
111
|
-
}
|
|
112
|
-
if (typeof lock.r_version === 'string') {
|
|
113
|
-
ctx.meta.contribute({ rVersion: lock.r_version }, flowr_analyzer_meta_context_1.MetaPriority.Lockfile);
|
|
114
|
-
}
|
|
115
|
-
for (const pkg of Array.isArray(lock.packages) ? lock.packages : []) {
|
|
116
|
-
const { name, version } = pkg;
|
|
117
|
-
if (typeof name === 'string' && typeof version === 'string') {
|
|
118
|
-
pin(ctx, name, version);
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
100
|
+
pinFromTomlLock(ctx, 'rv.lock', lock => ({ rVersion: lock.r_version, packages: lock.packages }));
|
|
122
101
|
}
|
|
123
102
|
}
|
|
124
103
|
exports.FlowrAnalyzerPackageVersionsRvPlugin = FlowrAnalyzerPackageVersionsRvPlugin;
|
|
@@ -128,25 +107,7 @@ class FlowrAnalyzerPackageVersionsUvrPlugin extends flowr_analyzer_package_versi
|
|
|
128
107
|
description = 'Extracts package versions from a uvr.lock lockfile.';
|
|
129
108
|
version = new semver_1.SemVer('0.1.0');
|
|
130
109
|
process(ctx) {
|
|
131
|
-
|
|
132
|
-
let lock;
|
|
133
|
-
try {
|
|
134
|
-
lock = (0, smol_toml_1.parse)(file.content().toString());
|
|
135
|
-
}
|
|
136
|
-
catch (e) {
|
|
137
|
-
exports.lockfileLog.warn(`Could not parse uvr.lock: ${e.message}`);
|
|
138
|
-
continue;
|
|
139
|
-
}
|
|
140
|
-
if (typeof lock.r?.version === 'string') {
|
|
141
|
-
ctx.meta.contribute({ rVersion: lock.r.version }, flowr_analyzer_meta_context_1.MetaPriority.Lockfile);
|
|
142
|
-
}
|
|
143
|
-
for (const pkg of Array.isArray(lock.package) ? lock.package : []) {
|
|
144
|
-
const { name, version } = pkg;
|
|
145
|
-
if (typeof name === 'string' && typeof version === 'string') {
|
|
146
|
-
pin(ctx, name, version);
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
}
|
|
110
|
+
pinFromTomlLock(ctx, 'uvr.lock', lock => ({ rVersion: lock.r?.version, packages: lock.package }));
|
|
150
111
|
}
|
|
151
112
|
}
|
|
152
113
|
exports.FlowrAnalyzerPackageVersionsUvrPlugin = FlowrAnalyzerPackageVersionsUvrPlugin;
|
|
@@ -28,21 +28,23 @@ class FlowrAnalyzerPackageVersionsNamespaceFilePlugin extends flowr_analyzer_pac
|
|
|
28
28
|
name: pkg,
|
|
29
29
|
namespaceInfo: info
|
|
30
30
|
}));
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
31
|
+
/* the S4 lists are exports as much as the other two, they just say *why* the name is exported */
|
|
32
|
+
const exportKinds = [
|
|
33
|
+
[info.exportedSymbols, {}],
|
|
34
|
+
[info.exportedFunctions, {}],
|
|
35
|
+
[info.exportedS4Methods, { isS4Method: true }],
|
|
36
|
+
[info.exportedS4Classes, { isS4Class: true }]
|
|
37
|
+
];
|
|
38
|
+
for (const [names, kind] of exportKinds) {
|
|
39
|
+
for (const exported of names) {
|
|
40
|
+
ctx.deps.functionsContext.addFunctionInfo({
|
|
41
|
+
name: exported,
|
|
42
|
+
packageOrigin: pkg,
|
|
43
|
+
isExported: true,
|
|
44
|
+
isS3Generic: false,
|
|
45
|
+
...kind
|
|
46
|
+
});
|
|
47
|
+
}
|
|
46
48
|
}
|
|
47
49
|
for (const [genericName, classes] of info.exportS3Generics.entries()) {
|
|
48
50
|
for (const s3TypeDispatch of classes) {
|