@eagleoutice/flowr 2.0.25 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/benchmark/slicer.js +2 -1
- package/benchmark/stats/print.js +3 -4
- package/benchmark/stats/size-of.js +9 -7
- package/benchmark/summarizer/first-phase/input.d.ts +0 -1
- package/benchmark/summarizer/first-phase/input.js +2 -3
- package/benchmark/summarizer/first-phase/process.js +7 -7
- package/benchmark/summarizer/second-phase/graph.js +1 -2
- package/benchmark/summarizer/second-phase/process.d.ts +0 -1
- package/benchmark/summarizer/second-phase/process.js +4 -5
- package/benchmark/summarizer/summarizer.js +7 -1
- package/cli/benchmark-app.js +6 -1
- package/cli/common/features.js +2 -3
- package/cli/common/script.js +2 -3
- package/cli/common/scripts-info.d.ts +69 -1
- package/cli/common/scripts-info.js +6 -6
- package/cli/flowr-main-options.d.ts +4 -0
- package/cli/flowr-main-options.js +88 -0
- package/cli/flowr.d.ts +3 -3
- package/cli/flowr.js +22 -31
- package/cli/repl/commands/{cfg.d.ts → repl-cfg.d.ts} +1 -1
- package/cli/repl/commands/{cfg.js → repl-cfg.js} +3 -3
- package/cli/repl/commands/{commands.d.ts → repl-commands.d.ts} +3 -1
- package/cli/repl/commands/{commands.js → repl-commands.js} +56 -35
- package/cli/repl/commands/{dataflow.d.ts → repl-dataflow.d.ts} +1 -1
- package/cli/repl/commands/{dataflow.js → repl-dataflow.js} +2 -2
- package/cli/repl/commands/{execute.d.ts → repl-execute.d.ts} +1 -1
- package/cli/repl/commands/{execute.js → repl-execute.js} +3 -3
- package/cli/repl/commands/repl-lineage.d.ts +15 -0
- package/cli/repl/commands/{lineage.js → repl-lineage.js} +14 -12
- package/cli/repl/commands/{main.js → repl-main.js} +1 -1
- package/cli/repl/commands/{normalize.d.ts → repl-normalize.d.ts} +1 -1
- package/cli/repl/commands/{normalize.js → repl-normalize.js} +3 -3
- package/cli/repl/commands/{parse.d.ts → repl-parse.d.ts} +1 -1
- package/cli/repl/commands/{parse.js → repl-parse.js} +3 -2
- package/cli/repl/commands/repl-query.d.ts +8 -0
- package/cli/repl/commands/repl-query.js +155 -0
- package/cli/repl/commands/repl-quit.d.ts +2 -0
- package/cli/repl/commands/{quit.js → repl-quit.js} +1 -1
- package/cli/repl/commands/{version.d.ts → repl-version.d.ts} +1 -1
- package/cli/repl/commands/{version.js → repl-version.js} +4 -4
- package/cli/repl/core.d.ts +1 -2
- package/cli/repl/core.js +13 -13
- package/cli/repl/execute.d.ts +1 -2
- package/cli/repl/execute.js +2 -3
- package/cli/repl/print-version.js +3 -4
- package/cli/repl/server/connection.d.ts +1 -0
- package/cli/repl/server/connection.js +45 -12
- package/cli/repl/server/messages/{messages.d.ts → all-messages.d.ts} +8 -7
- package/cli/repl/server/messages/{messages.js → all-messages.js} +1 -1
- package/cli/repl/server/messages/{analysis.d.ts → message-analysis.d.ts} +2 -1
- package/cli/repl/server/messages/message-analysis.js +39 -0
- package/cli/repl/server/messages/{error.d.ts → message-error.d.ts} +1 -1
- package/cli/repl/server/messages/{error.js → message-error.js} +1 -1
- package/cli/repl/server/messages/{hello.d.ts → message-hello.d.ts} +4 -3
- package/cli/repl/server/messages/message-hello.js +20 -0
- package/cli/repl/server/messages/{lineage.d.ts → message-lineage.d.ts} +2 -1
- package/cli/repl/server/messages/message-lineage.js +25 -0
- package/cli/repl/server/messages/message-query.d.ts +16 -0
- package/cli/repl/server/messages/message-query.js +26 -0
- package/cli/repl/server/messages/{repl.d.ts → message-repl.d.ts} +3 -1
- package/cli/repl/server/messages/message-repl.js +53 -0
- package/cli/repl/server/messages/{slice.d.ts → message-slice.d.ts} +2 -1
- package/cli/repl/server/messages/{slice.js → message-slice.js} +14 -6
- package/cli/repl/server/net.d.ts +0 -1
- package/cli/repl/server/send.d.ts +1 -1
- package/cli/repl/server/send.js +2 -3
- package/cli/repl/server/server.js +2 -2
- package/cli/repl/server/validate.d.ts +1 -1
- package/cli/repl/server/validate.js +5 -6
- package/cli/run-script.d.ts +8 -0
- package/cli/run-script.js +18 -0
- package/cli/script-core/statistics-core.d.ts +2 -0
- package/cli/script-core/statistics-core.js +100 -0
- package/cli/script-core/statistics-helper-core.d.ts +2 -0
- package/cli/script-core/statistics-helper-core.js +81 -0
- package/cli/script-core/summarizer-core.d.ts +2 -0
- package/cli/script-core/summarizer-core.js +51 -0
- package/cli/statistics-app.js +3 -87
- package/cli/statistics-helper-app.js +3 -77
- package/cli/summarizer-app.js +2 -48
- package/config.d.ts +20 -4
- package/config.js +62 -36
- package/core/pipeline-executor.js +11 -1
- package/core/print/dataflow-printer.js +4 -5
- package/core/print/normalize-printer.js +4 -5
- package/core/print/parse-printer.js +1 -2
- package/core/print/print.js +2 -3
- package/core/print/slice-diff-ansi.js +1 -2
- package/core/steps/pipeline/create-pipeline.js +1 -2
- package/core/steps/pipeline/default-pipelines.d.ts +18 -18
- package/core/steps/pipeline/pipeline.js +1 -2
- package/dataflow/environments/append.js +1 -2
- package/dataflow/environments/built-in-config.d.ts +47 -0
- package/dataflow/environments/built-in-config.js +83 -0
- package/dataflow/environments/built-in.d.ts +49 -6
- package/dataflow/environments/built-in.js +29 -97
- package/dataflow/environments/clone.js +2 -2
- package/dataflow/environments/default-builtin-config.d.ts +5 -0
- package/dataflow/environments/default-builtin-config.js +83 -0
- package/dataflow/environments/define.js +1 -2
- package/dataflow/environments/diff.js +5 -6
- package/dataflow/environments/environment.js +8 -7
- package/dataflow/environments/identifier.d.ts +39 -8
- package/dataflow/environments/identifier.js +33 -0
- package/dataflow/environments/overwrite.d.ts +6 -5
- package/dataflow/environments/overwrite.js +16 -9
- package/dataflow/environments/resolve-by-name.d.ts +3 -1
- package/dataflow/environments/resolve-by-name.js +40 -8
- package/dataflow/environments/scoping.js +2 -3
- package/dataflow/extractor.js +25 -24
- package/dataflow/graph/dataflowgraph-builder.d.ts +139 -0
- package/dataflow/graph/dataflowgraph-builder.js +247 -0
- package/dataflow/graph/diff.js +12 -11
- package/dataflow/graph/edge.d.ts +2 -2
- package/dataflow/graph/edge.js +46 -20
- package/dataflow/graph/graph.d.ts +14 -6
- package/dataflow/graph/graph.js +25 -21
- package/dataflow/graph/quads.js +1 -2
- package/dataflow/graph/resolve-graph.d.ts +7 -0
- package/dataflow/graph/resolve-graph.js +51 -0
- package/dataflow/graph/vertex.d.ts +12 -4
- package/dataflow/graph/vertex.js +19 -11
- package/dataflow/info.d.ts +3 -7
- package/dataflow/info.js +7 -8
- package/dataflow/internal/linker.d.ts +3 -1
- package/dataflow/internal/linker.js +77 -32
- package/dataflow/internal/process/functions/call/argument/make-argument.js +5 -5
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +10 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +5 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +27 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +40 -26
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +30 -20
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +10 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +12 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +7 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +10 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +7 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +6 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +6 -5
- package/dataflow/internal/process/functions/call/common.js +30 -19
- package/dataflow/internal/process/functions/call/default-call-handling.js +1 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +8 -6
- package/dataflow/internal/process/functions/call/named-call-handling.js +7 -6
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +11 -7
- package/dataflow/internal/process/functions/process-argument.js +10 -8
- package/dataflow/internal/process/functions/process-parameter.js +8 -6
- package/dataflow/internal/process/process-named-call.js +3 -3
- package/dataflow/internal/process/process-symbol.js +5 -4
- package/dataflow/internal/process/process-uninteresting-leaf.js +1 -2
- package/dataflow/internal/process/process-value.js +5 -4
- package/dataflow/processor.js +1 -2
- package/documentation/data/dfg/doc-data-dfg-util.d.ts +20 -0
- package/documentation/data/dfg/doc-data-dfg-util.js +13 -0
- package/documentation/data/query/example-query-code.d.ts +1 -0
- package/documentation/data/query/example-query-code.js +25 -0
- package/documentation/data/server/doc-data-server-messages.d.ts +1 -0
- package/documentation/data/server/doc-data-server-messages.js +508 -0
- package/documentation/doc-util/doc-auto-gen.d.ts +7 -0
- package/documentation/doc-util/doc-auto-gen.js +9 -0
- package/documentation/doc-util/doc-cfg.d.ts +7 -0
- package/documentation/doc-util/doc-cfg.js +18 -0
- package/documentation/doc-util/doc-cli-option.d.ts +8 -0
- package/documentation/doc-util/doc-cli-option.js +36 -0
- package/documentation/doc-util/doc-code.d.ts +1 -0
- package/documentation/doc-util/doc-code.js +7 -0
- package/documentation/doc-util/doc-dfg.d.ts +21 -0
- package/documentation/doc-util/doc-dfg.js +93 -0
- package/documentation/doc-util/doc-docker.d.ts +1 -0
- package/documentation/doc-util/doc-docker.js +5 -0
- package/documentation/doc-util/doc-env.d.ts +2 -0
- package/documentation/doc-util/doc-env.js +20 -0
- package/documentation/doc-util/doc-files.d.ts +6 -0
- package/documentation/doc-util/doc-files.js +25 -0
- package/documentation/doc-util/doc-general.d.ts +2 -0
- package/documentation/doc-util/doc-general.js +16 -0
- package/documentation/doc-util/doc-hover-over.d.ts +1 -0
- package/documentation/doc-util/doc-hover-over.js +7 -0
- package/documentation/doc-util/doc-issue.d.ts +1 -0
- package/documentation/doc-util/doc-issue.js +6 -0
- package/documentation/doc-util/doc-ms.d.ts +1 -0
- package/documentation/doc-util/doc-ms.js +8 -0
- package/documentation/doc-util/doc-normalized-ast.d.ts +11 -0
- package/documentation/doc-util/doc-normalized-ast.js +71 -0
- package/documentation/doc-util/doc-query.d.ts +24 -0
- package/documentation/doc-util/doc-query.js +113 -0
- package/documentation/doc-util/doc-repl.d.ts +13 -0
- package/documentation/doc-util/doc-repl.js +79 -0
- package/documentation/doc-util/doc-server-message.d.ts +37 -0
- package/documentation/doc-util/doc-server-message.js +153 -0
- package/documentation/doc-util/doc-structure.d.ts +12 -0
- package/documentation/doc-util/doc-structure.js +21 -0
- package/documentation/doc-util/doc-types.d.ts +38 -0
- package/documentation/doc-util/doc-types.js +276 -0
- package/{r-bridge/data/print.js → documentation/print-capabilities-markdown.js} +8 -4
- package/documentation/print-dataflow-graph-wiki.d.ts +1 -0
- package/documentation/print-dataflow-graph-wiki.js +849 -0
- package/documentation/print-interface-wiki.d.ts +1 -0
- package/documentation/print-interface-wiki.js +401 -0
- package/documentation/print-normalized-ast-wiki.d.ts +1 -0
- package/documentation/print-normalized-ast-wiki.js +98 -0
- package/documentation/print-query-wiki.d.ts +1 -0
- package/documentation/print-query-wiki.js +215 -0
- package/package.json +29 -33
- package/queries/base-query-format.d.ts +11 -0
- package/{cli/repl/server/messages/hello.js → queries/base-query-format.js} +1 -1
- package/queries/call-context-query/call-context-query-executor.d.ts +11 -0
- package/queries/call-context-query/call-context-query-executor.js +255 -0
- package/queries/call-context-query/call-context-query-format.d.ts +72 -0
- package/queries/call-context-query/call-context-query-format.js +17 -0
- package/queries/query-schema.d.ts +7 -0
- package/queries/query-schema.js +31 -0
- package/queries/query.d.ts +35 -0
- package/queries/query.js +57 -0
- package/queries/two-layer-collector.d.ts +8 -0
- package/queries/two-layer-collector.js +31 -0
- package/queries/virtual-query/compound-query.d.ts +24 -0
- package/queries/virtual-query/compound-query.js +18 -0
- package/queries/virtual-query/virtual-queries.d.ts +15 -0
- package/queries/virtual-query/virtual-queries.js +8 -0
- package/r-bridge/data/data.d.ts +5 -0
- package/r-bridge/data/data.js +6 -0
- package/r-bridge/data/get.js +2 -3
- package/r-bridge/init.js +2 -2
- package/r-bridge/lang-4.x/ast/model/collect.js +1 -2
- package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +4 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +10 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/operators.js +27 -26
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +9 -9
- package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -2
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +26 -3
- package/r-bridge/lang-4.x/ast/model/processing/role.js +1 -2
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +23 -23
- package/r-bridge/lang-4.x/ast/model/processing/visitor.js +23 -23
- package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/type.js +221 -12
- package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +6 -5
- package/r-bridge/lang-4.x/ast/parser/xml/input-format.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then-else.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then.js +7 -7
- package/r-bridge/lang-4.x/ast/parser/xml/internal/expression/normalize-expression.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-argument.js +10 -10
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-call.js +18 -18
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-definition.js +8 -8
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-parameter.js +9 -9
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-break.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-for.js +10 -10
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-next.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-repeat.js +5 -5
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-while.js +7 -7
- package/r-bridge/lang-4.x/ast/parser/xml/internal/normalize-access.js +12 -12
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/normalize-binary.js +14 -14
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/normalize-unary.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/other/normalize-comment.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/other/normalize-line-directive.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-delimiter.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-expressions.js +13 -13
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-root.js +6 -6
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-single-node.js +19 -19
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-number.js +5 -5
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-string.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-symbol.js +2 -3
- package/r-bridge/lang-4.x/ast/parser/xml/normalize-meta.js +12 -12
- package/r-bridge/lang-4.x/convert-values.js +7 -7
- package/r-bridge/retriever.js +12 -11
- package/r-bridge/shell.d.ts +0 -1
- package/r-bridge/shell.js +6 -1
- package/reconstruct/auto-select/auto-select-defaults.js +1 -2
- package/reconstruct/auto-select/magic-comments.js +3 -3
- package/reconstruct/reconstruct.js +4 -3
- package/slicing/criterion/collect-all.js +1 -2
- package/slicing/criterion/parse.d.ts +1 -1
- package/slicing/criterion/parse.js +6 -5
- package/slicing/static/fingerprint.js +2 -3
- package/slicing/static/slice-call.js +9 -9
- package/slicing/static/static-slicer.js +5 -4
- package/statistics/features/common-syntax-probability.js +13 -13
- package/statistics/features/feature.d.ts +5 -9
- package/statistics/features/feature.js +2 -2
- package/statistics/features/post-processing.js +2 -3
- package/statistics/features/supported/assignments/assignments.js +3 -2
- package/statistics/features/supported/assignments/post-process.js +1 -2
- package/statistics/features/supported/comments/post-process.js +1 -2
- package/statistics/features/supported/control-flow/control-flow.js +4 -3
- package/statistics/features/supported/control-flow/post-process.js +1 -2
- package/statistics/features/supported/data-access/data-access.d.ts +2 -2
- package/statistics/features/supported/data-access/data-access.js +3 -2
- package/statistics/features/supported/data-access/post-process.js +1 -2
- package/statistics/features/supported/defined-functions/defined-functions.js +9 -7
- package/statistics/features/supported/defined-functions/post-process.d.ts +1 -1
- package/statistics/features/supported/defined-functions/post-process.js +2 -3
- package/statistics/features/supported/expression-list/post-process.js +1 -2
- package/statistics/features/supported/expression-list/{expression-list.js → statistics-expression-list.js} +4 -3
- package/statistics/features/supported/loops/loops.js +8 -7
- package/statistics/features/supported/loops/post-process.js +1 -2
- package/statistics/features/supported/used-functions/post-process.js +2 -3
- package/statistics/features/supported/used-functions/used-functions.d.ts +1 -1
- package/statistics/features/supported/used-functions/used-functions.js +4 -3
- package/statistics/features/supported/used-packages/post-process.js +1 -2
- package/statistics/features/supported/values/post-process.js +1 -2
- package/statistics/features/supported/variables/post-process.js +2 -3
- package/statistics/features/supported/variables/variables.js +2 -1
- package/statistics/meta-statistics.js +1 -2
- package/statistics/output/print-stats.js +4 -5
- package/statistics/output/statistics-file.js +5 -5
- package/statistics/statistics.js +2 -3
- package/statistics/summarizer/auto-detect.js +1 -2
- package/statistics/summarizer/post-process/clusterer.js +1 -2
- package/statistics/summarizer/post-process/file-based-count.js +2 -3
- package/statistics/summarizer/post-process/histogram.js +3 -4
- package/statistics/summarizer/post-process/post-process-output.js +2 -3
- package/statistics/summarizer/second-phase/process.d.ts +2 -0
- package/statistics/summarizer/second-phase/process.js +2 -2
- package/statistics/summarizer/summarizer.js +8 -1
- package/util/ansi.d.ts +1 -0
- package/util/ansi.js +27 -4
- package/util/args.js +2 -3
- package/util/arrays.js +8 -9
- package/util/assert.js +5 -6
- package/util/bimap.d.ts +4 -4
- package/util/cfg/cfg.d.ts +1 -0
- package/util/cfg/cfg.js +8 -5
- package/util/cfg/visitor.d.ts +8 -13
- package/util/cfg/visitor.js +22 -56
- package/util/diff.js +1 -2
- package/util/files.d.ts +0 -1
- package/util/files.js +11 -8
- package/util/json.js +2 -3
- package/util/mermaid/ast.js +7 -7
- package/util/mermaid/cfg.js +2 -3
- package/util/mermaid/dfg.d.ts +12 -4
- package/util/mermaid/dfg.js +28 -16
- package/util/mermaid/mermaid.js +5 -4
- package/util/numbers.js +1 -2
- package/util/objects.d.ts +7 -0
- package/util/objects.js +13 -3
- package/util/os.js +1 -2
- package/util/quads.js +5 -5
- package/util/random.js +2 -2
- package/util/range.js +8 -9
- package/util/schema.d.ts +11 -0
- package/util/schema.js +75 -0
- package/util/set.js +2 -3
- package/util/strings.js +3 -4
- package/util/summarizer.js +4 -4
- package/util/text.d.ts +1 -0
- package/util/text.js +20 -0
- package/util/time.js +1 -2
- package/util/version.js +2 -3
- package/cli/repl/commands/lineage.d.ts +0 -15
- package/cli/repl/commands/quit.d.ts +0 -2
- package/cli/repl/server/messages/analysis.js +0 -21
- package/cli/repl/server/messages/lineage.js +0 -17
- package/cli/repl/server/messages/repl.js +0 -37
- /package/cli/repl/commands/{main.d.ts → repl-main.d.ts} +0 -0
- /package/{r-bridge/data/print.d.ts → documentation/print-capabilities-markdown.d.ts} +0 -0
- /package/statistics/features/supported/expression-list/{expression-list.d.ts → statistics-expression-list.d.ts} +0 -0
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { BaseQueryFormat, BaseQueryResult } from '../base-query-format';
|
|
2
|
+
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
|
+
export declare enum CallTargets {
|
|
4
|
+
/** call targets a function that is not defined locally (e.g., the call targets a library function) */
|
|
5
|
+
OnlyGlobal = "global",
|
|
6
|
+
/** call targets a function that is defined locally or globally, but must include a global function */
|
|
7
|
+
MustIncludeGlobal = "must-include-global",
|
|
8
|
+
/** call targets a function that is defined locally */
|
|
9
|
+
OnlyLocal = "local",
|
|
10
|
+
/** call targets a function that is defined locally or globally, but must include a local function */
|
|
11
|
+
MustIncludeLocal = "must-include-local",
|
|
12
|
+
/** call targets a function that is defined locally or globally */
|
|
13
|
+
Any = "any"
|
|
14
|
+
}
|
|
15
|
+
export interface DefaultCallContextQueryFormat<CallName extends RegExp | string> extends BaseQueryFormat {
|
|
16
|
+
readonly type: 'call-context';
|
|
17
|
+
/** Regex regarding the function name, please note that strings will be interpreted as regular expressions too! */
|
|
18
|
+
readonly callName: CallName;
|
|
19
|
+
/** kind may be a step or anything that you attach to the call, this can be used to group calls together (e.g., linking `ggplot` to `visualize`). Defaults to `.` */
|
|
20
|
+
readonly kind?: string;
|
|
21
|
+
/** subkinds are used to uniquely identify the respective call type when grouping the output (e.g., the normalized name, linking `ggplot` to `plot`). Defaults to `.` */
|
|
22
|
+
readonly subkind?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Call targets the function may have. This defaults to {@link CallTargets#Any}.
|
|
25
|
+
* Request this specifically to gain all call targets we can resolve.
|
|
26
|
+
*/
|
|
27
|
+
readonly callTargets?: CallTargets;
|
|
28
|
+
/**
|
|
29
|
+
* Consider a case like `f <- function_of_interest`, do you want uses of `f` to be included in the results?
|
|
30
|
+
*/
|
|
31
|
+
readonly includeAliases?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Links the current call to the last call of the given kind.
|
|
35
|
+
* This way, you can link a call like `points` to the latest graphics plot etc.
|
|
36
|
+
* For now, this uses the static Control-Flow-Graph produced by flowR as the FD over-approximation is still not stable (see #1005).
|
|
37
|
+
* In short, this means that we are unable to detect origins over function call boundaries but plan on being more precise in the future.
|
|
38
|
+
*/
|
|
39
|
+
interface LinkToLastCall<CallName extends RegExp | string = RegExp | string> extends BaseQueryFormat {
|
|
40
|
+
readonly type: 'link-to-last-call';
|
|
41
|
+
/** Regex regarding the function name of the last call. Similar to {@link DefaultCallContextQueryFormat#callName}, strings are interpreted as a `RegExp`. */
|
|
42
|
+
readonly callName: CallName;
|
|
43
|
+
}
|
|
44
|
+
type LinkTo<CallName extends RegExp | string> = LinkToLastCall<CallName>;
|
|
45
|
+
export interface SubCallContextQueryFormat<CallName extends RegExp | string = RegExp | string> extends DefaultCallContextQueryFormat<CallName> {
|
|
46
|
+
readonly linkTo: LinkTo<CallName>;
|
|
47
|
+
}
|
|
48
|
+
export interface CallContextQuerySubKindResult {
|
|
49
|
+
/** The id of the call vertex identified within the supplied dataflow graph */
|
|
50
|
+
readonly id: NodeId;
|
|
51
|
+
/**
|
|
52
|
+
* Ids of functions which are called by the respective function call,
|
|
53
|
+
* this will only be populated whenever you explicitly state the {@link DefaultCallContextQueryFormat#callTargets}.
|
|
54
|
+
* An empty array means that the call targets only non-local functions.
|
|
55
|
+
*/
|
|
56
|
+
readonly calls?: readonly NodeId[];
|
|
57
|
+
/** ids attached by the linkTo query */
|
|
58
|
+
readonly linkedIds?: readonly NodeId[];
|
|
59
|
+
/**
|
|
60
|
+
* (Direct) alias locations this call stems from
|
|
61
|
+
*/
|
|
62
|
+
readonly aliasRoots?: readonly NodeId[];
|
|
63
|
+
}
|
|
64
|
+
export type CallContextQueryKindResult = Record<string, {
|
|
65
|
+
/** maps each subkind to the results found, to be freely in the result form, this is mutable */
|
|
66
|
+
subkinds: Record<string, CallContextQuerySubKindResult[]>;
|
|
67
|
+
}>;
|
|
68
|
+
export interface CallContextQueryResult extends BaseQueryResult {
|
|
69
|
+
readonly kinds: CallContextQueryKindResult;
|
|
70
|
+
}
|
|
71
|
+
export type CallContextQuery<CallName extends RegExp | string = RegExp | string> = DefaultCallContextQueryFormat<CallName> | SubCallContextQueryFormat<CallName>;
|
|
72
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.CallTargets = void 0;
|
|
4
|
+
var CallTargets;
|
|
5
|
+
(function (CallTargets) {
|
|
6
|
+
/** call targets a function that is not defined locally (e.g., the call targets a library function) */
|
|
7
|
+
CallTargets["OnlyGlobal"] = "global";
|
|
8
|
+
/** call targets a function that is defined locally or globally, but must include a global function */
|
|
9
|
+
CallTargets["MustIncludeGlobal"] = "must-include-global";
|
|
10
|
+
/** call targets a function that is defined locally */
|
|
11
|
+
CallTargets["OnlyLocal"] = "local";
|
|
12
|
+
/** call targets a function that is defined locally or globally, but must include a local function */
|
|
13
|
+
CallTargets["MustIncludeLocal"] = "must-include-local";
|
|
14
|
+
/** call targets a function that is defined locally or globally */
|
|
15
|
+
CallTargets["Any"] = "any";
|
|
16
|
+
})(CallTargets || (exports.CallTargets = CallTargets = {}));
|
|
17
|
+
//# sourceMappingURL=call-context-query-format.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import Joi from 'joi';
|
|
2
|
+
export declare const CallContextQuerySchema: Joi.ObjectSchema<any>;
|
|
3
|
+
export declare const SupportedQueriesSchema: Joi.AlternativesSchema<any>;
|
|
4
|
+
export declare const CompoundQuerySchema: Joi.ObjectSchema<any>;
|
|
5
|
+
export declare const VirtualQuerySchema: Joi.AlternativesSchema<any>;
|
|
6
|
+
export declare const AnyQuerySchema: Joi.AlternativesSchema<any>;
|
|
7
|
+
export declare const QueriesSchema: Joi.ArraySchema<any[]>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.QueriesSchema = exports.AnyQuerySchema = exports.VirtualQuerySchema = exports.CompoundQuerySchema = exports.SupportedQueriesSchema = exports.CallContextQuerySchema = void 0;
|
|
7
|
+
const joi_1 = __importDefault(require("joi"));
|
|
8
|
+
const call_context_query_format_1 = require("./call-context-query/call-context-query-format");
|
|
9
|
+
exports.CallContextQuerySchema = joi_1.default.object({
|
|
10
|
+
type: joi_1.default.string().valid('call-context').required().description('The type of the query.'),
|
|
11
|
+
callName: joi_1.default.string().required().description('Regex regarding the function name!'),
|
|
12
|
+
kind: joi_1.default.string().optional().description('The kind of the call, this can be used to group calls together (e.g., linking `plot` to `visualize`). Defaults to `.`'),
|
|
13
|
+
subkind: joi_1.default.string().optional().description('The subkind of the call, this can be used to uniquely identify the respective call type when grouping the output (e.g., the normalized name, linking `ggplot` to `plot`). Defaults to `.`'),
|
|
14
|
+
callTargets: joi_1.default.string().valid(...Object.values(call_context_query_format_1.CallTargets)).optional().description('Call targets the function may have. This defaults to `any`. Request this specifically to gain all call targets we can resolve.'),
|
|
15
|
+
includeAliases: joi_1.default.boolean().optional().description('Consider a case like `f <- function_of_interest`, do you want uses of `f` to be included in the results?'),
|
|
16
|
+
linkTo: joi_1.default.object({
|
|
17
|
+
type: joi_1.default.string().valid('link-to-last-call').required().description('The type of the linkTo sub-query.'),
|
|
18
|
+
callName: joi_1.default.string().required().description('Regex regarding the function name of the last call. Similar to `callName`, strings are interpreted as a regular expression.')
|
|
19
|
+
}).optional().description('Links the current call to the last call of the given kind. This way, you can link a call like `points` to the latest graphics plot etc.')
|
|
20
|
+
}).description('Call context query used to find calls in the dataflow graph');
|
|
21
|
+
exports.SupportedQueriesSchema = joi_1.default.alternatives(exports.CallContextQuerySchema).description('Supported queries');
|
|
22
|
+
exports.CompoundQuerySchema = joi_1.default.object({
|
|
23
|
+
type: joi_1.default.string().valid('compound').required().description('The type of the query.'),
|
|
24
|
+
query: joi_1.default.string().required().description('The query to run on the file analysis information.'),
|
|
25
|
+
commonArguments: joi_1.default.object().required().description('Common arguments for all queries.'),
|
|
26
|
+
arguments: joi_1.default.array().items(joi_1.default.object()).required().description('Arguments for each query.')
|
|
27
|
+
}).description('Compound query used to combine queries of the same type');
|
|
28
|
+
exports.VirtualQuerySchema = joi_1.default.alternatives(exports.CompoundQuerySchema).description('Virtual queries (used for structure)');
|
|
29
|
+
exports.AnyQuerySchema = joi_1.default.alternatives(exports.SupportedQueriesSchema, exports.VirtualQuerySchema).description('Any query');
|
|
30
|
+
exports.QueriesSchema = joi_1.default.array().items(exports.AnyQuerySchema).description('Queries to run on the file analysis information (in the form of an array)');
|
|
31
|
+
//# sourceMappingURL=query-schema.js.map
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { CallContextQuery } from './call-context-query/call-context-query-format';
|
|
2
|
+
import type { DataflowGraph } from '../dataflow/graph/graph';
|
|
3
|
+
import type { BaseQueryFormat, BaseQueryResult } from './base-query-format';
|
|
4
|
+
import { executeCallContextQueries } from './call-context-query/call-context-query-executor';
|
|
5
|
+
import type { VirtualQueryArgumentsWithType } from './virtual-query/virtual-queries';
|
|
6
|
+
import type { VirtualCompoundConstraint } from './virtual-query/compound-query';
|
|
7
|
+
import type { NormalizedAst } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
8
|
+
export type Query = CallContextQuery;
|
|
9
|
+
export type QueryArgumentsWithType<QueryType extends BaseQueryFormat['type']> = Query & {
|
|
10
|
+
type: QueryType;
|
|
11
|
+
};
|
|
12
|
+
export interface BasicQueryData {
|
|
13
|
+
readonly ast: NormalizedAst;
|
|
14
|
+
readonly graph: DataflowGraph;
|
|
15
|
+
}
|
|
16
|
+
export type QueryExecutor<Query extends BaseQueryFormat, Result extends BaseQueryResult> = (data: BasicQueryData, query: readonly Query[]) => Result;
|
|
17
|
+
type SupportedQueries = {
|
|
18
|
+
[QueryType in Query['type']]: QueryExecutor<QueryArgumentsWithType<QueryType>, BaseQueryResult>;
|
|
19
|
+
};
|
|
20
|
+
export declare const SupportedQueries: {
|
|
21
|
+
readonly 'call-context': typeof executeCallContextQueries;
|
|
22
|
+
};
|
|
23
|
+
export type SupportedQueryTypes = keyof typeof SupportedQueries;
|
|
24
|
+
export type QueryResult<Type extends Query['type']> = ReturnType<typeof SupportedQueries[Type]>;
|
|
25
|
+
export declare function executeQueriesOfSameType<SpecificQuery extends Query>(data: BasicQueryData, ...queries: readonly SpecificQuery[]): QueryResult<SpecificQuery['type']>;
|
|
26
|
+
export type QueryResults<Base extends SupportedQueryTypes> = {
|
|
27
|
+
readonly [QueryType in Base]: QueryResult<QueryType>;
|
|
28
|
+
} & BaseQueryResult;
|
|
29
|
+
type OmitFromValues<T, K extends string | number | symbol> = {
|
|
30
|
+
[P in keyof T]: Omit<T[P], K>;
|
|
31
|
+
};
|
|
32
|
+
export type QueryResultsWithoutMeta<Queries extends Query> = OmitFromValues<Omit<QueryResults<Queries['type']>, '.meta'>, '.meta'>;
|
|
33
|
+
export type Queries<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>> = readonly (QueryArgumentsWithType<Base> | VirtualQueryArgumentsWithType<Base, VirtualArguments>)[];
|
|
34
|
+
export declare function executeQueries<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>>(data: BasicQueryData, queries: Queries<Base, VirtualArguments>): QueryResults<Base>;
|
|
35
|
+
export {};
|
package/queries/query.js
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SupportedQueries = void 0;
|
|
4
|
+
exports.executeQueriesOfSameType = executeQueriesOfSameType;
|
|
5
|
+
exports.executeQueries = executeQueries;
|
|
6
|
+
const call_context_query_executor_1 = require("./call-context-query/call-context-query-executor");
|
|
7
|
+
const assert_1 = require("../util/assert");
|
|
8
|
+
const virtual_queries_1 = require("./virtual-query/virtual-queries");
|
|
9
|
+
exports.SupportedQueries = {
|
|
10
|
+
'call-context': call_context_query_executor_1.executeCallContextQueries
|
|
11
|
+
};
|
|
12
|
+
function executeQueriesOfSameType(data, ...queries) {
|
|
13
|
+
(0, assert_1.guard)(queries.length > 0, 'At least one query must be provided');
|
|
14
|
+
/* every query must have the same type */
|
|
15
|
+
(0, assert_1.guard)(queries.every(q => q.type === queries[0].type), 'All queries must have the same type');
|
|
16
|
+
const executor = exports.SupportedQueries[queries[0].type];
|
|
17
|
+
(0, assert_1.guard)(executor !== undefined, `Unsupported query type: ${queries[0].type}`);
|
|
18
|
+
return executor(data, queries);
|
|
19
|
+
}
|
|
20
|
+
function isVirtualQuery(query) {
|
|
21
|
+
return virtual_queries_1.SupportedVirtualQueries[query.type] !== undefined;
|
|
22
|
+
}
|
|
23
|
+
function groupQueriesByType(queries) {
|
|
24
|
+
const grouped = {};
|
|
25
|
+
function addQuery(query) {
|
|
26
|
+
if (grouped[query.type] === undefined) {
|
|
27
|
+
grouped[query.type] = [];
|
|
28
|
+
}
|
|
29
|
+
grouped[query.type].push(query);
|
|
30
|
+
}
|
|
31
|
+
for (const query of queries) {
|
|
32
|
+
if (isVirtualQuery(query)) {
|
|
33
|
+
const executor = virtual_queries_1.SupportedVirtualQueries[query.type];
|
|
34
|
+
const subQueries = executor(query);
|
|
35
|
+
for (const subQuery of subQueries) {
|
|
36
|
+
addQuery(subQuery);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
addQuery(query);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return grouped;
|
|
44
|
+
}
|
|
45
|
+
function executeQueries(data, queries) {
|
|
46
|
+
const now = Date.now();
|
|
47
|
+
const grouped = groupQueriesByType(queries);
|
|
48
|
+
const results = {};
|
|
49
|
+
for (const type of Object.keys(grouped)) {
|
|
50
|
+
results[type] = executeQueriesOfSameType(data, ...grouped[type]);
|
|
51
|
+
}
|
|
52
|
+
results['.meta'] = {
|
|
53
|
+
timing: Date.now() - now
|
|
54
|
+
};
|
|
55
|
+
return results;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=query.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** two layer map abstraction */
|
|
2
|
+
export declare class TwoLayerCollector<Layer1 extends string, Layer2 extends string, Values> {
|
|
3
|
+
readonly store: Map<Layer1, Map<Layer2, Values[]>>;
|
|
4
|
+
add(layer1: Layer1, layer2: Layer2, value: Values): void;
|
|
5
|
+
get(layer1: Layer1, layer2: Layer2): Values[] | undefined;
|
|
6
|
+
outerKeys(): Iterable<Layer1>;
|
|
7
|
+
innerKeys(layer1: Layer1): Iterable<Layer2>;
|
|
8
|
+
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TwoLayerCollector = void 0;
|
|
4
|
+
/** two layer map abstraction */
|
|
5
|
+
class TwoLayerCollector {
|
|
6
|
+
store = new Map();
|
|
7
|
+
add(layer1, layer2, value) {
|
|
8
|
+
let layer2Map = this.store.get(layer1);
|
|
9
|
+
if (layer2Map === undefined) {
|
|
10
|
+
layer2Map = new Map();
|
|
11
|
+
this.store.set(layer1, layer2Map);
|
|
12
|
+
}
|
|
13
|
+
let values = layer2Map.get(layer2);
|
|
14
|
+
if (values === undefined) {
|
|
15
|
+
values = [];
|
|
16
|
+
layer2Map.set(layer2, values);
|
|
17
|
+
}
|
|
18
|
+
values.push(value);
|
|
19
|
+
}
|
|
20
|
+
get(layer1, layer2) {
|
|
21
|
+
return this.store.get(layer1)?.get(layer2);
|
|
22
|
+
}
|
|
23
|
+
outerKeys() {
|
|
24
|
+
return this.store.keys();
|
|
25
|
+
}
|
|
26
|
+
innerKeys(layer1) {
|
|
27
|
+
return this.store.get(layer1)?.keys() ?? [];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.TwoLayerCollector = TwoLayerCollector;
|
|
31
|
+
//# sourceMappingURL=two-layer-collector.js.map
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { QueryArgumentsWithType, SupportedQueryTypes } from '../query';
|
|
2
|
+
import type { BaseQueryFormat } from '../base-query-format';
|
|
3
|
+
import type { StrictOmit } from 'ts-essentials';
|
|
4
|
+
/** @see CompoundQueryFormat */
|
|
5
|
+
export type VirtualCompoundConstraint<SubQueryType extends SupportedQueryTypes> = keyof StrictOmit<QueryArgumentsWithType<SubQueryType>, 'type'>;
|
|
6
|
+
/**
|
|
7
|
+
* Virtual Query Format.
|
|
8
|
+
* Grouping query parameters of the same type (re-specified in the `query` field).
|
|
9
|
+
*/
|
|
10
|
+
export interface CompoundQueryFormat<SubQueryType extends SupportedQueryTypes, CommonArguments extends VirtualCompoundConstraint<SubQueryType>> extends BaseQueryFormat {
|
|
11
|
+
readonly type: 'compound';
|
|
12
|
+
readonly query: SubQueryType;
|
|
13
|
+
/** defaults to use the same arguments for all queries */
|
|
14
|
+
readonly commonArguments: Pick<QueryArgumentsWithType<SubQueryType>, CommonArguments>;
|
|
15
|
+
/**
|
|
16
|
+
* You do not have to re-state the type, this is automatically filled with the type for 'query'
|
|
17
|
+
* Additionally all arguments given in `commonArguments` are now enforced optional.
|
|
18
|
+
*/
|
|
19
|
+
readonly arguments: ReadonlyArray<StrictOmit<StrictOmit<QueryArgumentsWithType<SubQueryType>, 'type'>, CommonArguments> & Partial<QueryArgumentsWithType<SubQueryType>>>;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Execute a single, virtual compound query in terms of unfolding the contained queries.
|
|
23
|
+
*/
|
|
24
|
+
export declare function executeCompoundQueries<SubQueryType extends SupportedQueryTypes, CommonArguments extends VirtualCompoundConstraint<SubQueryType> = VirtualCompoundConstraint<SubQueryType>>(query: CompoundQueryFormat<SubQueryType, CommonArguments>): QueryArgumentsWithType<SubQueryType>[];
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeCompoundQueries = executeCompoundQueries;
|
|
4
|
+
/**
|
|
5
|
+
* Execute a single, virtual compound query in terms of unfolding the contained queries.
|
|
6
|
+
*/
|
|
7
|
+
function executeCompoundQueries(query) {
|
|
8
|
+
const results = [];
|
|
9
|
+
for (const arg of query.arguments) {
|
|
10
|
+
results.push({
|
|
11
|
+
type: query.query,
|
|
12
|
+
...query.commonArguments,
|
|
13
|
+
...arg
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return results;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=compound-query.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { QueryArgumentsWithType, SupportedQueryTypes } from '../query';
|
|
2
|
+
import type { CompoundQueryFormat, VirtualCompoundConstraint } from './compound-query';
|
|
3
|
+
import { executeCompoundQueries } from './compound-query';
|
|
4
|
+
import type { BaseQueryFormat } from '../base-query-format';
|
|
5
|
+
/** A query that does not perform a search but may perform (e.g., convenience) modifications of other queries */
|
|
6
|
+
export type VirtualQueryArgumentsWithType<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>> = CompoundQueryFormat<Base, VirtualArguments>;
|
|
7
|
+
export type VirtualQueryExecutor<Query extends BaseQueryFormat, Result extends BaseQueryFormat[]> = (query: Query) => Result;
|
|
8
|
+
type SupportedVirtualQueries = {
|
|
9
|
+
[QueryType in VirtualQueryArgumentsWithType<SupportedQueryTypes>['type']]: VirtualQueryExecutor<QueryArgumentsWithType<QueryType>, BaseQueryFormat[]>;
|
|
10
|
+
};
|
|
11
|
+
export declare const SupportedVirtualQueries: {
|
|
12
|
+
readonly compound: typeof executeCompoundQueries;
|
|
13
|
+
};
|
|
14
|
+
export type SupportedVirtualQueryTypes = keyof typeof SupportedVirtualQueries;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SupportedVirtualQueries = void 0;
|
|
4
|
+
const compound_query_1 = require("./compound-query");
|
|
5
|
+
exports.SupportedVirtualQueries = {
|
|
6
|
+
'compound': compound_query_1.executeCompoundQueries
|
|
7
|
+
};
|
|
8
|
+
//# sourceMappingURL=virtual-queries.js.map
|
package/r-bridge/data/data.d.ts
CHANGED
|
@@ -52,6 +52,11 @@ export declare const flowrCapabilities: {
|
|
|
52
52
|
readonly id: "environment-sharing";
|
|
53
53
|
readonly supported: "not";
|
|
54
54
|
readonly description: "_Handling side-effects by environments which are not copied when modified_";
|
|
55
|
+
}, {
|
|
56
|
+
readonly name: "Search Type";
|
|
57
|
+
readonly id: "search-type";
|
|
58
|
+
readonly supported: "fully";
|
|
59
|
+
readonly description: "_Separating the resolution for functions and symbols._";
|
|
55
60
|
}, {
|
|
56
61
|
readonly name: "Search Path";
|
|
57
62
|
readonly id: "search-path";
|
package/r-bridge/data/data.js
CHANGED
|
@@ -68,6 +68,12 @@ exports.flowrCapabilities = {
|
|
|
68
68
|
supported: 'not',
|
|
69
69
|
description: '_Handling side-effects by environments which are not copied when modified_'
|
|
70
70
|
},
|
|
71
|
+
{
|
|
72
|
+
name: 'Search Type',
|
|
73
|
+
id: 'search-type',
|
|
74
|
+
supported: 'fully',
|
|
75
|
+
description: '_Separating the resolution for functions and symbols._'
|
|
76
|
+
},
|
|
71
77
|
{
|
|
72
78
|
name: 'Search Path',
|
|
73
79
|
id: 'search-path',
|
package/r-bridge/data/get.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getCapabilityById = getCapabilityById;
|
|
4
|
+
exports.getAllCapabilities = getAllCapabilities;
|
|
4
5
|
const assert_1 = require("../../util/assert");
|
|
5
6
|
const data_1 = require("./data");
|
|
6
7
|
function search(id, capabilities, path = []) {
|
|
@@ -30,7 +31,6 @@ function getCapabilityById(id) {
|
|
|
30
31
|
capabilityCache.set(id, value);
|
|
31
32
|
return value;
|
|
32
33
|
}
|
|
33
|
-
exports.getCapabilityById = getCapabilityById;
|
|
34
34
|
function getAllCapabilities() {
|
|
35
35
|
const result = [];
|
|
36
36
|
function traverse(capabilities, currentPath = []) {
|
|
@@ -47,5 +47,4 @@ function getAllCapabilities() {
|
|
|
47
47
|
traverse(data_1.flowrCapabilities.capabilities, []);
|
|
48
48
|
return result;
|
|
49
49
|
}
|
|
50
|
-
exports.getAllCapabilities = getAllCapabilities;
|
|
51
50
|
//# sourceMappingURL=get.js.map
|
package/r-bridge/init.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ErrorMarker = void 0;
|
|
4
|
+
exports.initCommand = initCommand;
|
|
4
5
|
const convert_values_1 = require("./lang-4.x/convert-values");
|
|
5
6
|
exports.ErrorMarker = 'err';
|
|
6
7
|
/** Command(s) to be issued at the start of each shell */
|
|
@@ -19,5 +20,4 @@ function initCommand(eol) {
|
|
|
19
20
|
/* error handling (just produce the marker) */
|
|
20
21
|
+ `},error=function(e){cat("${exports.ErrorMarker}")});cat(${(0, convert_values_1.ts2r)(eol)})},options=compiler::setCompilerOptions(optimize=3));`;
|
|
21
22
|
}
|
|
22
|
-
exports.initCommand = initCommand;
|
|
23
23
|
//# sourceMappingURL=init.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.collectAllIds =
|
|
3
|
+
exports.collectAllIds = collectAllIds;
|
|
4
4
|
const visitor_1 = require("./processing/visitor");
|
|
5
5
|
/**
|
|
6
6
|
* Collects all node ids within a tree given by a respective root node
|
|
@@ -19,5 +19,4 @@ function collectAllIds(nodes, stop = () => false) {
|
|
|
19
19
|
});
|
|
20
20
|
return ids;
|
|
21
21
|
}
|
|
22
|
-
exports.collectAllIds = collectAllIds;
|
|
23
22
|
//# sourceMappingURL=collect.js.map
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { SourceRange } from '../../../../util/range';
|
|
2
2
|
import type { RType } from './type';
|
|
3
3
|
import type { MergeableRecord } from '../../../../util/objects';
|
|
4
|
-
import type { RNa, RNull } from '../../convert-values';
|
|
5
4
|
import type { RNumber } from './nodes/r-number';
|
|
6
5
|
import type { RString } from './nodes/r-string';
|
|
7
6
|
import type { RLogical } from './nodes/r-logical';
|
|
@@ -108,7 +107,7 @@ export interface Namespace {
|
|
|
108
107
|
* This subtype of {@link RNode} represents all types of constants
|
|
109
108
|
* represented in the normalized AST.
|
|
110
109
|
*/
|
|
111
|
-
export type RConstant<Info> = RNumber<Info> | RString<Info> | RLogical<Info
|
|
110
|
+
export type RConstant<Info> = RNumber<Info> | RString<Info> | RLogical<Info>;
|
|
112
111
|
/**
|
|
113
112
|
* This subtype of {@link RNode} represents all types of {@link Leaf} nodes in the
|
|
114
113
|
* normalized AST.
|
|
@@ -11,6 +11,9 @@ interface RAccessBase<Info = NoInfo> extends Base<Info>, Location {
|
|
|
11
11
|
accessed: RNode<Info>;
|
|
12
12
|
operator: '[' | '[[' | '$' | '@';
|
|
13
13
|
}
|
|
14
|
+
/**
|
|
15
|
+
* Represents an R named access operation with `$` or `@`, the field is a string.
|
|
16
|
+
*/
|
|
14
17
|
export interface RNamedAccess<Info = NoInfo> extends RAccessBase<Info> {
|
|
15
18
|
operator: '$' | '@';
|
|
16
19
|
access: [RUnnamedArgument<Info>];
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Base, Location, NoInfo, RNode } from '../model';
|
|
2
2
|
import type { RType } from '../type';
|
|
3
|
+
/**
|
|
4
|
+
* Operators like `+`, `==`, `&&`, etc.
|
|
5
|
+
*/
|
|
3
6
|
export interface RBinaryOp<Info = NoInfo> extends Base<Info>, Location {
|
|
4
7
|
readonly type: RType.BinaryOp;
|
|
5
8
|
operator: string;
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import type { Leaf, Location, NoInfo } from '../model';
|
|
2
2
|
import type { RType } from '../type';
|
|
3
|
+
/**
|
|
4
|
+
* ```r
|
|
5
|
+
* # I am a line comment
|
|
6
|
+
* ```
|
|
7
|
+
*/
|
|
3
8
|
export interface RComment<Info = NoInfo> extends Location, Leaf<Info> {
|
|
4
9
|
readonly type: RType.Comment;
|
|
5
10
|
content: string;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import type { Base, Location, NoInfo, RNode, WithChildren } from '../model';
|
|
2
2
|
import type { RType } from '../type';
|
|
3
3
|
import type { RSymbol } from './r-symbol';
|
|
4
|
+
/**
|
|
5
|
+
* Holds a list of expressions (and hence may be the root of an AST, summarizing all expressions in a file).
|
|
6
|
+
* The `grouping` property holds information on if the expression list is structural or created by a wrapper like `{}` or `()`.
|
|
7
|
+
*/
|
|
4
8
|
export interface RExpressionList<Info = NoInfo> extends WithChildren<Info, RNode<Info>>, Base<Info, string | undefined>, Partial<Location> {
|
|
5
9
|
readonly type: RType.ExpressionList;
|
|
6
10
|
/** encodes wrappers like `{}` or `()` */
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import type { Base, Location, NoInfo, RNode } from '../model';
|
|
2
2
|
import type { RType } from '../type';
|
|
3
3
|
import type { RParameter } from './r-parameter';
|
|
4
|
+
/**
|
|
5
|
+
* ```r
|
|
6
|
+
* function(<parameters>) <body>
|
|
7
|
+
* ```
|
|
8
|
+
* or:
|
|
9
|
+
* ```r
|
|
10
|
+
* \(<parameters>) <body>
|
|
11
|
+
* ```
|
|
12
|
+
*/
|
|
4
13
|
export interface RFunctionDefinition<Info = NoInfo> extends Base<Info>, Location {
|
|
5
14
|
readonly type: RType.FunctionDefinition;
|
|
6
|
-
/** the R formals, to our knowledge they must be unique */
|
|
15
|
+
/** the R formals, to our knowledge, they must be unique */
|
|
7
16
|
parameters: RParameter<Info>[];
|
|
8
17
|
body: RNode<Info>;
|
|
9
18
|
}
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import type { Base, Location, NoInfo, RNode } from '../model';
|
|
2
2
|
import type { RType } from '../type';
|
|
3
3
|
import type { RExpressionList } from './r-expression-list';
|
|
4
|
+
/**
|
|
5
|
+
* ```r
|
|
6
|
+
* if(<condition>) <then> [else <otherwise>]
|
|
7
|
+
* ```
|
|
8
|
+
*/
|
|
4
9
|
export interface RIfThenElse<Info = NoInfo> extends Base<Info>, Location {
|
|
5
10
|
readonly type: RType.IfThenElse;
|
|
6
11
|
condition: RNode<Info>;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Leaf, Location, NoInfo } from '../model';
|
|
2
2
|
import type { RType } from '../type';
|
|
3
|
+
/**
|
|
4
|
+
* Special comment to signal line mappings (e.g., in generated code) to the interpreter.
|
|
5
|
+
*/
|
|
3
6
|
export interface RLineDirective<Info = NoInfo> extends Location, Leaf<Info> {
|
|
4
7
|
readonly type: RType.LineDirective;
|
|
5
8
|
line: number;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Leaf, Location, NoInfo } from '../model';
|
|
2
2
|
import type { RType } from '../type';
|
|
3
3
|
export type RLogicalValue = boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Represents logical values (`TRUE` or `FALSE`).
|
|
6
|
+
*/
|
|
4
7
|
export interface RLogical<Info = NoInfo> extends Leaf<Info>, Location {
|
|
5
8
|
readonly type: RType.Logical;
|
|
6
9
|
content: RLogicalValue;
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Base, Location, NoInfo, RNode } from '../model';
|
|
2
2
|
import type { RType } from '../type';
|
|
3
|
+
/**
|
|
4
|
+
* Variant of the binary operator, specifically for the new, built-in pipe operator.
|
|
5
|
+
*/
|
|
3
6
|
export interface RPipe<Info = NoInfo> extends Base<Info>, Location {
|
|
4
7
|
readonly type: RType.Pipe;
|
|
5
8
|
readonly lhs: RNode<Info>;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Leaf, Location, NoInfo } from '../model';
|
|
2
2
|
import type { RType } from '../type';
|
|
3
3
|
import type { RStringValue } from '../../../convert-values';
|
|
4
|
+
/**
|
|
5
|
+
* Represents a string like `"hello"`, including raw strings like `r"(hello)"`.
|
|
6
|
+
*/
|
|
4
7
|
export interface RString<Info = NoInfo> extends Leaf<Info>, Location {
|
|
5
8
|
readonly type: RType.String;
|
|
6
9
|
content: RStringValue;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Leaf, Location, Namespace, NoInfo } from '../model';
|
|
2
2
|
import type { RType } from '../type';
|
|
3
3
|
export declare function isSpecialSymbol(symbol: RSymbol): boolean;
|
|
4
|
+
/**
|
|
5
|
+
* Represents identifiers (variables).
|
|
6
|
+
*/
|
|
4
7
|
export interface RSymbol<Info = NoInfo, T extends string = string> extends Leaf<Info>, Namespace, Location {
|
|
5
8
|
readonly type: RType.Symbol;
|
|
6
9
|
content: T;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isSpecialSymbol =
|
|
3
|
+
exports.isSpecialSymbol = isSpecialSymbol;
|
|
4
4
|
const convert_values_1 = require("../../../convert-values");
|
|
5
5
|
function isSpecialSymbol(symbol) {
|
|
6
6
|
return symbol.content === convert_values_1.RNull || symbol.content === convert_values_1.RNa;
|
|
7
7
|
}
|
|
8
|
-
exports.isSpecialSymbol = isSpecialSymbol;
|
|
9
8
|
//# sourceMappingURL=r-symbol.js.map
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import type { Base, Location, NoInfo, RNode } from '../model';
|
|
2
2
|
import type { RType } from '../type';
|
|
3
|
+
/**
|
|
4
|
+
* Unary operations like `+` and `-`
|
|
5
|
+
*/
|
|
3
6
|
export interface RUnaryOp<Info = NoInfo> extends Base<Info>, Location {
|
|
4
7
|
readonly type: RType.UnaryOp;
|
|
5
8
|
operator: string;
|