@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
package/cli/flowr.js
CHANGED
|
@@ -3,45 +3,25 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.optionHelp = exports.
|
|
6
|
+
exports.optionHelp = exports.toolName = void 0;
|
|
7
7
|
const server_1 = require("./repl/server/server");
|
|
8
8
|
const net_1 = require("./repl/server/net");
|
|
9
9
|
const version_1 = require("../util/version");
|
|
10
|
+
const command_line_usage_1 = __importDefault(require("command-line-usage"));
|
|
10
11
|
const log_1 = require("../util/log");
|
|
11
12
|
const ansi_1 = require("../util/ansi");
|
|
12
13
|
const command_line_args_1 = __importDefault(require("command-line-args"));
|
|
13
|
-
const command_line_usage_1 = __importDefault(require("command-line-usage"));
|
|
14
14
|
const config_1 = require("../config");
|
|
15
15
|
const assert_1 = require("../util/assert");
|
|
16
16
|
const scripts_info_1 = require("./common/scripts-info");
|
|
17
17
|
const shell_1 = require("../r-bridge/shell");
|
|
18
18
|
const execute_1 = require("./repl/execute");
|
|
19
|
-
const
|
|
19
|
+
const repl_main_1 = require("./repl/commands/repl-main");
|
|
20
20
|
const core_1 = require("./repl/core");
|
|
21
|
-
const
|
|
21
|
+
const repl_version_1 = require("./repl/commands/repl-version");
|
|
22
22
|
const print_version_1 = require("./repl/print-version");
|
|
23
|
-
|
|
24
|
-
function getScriptsText() {
|
|
25
|
-
if (_scriptsText === undefined) {
|
|
26
|
-
_scriptsText = Array.from(Object.entries(scripts_info_1.scripts).filter(([, { type }]) => type === 'master script'), ([k,]) => k).join(', ');
|
|
27
|
-
}
|
|
28
|
-
return _scriptsText;
|
|
29
|
-
}
|
|
23
|
+
const flowr_main_options_1 = require("./flowr-main-options");
|
|
30
24
|
exports.toolName = 'flowr';
|
|
31
|
-
exports.optionDefinitions = [
|
|
32
|
-
{ name: 'config-file', type: String, description: 'The name of the configuration file to use', multiple: false },
|
|
33
|
-
{ name: 'execute', alias: 'e', type: String, description: 'Execute the given command and exit. Use a semicolon ";" to separate multiple commands.', typeLabel: '{underline command}', multiple: false },
|
|
34
|
-
{ name: 'help', alias: 'h', type: Boolean, description: 'Print this usage guide (or the guide of the corresponding script)' },
|
|
35
|
-
{ name: 'no-ansi', type: Boolean, description: 'Disable ansi-escape-sequences in the output. Useful, if you want to redirect the output to a file.' },
|
|
36
|
-
{ name: 'port', type: Number, description: 'The port to listen on, if --server is given.', defaultValue: 1042, typeLabel: '{underline port}' },
|
|
37
|
-
{ name: 'r-path', type: String, description: 'The path to the R executable to use. Defaults to your PATH.', multiple: false },
|
|
38
|
-
{ name: 'r-session-access', type: Boolean, description: 'Allow to access the underlying R session when using flowR (security warning: this allows the execution of arbitrary R code!)' },
|
|
39
|
-
{ name: 'script', alias: 's', type: String, description: `The sub-script to run (${getScriptsText()})`, multiple: false, defaultOption: true, typeLabel: '{underline files}', defaultValue: undefined },
|
|
40
|
-
{ name: 'server', type: Boolean, description: 'Do not drop into a repl, but instead start a server on the given port (default: 1042) and listen for messages.' },
|
|
41
|
-
{ name: 'verbose', alias: 'v', type: Boolean, description: 'Run with verbose logging (will be passed to the corresponding script)' },
|
|
42
|
-
{ name: 'version', alias: 'V', type: Boolean, description: 'Provide information about the version of flowR as well as its underlying R system and exit.' },
|
|
43
|
-
{ name: 'ws', type: Boolean, description: 'If the server flag is set, use websocket for messaging' }
|
|
44
|
-
];
|
|
45
25
|
exports.optionHelp = [
|
|
46
26
|
{
|
|
47
27
|
header: `flowR (version ${(0, version_1.flowrVersion)().toString()})`,
|
|
@@ -59,17 +39,28 @@ exports.optionHelp = [
|
|
|
59
39
|
},
|
|
60
40
|
{
|
|
61
41
|
header: 'Options',
|
|
62
|
-
optionList:
|
|
42
|
+
optionList: flowr_main_options_1.flowrMainOptionDefinitions
|
|
63
43
|
}
|
|
64
44
|
];
|
|
65
|
-
const options = (0, command_line_args_1.default)(
|
|
45
|
+
const options = (0, command_line_args_1.default)(flowr_main_options_1.flowrMainOptionDefinitions);
|
|
66
46
|
log_1.log.updateSettings(l => l.settings.minLevel = options.verbose ? 1 /* LogLevel.Trace */ : 5 /* LogLevel.Error */);
|
|
67
47
|
log_1.log.info('running with options', options);
|
|
68
48
|
if (options['no-ansi']) {
|
|
69
49
|
log_1.log.info('disabling ansi colors');
|
|
70
50
|
(0, ansi_1.setFormatter)(ansi_1.voidFormatter);
|
|
71
51
|
}
|
|
72
|
-
|
|
52
|
+
let usedConfig = false;
|
|
53
|
+
if (options['config-json']) {
|
|
54
|
+
const config = (0, config_1.parseConfig)(options['config-json']);
|
|
55
|
+
if (config) {
|
|
56
|
+
log_1.log.info(`Using passed config ${JSON.stringify(config)}`);
|
|
57
|
+
(0, config_1.setConfig)(config);
|
|
58
|
+
usedConfig = true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (!usedConfig) {
|
|
62
|
+
(0, config_1.setConfigFile)(options['config-file'] ?? flowr_main_options_1.defaultConfigFile, undefined, true);
|
|
63
|
+
}
|
|
73
64
|
function retrieveShell() {
|
|
74
65
|
// we keep an active shell session to allow other parse investigations :)
|
|
75
66
|
let opts = {
|
|
@@ -88,7 +79,7 @@ function retrieveShell() {
|
|
|
88
79
|
async function mainRepl() {
|
|
89
80
|
if (options.script) {
|
|
90
81
|
const target = scripts_info_1.scripts[options.script].target;
|
|
91
|
-
(0, assert_1.guard)(target !== undefined, `Unknown script ${options.script}, pick one of ${getScriptsText()}.`);
|
|
82
|
+
(0, assert_1.guard)(target !== undefined, `Unknown script ${options.script}, pick one of ${(0, flowr_main_options_1.getScriptsText)()}.`);
|
|
92
83
|
console.log(`Running script '${ansi_1.formatter.format(options.script, { style: 1 /* FontStyles.Bold */ })}'`);
|
|
93
84
|
log_1.log.debug(`Script maps to "${target}"`);
|
|
94
85
|
await (0, execute_1.waitOnScript)(`${__dirname}/${target}`, process.argv.slice(3), undefined, true);
|
|
@@ -101,7 +92,7 @@ async function mainRepl() {
|
|
|
101
92
|
if (options.version) {
|
|
102
93
|
const shell = new shell_1.RShell();
|
|
103
94
|
process.on('exit', () => shell.close());
|
|
104
|
-
await (0,
|
|
95
|
+
await (0, repl_version_1.printVersionInformation)(repl_main_1.standardReplOutput, shell);
|
|
105
96
|
process.exit(0);
|
|
106
97
|
}
|
|
107
98
|
const shell = retrieveShell();
|
|
@@ -117,7 +108,7 @@ async function mainRepl() {
|
|
|
117
108
|
process.on('SIGTERM', end);
|
|
118
109
|
const allowRSessionAccess = options['r-session-access'] ?? false;
|
|
119
110
|
if (options.execute) {
|
|
120
|
-
await (0, core_1.replProcessAnswer)(
|
|
111
|
+
await (0, core_1.replProcessAnswer)(repl_main_1.standardReplOutput, options.execute, shell, allowRSessionAccess);
|
|
121
112
|
}
|
|
122
113
|
else {
|
|
123
114
|
await (0, print_version_1.printVersionRepl)(shell);
|
|
@@ -24,8 +24,8 @@ exports.controlflowCommand = {
|
|
|
24
24
|
}
|
|
25
25
|
};
|
|
26
26
|
exports.controlflowStarCommand = {
|
|
27
|
-
description:
|
|
28
|
-
usageExample: ':controlflow',
|
|
27
|
+
description: 'Returns the URL to mermaid.live',
|
|
28
|
+
usageExample: ':controlflow*',
|
|
29
29
|
aliases: ['cfg*', 'cf*'],
|
|
30
30
|
script: false,
|
|
31
31
|
fn: async (output, shell, remainingLine) => {
|
|
@@ -34,4 +34,4 @@ exports.controlflowStarCommand = {
|
|
|
34
34
|
output.stdout((0, cfg_2.cfgToMermaidUrl)(cfg, result.normalize));
|
|
35
35
|
}
|
|
36
36
|
};
|
|
37
|
-
//# sourceMappingURL=cfg.js.map
|
|
37
|
+
//# sourceMappingURL=repl-cfg.js.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import type { ReplCommand } from './main';
|
|
1
|
+
import type { ReplCommand } from './repl-main';
|
|
2
2
|
export declare const helpCommand: ReplCommand;
|
|
3
|
+
export declare function getReplCommands(): Record<string, ReplCommand>;
|
|
3
4
|
/**
|
|
4
5
|
* The names of all commands including their aliases (but without the leading `:`)
|
|
5
6
|
*/
|
|
@@ -11,3 +12,4 @@ export declare function getCommandNames(): string[];
|
|
|
11
12
|
export declare function getCommand(command: string): ReplCommand | undefined;
|
|
12
13
|
export declare function asOptionName(argument: string): string;
|
|
13
14
|
export declare function longestCommandName(): number;
|
|
15
|
+
export declare function padCmd<T>(string: T): string;
|
|
@@ -1,28 +1,50 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
|
|
3
|
+
exports.helpCommand = void 0;
|
|
4
|
+
exports.getReplCommands = getReplCommands;
|
|
5
|
+
exports.getCommandNames = getCommandNames;
|
|
6
|
+
exports.getCommand = getCommand;
|
|
7
|
+
exports.asOptionName = asOptionName;
|
|
8
|
+
exports.longestCommandName = longestCommandName;
|
|
9
|
+
exports.padCmd = padCmd;
|
|
10
|
+
const repl_quit_1 = require("./repl-quit");
|
|
5
11
|
const execute_1 = require("../execute");
|
|
6
12
|
const prompt_1 = require("../prompt");
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
+
const repl_version_1 = require("./repl-version");
|
|
14
|
+
const repl_parse_1 = require("./repl-parse");
|
|
15
|
+
const repl_execute_1 = require("./repl-execute");
|
|
16
|
+
const repl_normalize_1 = require("./repl-normalize");
|
|
17
|
+
const repl_dataflow_1 = require("./repl-dataflow");
|
|
18
|
+
const repl_cfg_1 = require("./repl-cfg");
|
|
13
19
|
const ansi_1 = require("../../../util/ansi");
|
|
14
20
|
const args_1 = require("../../../util/args");
|
|
15
21
|
const assert_1 = require("../../../util/assert");
|
|
16
22
|
const scripts_info_1 = require("../../common/scripts-info");
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
23
|
+
const repl_lineage_1 = require("./repl-lineage");
|
|
24
|
+
const repl_query_1 = require("./repl-query");
|
|
25
|
+
function printHelpForScript(script, f, starredVersion) {
|
|
26
|
+
let base = ` ${(0, ansi_1.bold)(padCmd(':' + script[0] + (starredVersion ? '[*]' : '')), f)}${script[1].description}`;
|
|
27
|
+
if (starredVersion) {
|
|
28
|
+
base += ` (star: ${starredVersion.description})`;
|
|
29
|
+
}
|
|
20
30
|
if (script[1].aliases.length === 0) {
|
|
21
31
|
return base;
|
|
22
32
|
}
|
|
23
33
|
const aliases = script[1].aliases;
|
|
24
34
|
return `${base} (alias${aliases.length > 1 ? 'es' : ''}: ${aliases.map(a => (0, ansi_1.bold)(':' + a, f)).join(', ')})`;
|
|
25
35
|
}
|
|
36
|
+
function printCommandHelp(formatter) {
|
|
37
|
+
const scriptHelp = [];
|
|
38
|
+
const cmds = getReplCommands();
|
|
39
|
+
for (const c of Object.entries(cmds)) {
|
|
40
|
+
if (c[1].script || c[0].endsWith('*')) {
|
|
41
|
+
continue;
|
|
42
|
+
}
|
|
43
|
+
const starred = cmds[c[0] + '*'];
|
|
44
|
+
scriptHelp.push(printHelpForScript(c, formatter, starred));
|
|
45
|
+
}
|
|
46
|
+
return scriptHelp.sort().join('\n');
|
|
47
|
+
}
|
|
26
48
|
exports.helpCommand = {
|
|
27
49
|
description: 'Show help information',
|
|
28
50
|
script: false,
|
|
@@ -31,15 +53,16 @@ exports.helpCommand = {
|
|
|
31
53
|
fn: output => {
|
|
32
54
|
initCommandMapping();
|
|
33
55
|
output.stdout(`
|
|
34
|
-
If enabled, you can just enter R expressions which get evaluated right away:
|
|
56
|
+
If enabled ('--r-session-access'), you can just enter R expressions which get evaluated right away:
|
|
35
57
|
${prompt_1.rawPrompt} ${(0, ansi_1.bold)('1 + 1', output.formatter)}
|
|
36
58
|
${(0, ansi_1.italic)('[1] 2', output.formatter)}
|
|
37
59
|
|
|
38
|
-
Besides that, you can use the following commands. The scripts ${(0, ansi_1.italic)('can', output.formatter)} accept further arguments.
|
|
39
|
-
|
|
60
|
+
Besides that, you can use the following commands. The scripts ${(0, ansi_1.italic)('can', output.formatter)} accept further arguments. In general, those ending with [*] may be called with and without the star.
|
|
61
|
+
There are the following basic commands:
|
|
62
|
+
${printCommandHelp(output.formatter)}
|
|
40
63
|
|
|
41
64
|
Furthermore, you can directly call the following scripts which accept arguments. If you are unsure, try to add ${(0, ansi_1.italic)('--help', output.formatter)} after the command.
|
|
42
|
-
${Array.from(Object.entries(
|
|
65
|
+
${Array.from(Object.entries(getReplCommands())).filter(([, { script }]) => script).map(([command, { description }]) => ` ${(0, ansi_1.bold)(padCmd(':' + command), output.formatter)}${description}`).sort().join('\n')}
|
|
43
66
|
|
|
44
67
|
You can combine commands by separating them with a semicolon ${(0, ansi_1.bold)(';', output.formatter)}.
|
|
45
68
|
`);
|
|
@@ -50,17 +73,19 @@ You can combine commands by separating them with a semicolon ${(0, ansi_1.bold)(
|
|
|
50
73
|
*/
|
|
51
74
|
const _commands = {
|
|
52
75
|
'help': exports.helpCommand,
|
|
53
|
-
'quit':
|
|
54
|
-
'version':
|
|
55
|
-
'execute':
|
|
56
|
-
'parse':
|
|
57
|
-
'normalize':
|
|
58
|
-
'normalize*':
|
|
59
|
-
'dataflow':
|
|
60
|
-
'dataflow*':
|
|
61
|
-
'controlflow':
|
|
62
|
-
'controlflow*':
|
|
63
|
-
'lineage':
|
|
76
|
+
'quit': repl_quit_1.quitCommand,
|
|
77
|
+
'version': repl_version_1.versionCommand,
|
|
78
|
+
'execute': repl_execute_1.executeCommand,
|
|
79
|
+
'parse': repl_parse_1.parseCommand,
|
|
80
|
+
'normalize': repl_normalize_1.normalizeCommand,
|
|
81
|
+
'normalize*': repl_normalize_1.normalizeStarCommand,
|
|
82
|
+
'dataflow': repl_dataflow_1.dataflowCommand,
|
|
83
|
+
'dataflow*': repl_dataflow_1.dataflowStarCommand,
|
|
84
|
+
'controlflow': repl_cfg_1.controlflowCommand,
|
|
85
|
+
'controlflow*': repl_cfg_1.controlflowStarCommand,
|
|
86
|
+
'lineage': repl_lineage_1.lineageCommand,
|
|
87
|
+
'query': repl_query_1.queryCommand,
|
|
88
|
+
'query*': repl_query_1.queryStarCommand
|
|
64
89
|
};
|
|
65
90
|
let commandsInitialized = false;
|
|
66
91
|
function hasModule(path) {
|
|
@@ -72,7 +97,7 @@ function hasModule(path) {
|
|
|
72
97
|
return false;
|
|
73
98
|
}
|
|
74
99
|
}
|
|
75
|
-
function
|
|
100
|
+
function getReplCommands() {
|
|
76
101
|
if (commandsInitialized) {
|
|
77
102
|
return _commands;
|
|
78
103
|
}
|
|
@@ -110,14 +135,13 @@ function getCommandNames() {
|
|
|
110
135
|
}
|
|
111
136
|
return commandNames;
|
|
112
137
|
}
|
|
113
|
-
exports.getCommandNames = getCommandNames;
|
|
114
138
|
let commandNames = undefined;
|
|
115
139
|
// maps command names or aliases to the actual command name
|
|
116
140
|
let commandMapping = undefined;
|
|
117
141
|
function initCommandMapping() {
|
|
118
142
|
commandMapping = {};
|
|
119
143
|
commandNames = [];
|
|
120
|
-
for (const [command, { aliases }] of Object.entries(
|
|
144
|
+
for (const [command, { aliases }] of Object.entries(getReplCommands())) {
|
|
121
145
|
(0, assert_1.guard)(commandMapping[command] === undefined, `Command ${command} is already registered!`);
|
|
122
146
|
commandMapping[command] = command;
|
|
123
147
|
for (const alias of aliases) {
|
|
@@ -136,9 +160,8 @@ function getCommand(command) {
|
|
|
136
160
|
if (commandMapping === undefined) {
|
|
137
161
|
initCommandMapping();
|
|
138
162
|
}
|
|
139
|
-
return
|
|
163
|
+
return getReplCommands()[commandMapping[command]];
|
|
140
164
|
}
|
|
141
|
-
exports.getCommand = getCommand;
|
|
142
165
|
function asOptionName(argument) {
|
|
143
166
|
if (argument.length == 1) {
|
|
144
167
|
return `-${argument}`;
|
|
@@ -147,16 +170,14 @@ function asOptionName(argument) {
|
|
|
147
170
|
return `--${argument}`;
|
|
148
171
|
}
|
|
149
172
|
}
|
|
150
|
-
exports.asOptionName = asOptionName;
|
|
151
173
|
let _longestCommandName = undefined;
|
|
152
174
|
function longestCommandName() {
|
|
153
175
|
if (_longestCommandName === undefined) {
|
|
154
|
-
_longestCommandName = Array.from(Object.keys(
|
|
176
|
+
_longestCommandName = Array.from(Object.keys(getReplCommands()), k => k.endsWith('*') ? k.length + 3 : k.length).reduce((p, n) => Math.max(p, n), 0);
|
|
155
177
|
}
|
|
156
178
|
return _longestCommandName;
|
|
157
179
|
}
|
|
158
|
-
exports.longestCommandName = longestCommandName;
|
|
159
180
|
function padCmd(string) {
|
|
160
181
|
return String(string).padEnd(longestCommandName() + 2, ' ');
|
|
161
182
|
}
|
|
162
|
-
//# sourceMappingURL=commands.js.map
|
|
183
|
+
//# sourceMappingURL=repl-commands.js.map
|
|
@@ -22,7 +22,7 @@ exports.dataflowCommand = {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
exports.dataflowStarCommand = {
|
|
25
|
-
description:
|
|
25
|
+
description: 'Returns the URL to mermaid.live',
|
|
26
26
|
usageExample: ':dataflow*',
|
|
27
27
|
aliases: ['d*', 'df*'],
|
|
28
28
|
script: false,
|
|
@@ -31,4 +31,4 @@ exports.dataflowStarCommand = {
|
|
|
31
31
|
output.stdout((0, dfg_1.graphToMermaidUrl)(result.dataflow.graph, false));
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=dataflow.js.map
|
|
34
|
+
//# sourceMappingURL=repl-dataflow.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ReplCommand, ReplOutput } from './main';
|
|
1
|
+
import type { ReplCommand, ReplOutput } from './repl-main';
|
|
2
2
|
import type { RShell } from '../../../r-bridge/shell';
|
|
3
3
|
export declare function executeRShellCommand(output: ReplOutput, shell: RShell, statement: string): Promise<void>;
|
|
4
4
|
export declare const executeCommand: ReplCommand;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.executeCommand =
|
|
3
|
+
exports.executeCommand = void 0;
|
|
4
|
+
exports.executeRShellCommand = executeRShellCommand;
|
|
4
5
|
const ansi_1 = require("../../../util/ansi");
|
|
5
6
|
async function executeRShellCommand(output, shell, statement) {
|
|
6
7
|
try {
|
|
@@ -14,7 +15,6 @@ async function executeRShellCommand(output, shell, statement) {
|
|
|
14
15
|
output.stderr(`Error while executing '${statement}': ${e.message}`);
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
|
-
exports.executeRShellCommand = executeRShellCommand;
|
|
18
18
|
exports.executeCommand = {
|
|
19
19
|
description: 'Execute the given code as R code (essentially similar to using now command)',
|
|
20
20
|
usageExample: ':execute',
|
|
@@ -24,4 +24,4 @@ exports.executeCommand = {
|
|
|
24
24
|
await executeRShellCommand(output, shell, remainingLine);
|
|
25
25
|
}
|
|
26
26
|
};
|
|
27
|
-
//# sourceMappingURL=execute.js.map
|
|
27
|
+
//# sourceMappingURL=repl-execute.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ReplCommand } from './repl-main';
|
|
2
|
+
import type { SingleSlicingCriterion } from '../../../slicing/criterion/parse';
|
|
3
|
+
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
4
|
+
import type { DataflowGraph } from '../../../dataflow/graph/graph';
|
|
5
|
+
import type { AstIdMap } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
6
|
+
/**
|
|
7
|
+
* Get the lineage of a node in the dataflow graph
|
|
8
|
+
*
|
|
9
|
+
* @param criterion - The criterion to get the lineage of
|
|
10
|
+
* @param graph - The dataflow graph to search in
|
|
11
|
+
* @param idMap - The ID map to use for resolving the criterion (will default to that shipped with the dfgraph)
|
|
12
|
+
* @returns The lineage of the node represented as a set of node ids
|
|
13
|
+
*/
|
|
14
|
+
export declare function getLineage(criterion: SingleSlicingCriterion, graph: DataflowGraph, idMap?: AstIdMap): Set<NodeId>;
|
|
15
|
+
export declare const lineageCommand: ReplCommand;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.lineageCommand = void 0;
|
|
4
|
+
exports.getLineage = getLineage;
|
|
4
5
|
const pipeline_executor_1 = require("../../../core/pipeline-executor");
|
|
5
6
|
const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipelines");
|
|
6
7
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
@@ -17,7 +18,7 @@ async function getDfg(shell, remainingLine) {
|
|
|
17
18
|
}).allRemainingSteps();
|
|
18
19
|
}
|
|
19
20
|
function filterRelevantEdges(edge) {
|
|
20
|
-
return (0, edge_1.edgeIncludesType)(
|
|
21
|
+
return (0, edge_1.edgeIncludesType)(edge_1.EdgeType.DefinedBy | edge_1.EdgeType.DefinedByOnCall | edge_1.EdgeType.Returns | edge_1.EdgeType.Reads, edge.types);
|
|
21
22
|
}
|
|
22
23
|
function pushRelevantEdges(queue, outgoingEdges) {
|
|
23
24
|
queue.push(...[...outgoingEdges].filter(([_, edge]) => filterRelevantEdges(edge)));
|
|
@@ -26,12 +27,14 @@ function pushRelevantEdges(queue, outgoingEdges) {
|
|
|
26
27
|
* Get the lineage of a node in the dataflow graph
|
|
27
28
|
*
|
|
28
29
|
* @param criterion - The criterion to get the lineage of
|
|
29
|
-
* @param
|
|
30
|
-
* @param
|
|
30
|
+
* @param graph - The dataflow graph to search in
|
|
31
|
+
* @param idMap - The ID map to use for resolving the criterion (will default to that shipped with the dfgraph)
|
|
31
32
|
* @returns The lineage of the node represented as a set of node ids
|
|
32
33
|
*/
|
|
33
|
-
function getLineage(criterion,
|
|
34
|
-
|
|
34
|
+
function getLineage(criterion, graph, idMap) {
|
|
35
|
+
idMap ??= graph.idMap;
|
|
36
|
+
(0, assert_1.guard)(idMap !== undefined, 'The ID map is required to get the lineage of a node');
|
|
37
|
+
const src = graph.get((0, parse_1.slicingCriterionToId)(criterion, idMap));
|
|
35
38
|
(0, assert_1.guard)(src !== undefined, 'The ID pointed to by the criterion does not exist in the dataflow graph');
|
|
36
39
|
const [vertex, outgoingEdges] = src;
|
|
37
40
|
const result = new Set([vertex.id]);
|
|
@@ -43,24 +46,23 @@ function getLineage(criterion, { idMap }, dfg) {
|
|
|
43
46
|
continue;
|
|
44
47
|
}
|
|
45
48
|
result.add(target);
|
|
46
|
-
const outgoingEdges =
|
|
49
|
+
const outgoingEdges = graph.outgoingEdges(target);
|
|
47
50
|
if (outgoingEdges !== undefined) {
|
|
48
51
|
pushRelevantEdges(edgeQueue, outgoingEdges);
|
|
49
52
|
}
|
|
50
53
|
}
|
|
51
54
|
return result;
|
|
52
55
|
}
|
|
53
|
-
exports.
|
|
54
|
-
exports.getLineageCommand = {
|
|
56
|
+
exports.lineageCommand = {
|
|
55
57
|
description: 'Get the lineage of an R object',
|
|
56
58
|
usageExample: ':lineage',
|
|
57
59
|
aliases: ['lin'],
|
|
58
60
|
script: false,
|
|
59
61
|
fn: async (output, shell, remainingLine) => {
|
|
60
62
|
const [criterion, rest] = splitAt(remainingLine, remainingLine.indexOf(' '));
|
|
61
|
-
const { dataflow: dfg
|
|
62
|
-
const lineageIds = getLineage(criterion,
|
|
63
|
+
const { dataflow: dfg } = await getDfg(shell, rest);
|
|
64
|
+
const lineageIds = getLineage(criterion, dfg.graph);
|
|
63
65
|
output.stdout([...lineageIds].join('\n'));
|
|
64
66
|
}
|
|
65
67
|
};
|
|
66
|
-
//# sourceMappingURL=lineage.js.map
|
|
68
|
+
//# sourceMappingURL=repl-lineage.js.map
|
|
@@ -22,8 +22,8 @@ exports.normalizeCommand = {
|
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
exports.normalizeStarCommand = {
|
|
25
|
-
description:
|
|
26
|
-
usageExample: ':normalize',
|
|
25
|
+
description: 'Returns the URL to mermaid.live',
|
|
26
|
+
usageExample: ':normalize*',
|
|
27
27
|
aliases: ['n*'],
|
|
28
28
|
script: false,
|
|
29
29
|
fn: async (output, shell, remainingLine) => {
|
|
@@ -31,4 +31,4 @@ exports.normalizeStarCommand = {
|
|
|
31
31
|
output.stdout((0, ast_1.normalizedAstToMermaidUrl)(result.normalize.ast));
|
|
32
32
|
}
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=normalize.js.map
|
|
34
|
+
//# sourceMappingURL=repl-normalize.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import type { ReplCommand } from './main';
|
|
1
|
+
import type { ReplCommand } from './repl-main';
|
|
2
2
|
export declare const parseCommand: ReplCommand;
|
|
@@ -5,11 +5,12 @@ const pipeline_executor_1 = require("../../../core/pipeline-executor");
|
|
|
5
5
|
const format_1 = require("../../../r-bridge/lang-4.x/ast/parser/json/format");
|
|
6
6
|
const parser_1 = require("../../../r-bridge/lang-4.x/ast/parser/json/parser");
|
|
7
7
|
const input_format_1 = require("../../../r-bridge/lang-4.x/ast/parser/xml/input-format");
|
|
8
|
+
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
8
9
|
const normalize_meta_1 = require("../../../r-bridge/lang-4.x/ast/parser/xml/normalize-meta");
|
|
9
10
|
const default_pipelines_1 = require("../../../core/steps/pipeline/default-pipelines");
|
|
10
11
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
11
12
|
function toDepthMap(xml) {
|
|
12
|
-
const root = (0, input_format_1.getKeyGuarded)(xml,
|
|
13
|
+
const root = (0, input_format_1.getKeyGuarded)(xml, type_1.RawRType.ExpressionList);
|
|
13
14
|
const visit = [{ depth: 0, node: root }];
|
|
14
15
|
const result = [];
|
|
15
16
|
while (visit.length > 0) {
|
|
@@ -107,4 +108,4 @@ exports.parseCommand = {
|
|
|
107
108
|
output.stdout(depthListToTextTree(toDepthMap(object), output.formatter));
|
|
108
109
|
}
|
|
109
110
|
};
|
|
110
|
-
//# sourceMappingURL=parse.js.map
|
|
111
|
+
//# sourceMappingURL=repl-parse.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { DEFAULT_DATAFLOW_PIPELINE } from '../../../core/steps/pipeline/default-pipelines';
|
|
2
|
+
import type { ReplCommand } from './repl-main';
|
|
3
|
+
import type { OutputFormatter } from '../../../util/ansi';
|
|
4
|
+
import type { QueryResults, SupportedQueryTypes } from '../../../queries/query';
|
|
5
|
+
import type { PipelineOutput } from '../../../core/steps/pipeline/pipeline';
|
|
6
|
+
export declare function asciiSummaryOfQueryResult(formatter: OutputFormatter, totalInMs: number, results: QueryResults<SupportedQueryTypes>, processed: PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>): string;
|
|
7
|
+
export declare const queryCommand: ReplCommand;
|
|
8
|
+
export declare const queryStarCommand: ReplCommand;
|