@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/util/mermaid/dfg.js
CHANGED
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.formatRange = formatRange;
|
|
4
|
+
exports.printIdentifier = printIdentifier;
|
|
5
|
+
exports.graphToMermaid = graphToMermaid;
|
|
6
|
+
exports.graphToMermaidUrl = graphToMermaidUrl;
|
|
7
|
+
exports.diffGraphsToMermaid = diffGraphsToMermaid;
|
|
8
|
+
exports.diffGraphsToMermaidUrl = diffGraphsToMermaidUrl;
|
|
4
9
|
const assert_1 = require("../assert");
|
|
5
10
|
const mermaid_1 = require("./mermaid");
|
|
6
11
|
const graph_1 = require("../../dataflow/graph/graph");
|
|
12
|
+
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
7
13
|
const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
8
14
|
const edge_1 = require("../../dataflow/graph/edge");
|
|
15
|
+
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
9
16
|
const environment_1 = require("../../dataflow/environments/environment");
|
|
17
|
+
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
10
18
|
/**
|
|
11
19
|
* Prints a {@link SourceRange|range} as a human readable string.
|
|
12
20
|
*/
|
|
@@ -24,7 +32,6 @@ function formatRange(range) {
|
|
|
24
32
|
}
|
|
25
33
|
return `${range[0]}.${range[1]}-${range[2]}.${range[3]}`;
|
|
26
34
|
}
|
|
27
|
-
exports.formatRange = formatRange;
|
|
28
35
|
function subflowToMermaid(nodeId, exitPoints, subflow, mermaid, idPrefix = '') {
|
|
29
36
|
if (subflow === undefined) {
|
|
30
37
|
return;
|
|
@@ -41,6 +48,9 @@ function subflowToMermaid(nodeId, exitPoints, subflow, mermaid, idPrefix = '') {
|
|
|
41
48
|
});
|
|
42
49
|
mermaid.nodeLines.push(...subgraph.nodeLines);
|
|
43
50
|
mermaid.edgeLines.push(...subgraph.edgeLines);
|
|
51
|
+
for (const present of subgraph.presentEdges) {
|
|
52
|
+
mermaid.presentEdges.add(present);
|
|
53
|
+
}
|
|
44
54
|
for (const [color, pool] of [['purple', subflow.in], ['green', subflow.out], ['orange', subflow.unknownReferences]]) {
|
|
45
55
|
for (const out of pool) {
|
|
46
56
|
if (!mermaid.mark?.has(out.nodeId)) {
|
|
@@ -51,6 +61,9 @@ function subflowToMermaid(nodeId, exitPoints, subflow, mermaid, idPrefix = '') {
|
|
|
51
61
|
}
|
|
52
62
|
mermaid.nodeLines.push('end');
|
|
53
63
|
mermaid.edgeLines.push(`${idPrefix}${nodeId} -.-|function| ${subflowId}\n`);
|
|
64
|
+
/* mark edge as present */
|
|
65
|
+
const edgeId = encodeEdge(idPrefix + nodeId, subflowId, new Set(['function']));
|
|
66
|
+
mermaid.presentEdges.add(edgeId);
|
|
54
67
|
}
|
|
55
68
|
function printArg(arg) {
|
|
56
69
|
if (arg === undefined) {
|
|
@@ -88,7 +101,7 @@ function mermaidNodeBrackets(tag) {
|
|
|
88
101
|
open = '[';
|
|
89
102
|
close = ']';
|
|
90
103
|
}
|
|
91
|
-
else if (tag ===
|
|
104
|
+
else if (tag === vertex_1.VertexType.FunctionCall) {
|
|
92
105
|
open = '[[';
|
|
93
106
|
close = ']]';
|
|
94
107
|
}
|
|
@@ -103,7 +116,7 @@ function mermaidNodeBrackets(tag) {
|
|
|
103
116
|
return { open, close };
|
|
104
117
|
}
|
|
105
118
|
function printIdentifier(id) {
|
|
106
|
-
return
|
|
119
|
+
return `**${id.name}** (id: ${id.nodeId}, type: ${identifier_1.ReferenceTypeReverseMapping.get(id.type)},${id.controlDependencies ? ' cds: {' + id.controlDependencies.map(c => c.id + (c.when ? '+' : '-')).join(',') + '},' : ''} def. @${id.definedAt})`;
|
|
107
120
|
}
|
|
108
121
|
function printEnvironmentToLines(env) {
|
|
109
122
|
if (env === undefined) {
|
|
@@ -121,7 +134,7 @@ function printEnvironmentToLines(env) {
|
|
|
121
134
|
return lines;
|
|
122
135
|
}
|
|
123
136
|
function vertexToMermaid(info, mermaid, id, idPrefix, mark) {
|
|
124
|
-
const fCall = info.tag ===
|
|
137
|
+
const fCall = info.tag === vertex_1.VertexType.FunctionCall;
|
|
125
138
|
const { open, close } = mermaidNodeBrackets(info.tag);
|
|
126
139
|
if (info.environment && mermaid.includeEnvironments) {
|
|
127
140
|
if (info.environment.level > 0 || info.environment.current.memory.size !== 0) {
|
|
@@ -129,13 +142,16 @@ function vertexToMermaid(info, mermaid, id, idPrefix, mark) {
|
|
|
129
142
|
}
|
|
130
143
|
}
|
|
131
144
|
const node = mermaid.rootGraph.idMap?.get(info.id);
|
|
132
|
-
const lexeme = node?.lexeme ?? (node?.type ===
|
|
145
|
+
const lexeme = node?.lexeme ?? (node?.type === type_1.RType.ExpressionList ? node?.grouping?.[0]?.lexeme : '') ?? '??';
|
|
133
146
|
const escapedName = (0, mermaid_1.escapeMarkdown)(node ? `[${node.type}] ${lexeme}` : '??');
|
|
134
147
|
const deps = info.controlDependencies ? ', :may:' + info.controlDependencies.map(c => c.id + (c.when ? '+' : '-')).join(',') : '';
|
|
135
|
-
const n = node?.info.fullRange ?? node?.location ?? (node?.type ===
|
|
148
|
+
const n = node?.info.fullRange ?? node?.location ?? (node?.type === type_1.RType.ExpressionList ? node?.grouping?.[0].location : undefined);
|
|
136
149
|
mermaid.nodeLines.push(` ${idPrefix}${id}${open}"\`${escapedName}${escapedName.length > 10 ? '\n ' : ' '}(${id}${deps})\n *${formatRange(n)}*${fCall ? displayFunctionArgMapping(info.args) : ''}\`"${close}`);
|
|
137
150
|
if (mark?.has(id)) {
|
|
138
|
-
mermaid.nodeLines.push(` style ${idPrefix}${id}
|
|
151
|
+
mermaid.nodeLines.push(` style ${idPrefix}${id} ${mermaid.markStyle.vertex} `);
|
|
152
|
+
}
|
|
153
|
+
if (mermaid.rootGraph.unknownSideEffects.has(id)) {
|
|
154
|
+
mermaid.nodeLines.push(` style ${idPrefix}${id} stroke:red,stroke-width:5px; `);
|
|
139
155
|
}
|
|
140
156
|
const edges = mermaid.rootGraph.get(id, true);
|
|
141
157
|
(0, assert_1.guard)(edges !== undefined, `node ${id} must be found`);
|
|
@@ -148,9 +164,9 @@ function vertexToMermaid(info, mermaid, id, idPrefix, mark) {
|
|
|
148
164
|
mermaid.edgeLines.push(` ${idPrefix}${id} -->|"${[...edgeTypes].map(e => typeof e === 'number' ? (0, edge_1.edgeTypeToName)(e) : e).join(', ')}"| ${idPrefix}${target}`);
|
|
149
165
|
if (mermaid.mark?.has(id + '->' + target)) {
|
|
150
166
|
// who invented this syntax?!
|
|
151
|
-
mermaid.edgeLines.push(` linkStyle ${mermaid.presentEdges.size - 1}
|
|
167
|
+
mermaid.edgeLines.push(` linkStyle ${mermaid.presentEdges.size - 1} ${mermaid.markStyle.edge}`);
|
|
152
168
|
}
|
|
153
|
-
if (edgeTypes.has('CD-True')) {
|
|
169
|
+
if (edgeTypes.has('CD-True') || edgeTypes.has('CD-False')) {
|
|
154
170
|
mermaid.edgeLines.push(` linkStyle ${mermaid.presentEdges.size - 1} stroke:gray,color:gray;`);
|
|
155
171
|
}
|
|
156
172
|
}
|
|
@@ -160,8 +176,8 @@ function vertexToMermaid(info, mermaid, id, idPrefix, mark) {
|
|
|
160
176
|
}
|
|
161
177
|
}
|
|
162
178
|
// make the passing of root ids more performant again
|
|
163
|
-
function graphToMermaidGraph(rootIds, { graph, prefix = 'flowchart TD', idPrefix = '', includeEnvironments = true, mark, rootGraph, presentEdges = new Set() }) {
|
|
164
|
-
const mermaid = { nodeLines: prefix === null ? [] : [prefix], edgeLines: [], presentEdges, mark, rootGraph: rootGraph ?? graph, includeEnvironments };
|
|
179
|
+
function graphToMermaidGraph(rootIds, { graph, prefix = 'flowchart TD', idPrefix = '', includeEnvironments = true, mark, rootGraph, presentEdges = new Set(), markStyle = { vertex: 'stroke:teal,stroke-width:7px,stroke-opacity:.8;', edge: 'stroke:teal,stroke-width:4.2px,stroke-opacity:.8' } }) {
|
|
180
|
+
const mermaid = { nodeLines: prefix === null ? [] : [prefix], edgeLines: [], presentEdges, mark, rootGraph: rootGraph ?? graph, includeEnvironments, markStyle };
|
|
165
181
|
for (const [id, info] of graph.vertices(true)) {
|
|
166
182
|
if (rootIds.has(id)) {
|
|
167
183
|
vertexToMermaid(info, mermaid, id, idPrefix, mark);
|
|
@@ -173,7 +189,6 @@ function graphToMermaid(config) {
|
|
|
173
189
|
const mermaid = graphToMermaidGraph(config.graph.rootIds(), config);
|
|
174
190
|
return { string: `${mermaid.nodeLines.join('\n')}\n${mermaid.edgeLines.join('\n')}`, mermaid };
|
|
175
191
|
}
|
|
176
|
-
exports.graphToMermaid = graphToMermaid;
|
|
177
192
|
/**
|
|
178
193
|
* Converts a dataflow graph to a mermaid url that visualizes the graph.
|
|
179
194
|
*
|
|
@@ -184,7 +199,6 @@ exports.graphToMermaid = graphToMermaid;
|
|
|
184
199
|
function graphToMermaidUrl(graph, includeEnvironments, mark) {
|
|
185
200
|
return (0, mermaid_1.mermaidCodeToUrl)(graphToMermaid({ graph, includeEnvironments, mark }).string);
|
|
186
201
|
}
|
|
187
|
-
exports.graphToMermaidUrl = graphToMermaidUrl;
|
|
188
202
|
/** uses same id map but ensures, it is different from the rhs so that mermaid can work with that */
|
|
189
203
|
function diffGraphsToMermaid(left, right, prefix) {
|
|
190
204
|
// we add the prefix ourselves
|
|
@@ -192,9 +206,7 @@ function diffGraphsToMermaid(left, right, prefix) {
|
|
|
192
206
|
const { string: rightGraph } = graphToMermaid({ graph: right.graph, prefix: '', idPrefix: `r-${right.label}`, includeEnvironments: true, mark: right.mark, presentEdges: mermaid.presentEdges });
|
|
193
207
|
return `${prefix}flowchart TD\nsubgraph "${left.label}"\n${leftGraph}\nend\nsubgraph "${right.label}"\n${rightGraph}\nend`;
|
|
194
208
|
}
|
|
195
|
-
exports.diffGraphsToMermaid = diffGraphsToMermaid;
|
|
196
209
|
function diffGraphsToMermaidUrl(left, right, prefix) {
|
|
197
210
|
return (0, mermaid_1.mermaidCodeToUrl)(diffGraphsToMermaid(left, right, prefix));
|
|
198
211
|
}
|
|
199
|
-
exports.diffGraphsToMermaidUrl = diffGraphsToMermaidUrl;
|
|
200
212
|
//# sourceMappingURL=dfg.js.map
|
package/util/mermaid/mermaid.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.escapeMarkdown = escapeMarkdown;
|
|
4
|
+
exports.mermaidCodeToUrl = mermaidCodeToUrl;
|
|
4
5
|
const replacements = {
|
|
5
6
|
// keep newlines
|
|
6
7
|
'\\n': '\n',
|
|
@@ -17,7 +18,9 @@ const replacements = {
|
|
|
17
18
|
'_': '#95;',
|
|
18
19
|
'{': '#123;',
|
|
19
20
|
'}': '#125;',
|
|
20
|
-
'&': '#38;'
|
|
21
|
+
'&': '#38;',
|
|
22
|
+
'\'': '#39;',
|
|
23
|
+
':': '#58;',
|
|
21
24
|
};
|
|
22
25
|
function escapeMarkdown(text) {
|
|
23
26
|
for (const [key, value] of Object.entries(replacements)) {
|
|
@@ -25,7 +28,6 @@ function escapeMarkdown(text) {
|
|
|
25
28
|
}
|
|
26
29
|
return text;
|
|
27
30
|
}
|
|
28
|
-
exports.escapeMarkdown = escapeMarkdown;
|
|
29
31
|
/**
|
|
30
32
|
* Converts mermaid code (potentially produced by {@link graphToMermaid}) to an url that presents the graph in the mermaid editor.
|
|
31
33
|
*
|
|
@@ -40,5 +42,4 @@ function mermaidCodeToUrl(code, edit = false) {
|
|
|
40
42
|
};
|
|
41
43
|
return `https://mermaid.live/${edit ? 'edit' : 'view'}#base64:${Buffer.from(JSON.stringify(obj)).toString('base64')}`;
|
|
42
44
|
}
|
|
43
|
-
exports.mermaidCodeToUrl = mermaidCodeToUrl;
|
|
44
45
|
//# sourceMappingURL=mermaid.js.map
|
package/util/numbers.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.bigint2number =
|
|
3
|
+
exports.bigint2number = bigint2number;
|
|
4
4
|
function bigint2number(a) {
|
|
5
5
|
// we have to remove the trailing `n`
|
|
6
6
|
return Number(String(a).slice(0, -1));
|
|
7
7
|
}
|
|
8
|
-
exports.bigint2number = bigint2number;
|
|
9
8
|
//# sourceMappingURL=numbers.js.map
|
package/util/objects.d.ts
CHANGED
|
@@ -15,3 +15,10 @@ export declare function deepMergeObject<T extends Mergeable>(base: DeepRequired<
|
|
|
15
15
|
export declare function deepMergeObject<T extends Mergeable>(base: T, addon?: DeepPartial<T> | Partial<T>): T;
|
|
16
16
|
export declare function deepMergeObject(base: Mergeable, addon: Mergeable): Mergeable;
|
|
17
17
|
export declare function deepMergeObject(base?: Mergeable, addon?: Mergeable): Mergeable | undefined;
|
|
18
|
+
type Defined<T> = Exclude<T, undefined>;
|
|
19
|
+
type DefinedRecord<T> = {
|
|
20
|
+
[K in keyof T as T[K] extends undefined ? never : K]: Defined<T[K]>;
|
|
21
|
+
};
|
|
22
|
+
/** from a record take only the keys that are not undefined */
|
|
23
|
+
export declare function compactRecord<T extends Record<string, unknown>>(record: T): DefinedRecord<T>;
|
|
24
|
+
export {};
|
package/util/objects.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isObjectOrArray = isObjectOrArray;
|
|
4
|
+
exports.deepMergeObject = deepMergeObject;
|
|
5
|
+
exports.compactRecord = compactRecord;
|
|
4
6
|
const json_1 = require("./json");
|
|
5
7
|
/**
|
|
6
8
|
* checks if `item` is an object (it may be an array, ...)
|
|
@@ -8,7 +10,6 @@ const json_1 = require("./json");
|
|
|
8
10
|
function isObjectOrArray(item) {
|
|
9
11
|
return typeof item === 'object';
|
|
10
12
|
}
|
|
11
|
-
exports.isObjectOrArray = isObjectOrArray;
|
|
12
13
|
function deepMergeObject(base, addon) {
|
|
13
14
|
if (!base) {
|
|
14
15
|
return addon;
|
|
@@ -35,7 +36,6 @@ function deepMergeObject(base, addon) {
|
|
|
35
36
|
}
|
|
36
37
|
return result;
|
|
37
38
|
}
|
|
38
|
-
exports.deepMergeObject = deepMergeObject;
|
|
39
39
|
function deepMergeObjectWithResult(addon, base, result) {
|
|
40
40
|
for (const key of Object.keys(addon)) {
|
|
41
41
|
// values that are undefined (like from a partial object) should NOT be overwritten
|
|
@@ -61,4 +61,14 @@ function assertSameType(base, addon) {
|
|
|
61
61
|
throw new Error(`cannot merge different types! ${typeof base} (${JSON.stringify(base, json_1.jsonReplacer)}) !== ${typeof addon} (${JSON.stringify(addon, json_1.jsonReplacer)})`);
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
+
/** from a record take only the keys that are not undefined */
|
|
65
|
+
function compactRecord(record) {
|
|
66
|
+
const result = {};
|
|
67
|
+
for (const key of Object.keys(record)) {
|
|
68
|
+
if (record[key] !== undefined) {
|
|
69
|
+
result[key] = record[key];
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
64
74
|
//# sourceMappingURL=objects.js.map
|
package/util/os.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getPlatform =
|
|
3
|
+
exports.getPlatform = getPlatform;
|
|
4
4
|
let platformCache = null;
|
|
5
5
|
function getPlatform() {
|
|
6
6
|
if (platformCache !== null) {
|
|
@@ -21,5 +21,4 @@ function getPlatform() {
|
|
|
21
21
|
}
|
|
22
22
|
return platformCache;
|
|
23
23
|
}
|
|
24
|
-
exports.getPlatform = getPlatform;
|
|
25
24
|
//# sourceMappingURL=os.js.map
|
package/util/quads.js
CHANGED
|
@@ -9,7 +9,11 @@
|
|
|
9
9
|
* @module
|
|
10
10
|
*/
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.
|
|
12
|
+
exports.DefaultQuadSerializationConfiguration = void 0;
|
|
13
|
+
exports.defaultQuadIdGenerator = defaultQuadIdGenerator;
|
|
14
|
+
exports.defaultQuadIgnoreIf = defaultQuadIgnoreIf;
|
|
15
|
+
exports.serialize2quads = serialize2quads;
|
|
16
|
+
exports.graph2quads = graph2quads;
|
|
13
17
|
const n3_1 = require("n3");
|
|
14
18
|
var namedNode = n3_1.DataFactory.namedNode;
|
|
15
19
|
var quad = n3_1.DataFactory.quad;
|
|
@@ -27,12 +31,10 @@ function defaultQuadIdGenerator() {
|
|
|
27
31
|
const idMap = new defaultmap_1.DefaultMap(() => counter++);
|
|
28
32
|
return (elem, context) => `${context}/${idMap.get(elem)}`;
|
|
29
33
|
}
|
|
30
|
-
exports.defaultQuadIdGenerator = defaultQuadIdGenerator;
|
|
31
34
|
const ignoredKeysArray = ['complexNumber', 'markedAsInt', 'info'];
|
|
32
35
|
function defaultQuadIgnoreIf() {
|
|
33
36
|
return (key, value) => value === undefined || ignoredKeysArray.includes(key);
|
|
34
37
|
}
|
|
35
|
-
exports.defaultQuadIgnoreIf = defaultQuadIgnoreIf;
|
|
36
38
|
exports.DefaultQuadSerializationConfiguration = {
|
|
37
39
|
ignore: defaultQuadIgnoreIf(),
|
|
38
40
|
context: 'unknown-context',
|
|
@@ -62,7 +64,6 @@ function serialize2quads(obj, config) {
|
|
|
62
64
|
serializeObject(obj, quads, useConfig);
|
|
63
65
|
return writer.quadsToString(quads);
|
|
64
66
|
}
|
|
65
|
-
exports.serialize2quads = serialize2quads;
|
|
66
67
|
/**
|
|
67
68
|
* Serializes the given directed graph to rdf quads.
|
|
68
69
|
* This is a mere (type-)convenience wrapper for {@link serialize2quads}.
|
|
@@ -72,7 +73,6 @@ exports.serialize2quads = serialize2quads;
|
|
|
72
73
|
function graph2quads(graph, config) {
|
|
73
74
|
return serialize2quads(graph, config);
|
|
74
75
|
}
|
|
75
|
-
exports.graph2quads = graph2quads;
|
|
76
76
|
function processArrayEntries(key, values, obj, quads, config) {
|
|
77
77
|
for (const [index, element] of values.entries()) {
|
|
78
78
|
if (element !== null && element !== undefined && (0, objects_1.isObjectOrArray)(element)) {
|
package/util/random.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ALPHABET = exports.ALPHABET_UPPERCASE = exports.ALPHABET_LOWERCASE = void 0;
|
|
4
|
+
exports.randomString = randomString;
|
|
4
5
|
const assert_1 = require("./assert");
|
|
5
6
|
exports.ALPHABET_LOWERCASE = [...'abcdefghijklmnopqrstuvwxyz'];
|
|
6
7
|
exports.ALPHABET_UPPERCASE = [...'ABCDEFGHIJKLMNOPQRSTUVWXYZ'];
|
|
@@ -18,5 +19,4 @@ function randomString(length, symbols = exports.ALPHABET) {
|
|
|
18
19
|
}
|
|
19
20
|
return result;
|
|
20
21
|
}
|
|
21
|
-
exports.randomString = randomString;
|
|
22
22
|
//# sourceMappingURL=random.js.map
|
package/util/range.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getRangeStart = getRangeStart;
|
|
4
|
+
exports.getRangeEnd = getRangeEnd;
|
|
5
|
+
exports.rangeFrom = rangeFrom;
|
|
6
|
+
exports.mergeRanges = mergeRanges;
|
|
7
|
+
exports.rangeStartsCompletelyBefore = rangeStartsCompletelyBefore;
|
|
8
|
+
exports.rangesOverlap = rangesOverlap;
|
|
9
|
+
exports.addRanges = addRanges;
|
|
10
|
+
exports.rangeCompare = rangeCompare;
|
|
4
11
|
const assert_1 = require("./assert");
|
|
5
12
|
function getRangeStart(p) {
|
|
6
13
|
return p === undefined ? undefined : [p[0], p[1]];
|
|
7
14
|
}
|
|
8
|
-
exports.getRangeStart = getRangeStart;
|
|
9
15
|
function getRangeEnd(p) {
|
|
10
16
|
return p === undefined ? undefined : [p[2], p[3]];
|
|
11
17
|
}
|
|
12
|
-
exports.getRangeEnd = getRangeEnd;
|
|
13
18
|
/**
|
|
14
19
|
* This does not ensure ordering of start and end!
|
|
15
20
|
*
|
|
@@ -21,7 +26,6 @@ exports.getRangeEnd = getRangeEnd;
|
|
|
21
26
|
function rangeFrom(sl, sc, el, ec) {
|
|
22
27
|
return [Number(sl), Number(sc), Number(el), Number(ec)];
|
|
23
28
|
}
|
|
24
|
-
exports.rangeFrom = rangeFrom;
|
|
25
29
|
function mergeRanges(...rs) {
|
|
26
30
|
(0, assert_1.guard)(rs.length > 0, 'Cannot merge no ranges');
|
|
27
31
|
return rs.reduce(([sl, sc, el, ec], [nsl, nsc, nel, nec]) => [
|
|
@@ -29,25 +33,21 @@ function mergeRanges(...rs) {
|
|
|
29
33
|
...(el > nel || (el === nel && ec > nec) ? [el, ec] : [nel, nec])
|
|
30
34
|
], rs[0]);
|
|
31
35
|
}
|
|
32
|
-
exports.mergeRanges = mergeRanges;
|
|
33
36
|
/**
|
|
34
37
|
* @returns true iff `r1` starts and ends before `r2` starts (i.e., if `r1` and `r2` do not overlap and `r1` comes before `r2`
|
|
35
38
|
*/
|
|
36
39
|
function rangeStartsCompletelyBefore([, , r1el, r1ec], [r2sl, r2sc, ,]) {
|
|
37
40
|
return r1el < r2sl || (r1el === r2sl && r1ec < r2sc);
|
|
38
41
|
}
|
|
39
|
-
exports.rangeStartsCompletelyBefore = rangeStartsCompletelyBefore;
|
|
40
42
|
/**
|
|
41
43
|
* Checks if the two ranges overlap.
|
|
42
44
|
*/
|
|
43
45
|
function rangesOverlap([r1sl, r1sc, r1el, r1ec], [r2sl, r2sc, r2el, r2ec]) {
|
|
44
46
|
return r1sl <= r2el && r2sl <= r1el && r1sc <= r2ec && r2sc <= r1ec;
|
|
45
47
|
}
|
|
46
|
-
exports.rangesOverlap = rangesOverlap;
|
|
47
48
|
function addRanges([r1sl, r1sc, r1el, r1ec], [r2sl, r2sc, r2el, r2ec]) {
|
|
48
49
|
return [r1sl + r2sl, r1sc + r2sc, r1el + r2el, r1ec + r2ec];
|
|
49
50
|
}
|
|
50
|
-
exports.addRanges = addRanges;
|
|
51
51
|
/**
|
|
52
52
|
* Provides a comparator for {@link SourceRange}s that sorts them in ascending order.
|
|
53
53
|
*
|
|
@@ -61,5 +61,4 @@ function rangeCompare([r1sl, r1sc, ,], [r2sl, r2sc, ,]) {
|
|
|
61
61
|
return r1sl - r2sl;
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
|
-
exports.rangeCompare = rangeCompare;
|
|
65
64
|
//# sourceMappingURL=range.js.map
|
package/util/schema.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type Joi from 'joi';
|
|
2
|
+
import type { OutputFormatter } from './ansi';
|
|
3
|
+
interface SchemaLine {
|
|
4
|
+
level: number;
|
|
5
|
+
text: string;
|
|
6
|
+
}
|
|
7
|
+
export declare function describeSchema(schema: Joi.Schema, f?: OutputFormatter): string;
|
|
8
|
+
export declare function genericDescription(level: number, formatter: OutputFormatter, name: string, desc: Joi.Description | undefined): SchemaLine[];
|
|
9
|
+
export declare function headerLine(level: number, formatter: OutputFormatter, name: string, type: string, flags: object | undefined): SchemaLine[];
|
|
10
|
+
export declare function describeObject(level: number, formatter: OutputFormatter, desc: Joi.Description): SchemaLine[];
|
|
11
|
+
export {};
|
package/util/schema.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.describeSchema = describeSchema;
|
|
4
|
+
exports.genericDescription = genericDescription;
|
|
5
|
+
exports.headerLine = headerLine;
|
|
6
|
+
exports.describeObject = describeObject;
|
|
7
|
+
const ansi_1 = require("./ansi");
|
|
8
|
+
function describeSchema(schema, f = ansi_1.formatter) {
|
|
9
|
+
const description = schema.describe();
|
|
10
|
+
const lines = genericDescription(1, f, f.format('.', { effect: ansi_1.ColorEffect.Foreground, color: 7 /* Colors.White */ }), description);
|
|
11
|
+
const indent = ' '.repeat(4);
|
|
12
|
+
return lines.map(line => `${indent.repeat(line.level - 1)}${line.text}`).join('\n');
|
|
13
|
+
}
|
|
14
|
+
function genericDescription(level, formatter, name, desc) {
|
|
15
|
+
if (!desc) {
|
|
16
|
+
return [];
|
|
17
|
+
}
|
|
18
|
+
const lines = [...headerLine(level, formatter, name, desc.type ?? 'unknown', desc.flags)];
|
|
19
|
+
if ('allow' in desc) {
|
|
20
|
+
lines.push({ level: level + 1, text: `Allows only the values: ${desc['allow'].map(v => "'" + v + "'").join(', ')}` });
|
|
21
|
+
}
|
|
22
|
+
switch (desc.type) {
|
|
23
|
+
case 'object':
|
|
24
|
+
lines.push(...describeObject(level, formatter, desc));
|
|
25
|
+
break;
|
|
26
|
+
case 'alternatives':
|
|
27
|
+
if ('matches' in desc) {
|
|
28
|
+
lines.push(...desc['matches']
|
|
29
|
+
.flatMap(({ schema }) => genericDescription(level + 1, formatter, '.', schema)));
|
|
30
|
+
}
|
|
31
|
+
break;
|
|
32
|
+
case 'array':
|
|
33
|
+
if ('items' in desc) {
|
|
34
|
+
lines.push({ text: 'Valid item types:', level: level });
|
|
35
|
+
lines.push(...desc['items']
|
|
36
|
+
.flatMap(desc => genericDescription(level + 1, formatter, '.', desc)));
|
|
37
|
+
}
|
|
38
|
+
break;
|
|
39
|
+
default:
|
|
40
|
+
/* specific support for others if needed */
|
|
41
|
+
break;
|
|
42
|
+
}
|
|
43
|
+
return lines;
|
|
44
|
+
}
|
|
45
|
+
function printFlags(flags) {
|
|
46
|
+
if (!flags || Object.keys(flags).length === 0) {
|
|
47
|
+
return '';
|
|
48
|
+
}
|
|
49
|
+
let flagText = '';
|
|
50
|
+
if ('presence' in flags) {
|
|
51
|
+
flagText += String(flags['presence']);
|
|
52
|
+
}
|
|
53
|
+
return flagText.trim().length > 0 ? '[' + flagText + ']' : '';
|
|
54
|
+
}
|
|
55
|
+
function headerLine(level, formatter, name, type, flags) {
|
|
56
|
+
const text = `- ${(0, ansi_1.bold)(name, formatter)} ${formatter.format(type, { effect: ansi_1.ColorEffect.Foreground, color: 7 /* Colors.White */ })} ${printFlags(flags)}`;
|
|
57
|
+
const baseLine = { level, text };
|
|
58
|
+
if (flags && 'description' in flags) {
|
|
59
|
+
return [baseLine, { level: level + 1, text: (0, ansi_1.italic)(flags['description'], formatter) }];
|
|
60
|
+
}
|
|
61
|
+
return [baseLine];
|
|
62
|
+
}
|
|
63
|
+
function describeObject(level, formatter, desc) {
|
|
64
|
+
const lines = [];
|
|
65
|
+
if (!('keys' in desc)) {
|
|
66
|
+
return lines;
|
|
67
|
+
}
|
|
68
|
+
for (const key in desc.keys) {
|
|
69
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
70
|
+
const keySchema = desc.keys[key];
|
|
71
|
+
lines.push(...genericDescription(level + 1, formatter, key, keySchema));
|
|
72
|
+
}
|
|
73
|
+
return lines;
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=schema.js.map
|
package/util/set.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.setEquals = setEquals;
|
|
4
|
+
exports.setMinus = setMinus;
|
|
4
5
|
/**
|
|
5
6
|
* Given both sets, this checks if they contain the same elements.
|
|
6
7
|
*/
|
|
@@ -15,7 +16,6 @@ function setEquals(a, b) {
|
|
|
15
16
|
}
|
|
16
17
|
return true;
|
|
17
18
|
}
|
|
18
|
-
exports.setEquals = setEquals;
|
|
19
19
|
/**
|
|
20
20
|
* Returns `A – B`
|
|
21
21
|
*/
|
|
@@ -28,5 +28,4 @@ function setMinus(a, b) {
|
|
|
28
28
|
}
|
|
29
29
|
return result;
|
|
30
30
|
}
|
|
31
|
-
exports.setMinus = setMinus;
|
|
32
31
|
//# sourceMappingURL=set.js.map
|
package/util/strings.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.startAndEndsWith = startAndEndsWith;
|
|
4
|
+
exports.withoutWhitespace = withoutWhitespace;
|
|
5
|
+
exports.longestCommonPrefix = longestCommonPrefix;
|
|
4
6
|
/**
|
|
5
7
|
* Check if the given string starts and ends with the given letter
|
|
6
8
|
*/
|
|
7
9
|
function startAndEndsWith(str, letter) {
|
|
8
10
|
return str.startsWith(letter) && str.endsWith(letter);
|
|
9
11
|
}
|
|
10
|
-
exports.startAndEndsWith = startAndEndsWith;
|
|
11
12
|
/**
|
|
12
13
|
* Removes all whitespace in the given string
|
|
13
14
|
*/
|
|
14
15
|
function withoutWhitespace(output) {
|
|
15
16
|
return output.replace(/\s/g, '');
|
|
16
17
|
}
|
|
17
|
-
exports.withoutWhitespace = withoutWhitespace;
|
|
18
18
|
/**
|
|
19
19
|
* Find the longest common prefix in an array of strings
|
|
20
20
|
*/
|
|
@@ -37,5 +37,4 @@ function longestCommonPrefix(strings) {
|
|
|
37
37
|
}
|
|
38
38
|
return prefix;
|
|
39
39
|
}
|
|
40
|
-
exports.longestCommonPrefix = longestCommonPrefix;
|
|
41
40
|
//# sourceMappingURL=strings.js.map
|
package/util/summarizer.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Summarizer = void 0;
|
|
4
|
+
exports.summarizedMeasurement2Csv = summarizedMeasurement2Csv;
|
|
5
|
+
exports.summarizedMeasurement2CsvHeader = summarizedMeasurement2CsvHeader;
|
|
6
|
+
exports.summarizeMeasurement = summarizeMeasurement;
|
|
4
7
|
const arrays_1 = require("./arrays");
|
|
5
8
|
class Summarizer {
|
|
6
9
|
config;
|
|
@@ -14,12 +17,10 @@ exports.Summarizer = Summarizer;
|
|
|
14
17
|
function summarizedMeasurement2Csv(a) {
|
|
15
18
|
return `${a.min},${a.max},${a.median},${a.mean},${a.std},${a.total}`;
|
|
16
19
|
}
|
|
17
|
-
exports.summarizedMeasurement2Csv = summarizedMeasurement2Csv;
|
|
18
20
|
const summarizedKeys = ['min', 'max', 'median', 'mean', 'std', 'total'];
|
|
19
21
|
function summarizedMeasurement2CsvHeader(prefix) {
|
|
20
22
|
return summarizedKeys.map(k => prefix ? `${prefix}-${k}` : k).join(',');
|
|
21
23
|
}
|
|
22
|
-
exports.summarizedMeasurement2CsvHeader = summarizedMeasurement2CsvHeader;
|
|
23
24
|
function summarizeMeasurement(data, totalNumberOfDataPoints) {
|
|
24
25
|
// just to avoid in-place modification
|
|
25
26
|
const sorted = [...data].sort((a, b) => a - b);
|
|
@@ -33,5 +34,4 @@ function summarizeMeasurement(data, totalNumberOfDataPoints) {
|
|
|
33
34
|
const std = Math.sqrt(sorted.map(x => (x - mean) ** 2).reduce((a, b) => a + b, 0) / length);
|
|
34
35
|
return { min, max, median, mean, std, total };
|
|
35
36
|
}
|
|
36
|
-
exports.summarizeMeasurement = summarizeMeasurement;
|
|
37
37
|
//# sourceMappingURL=summarizer.js.map
|
package/util/text.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function nth(n: number): string;
|
package/util/text.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.nth = nth;
|
|
4
|
+
const assert_1 = require("./assert");
|
|
5
|
+
function nth(n) {
|
|
6
|
+
(0, assert_1.guard)(isFinite(n) && n >= 1, 'n must be a non-negative number');
|
|
7
|
+
const num = String(n);
|
|
8
|
+
const lastDigit = num[num.length - 1];
|
|
9
|
+
switch (lastDigit) {
|
|
10
|
+
case '1':
|
|
11
|
+
return n > 0 && n < 20 ? `${n}th` : `${n}st`;
|
|
12
|
+
case '2':
|
|
13
|
+
return n > 0 && n < 20 ? `${n}th` : `${n}nd`;
|
|
14
|
+
case '3':
|
|
15
|
+
return n > 0 && n < 20 ? `${n}th` : `${n}rd`;
|
|
16
|
+
default:
|
|
17
|
+
return `${n}th`;
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=text.js.map
|
package/util/time.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.date2string =
|
|
3
|
+
exports.date2string = date2string;
|
|
4
4
|
/**
|
|
5
5
|
* Retrieve a string in the form of "YYYY-MM-DD-HH-MM-SS-MS" from a Date object.
|
|
6
6
|
*
|
|
@@ -9,5 +9,4 @@ exports.date2string = void 0;
|
|
|
9
9
|
function date2string(date = new Date()) {
|
|
10
10
|
return `${date.getFullYear()}-${date.getMonth() + 1}-${date.getDate()}-${date.getHours()}-${date.getMinutes()}-${date.getSeconds()}-${date.getMilliseconds()}`;
|
|
11
11
|
}
|
|
12
|
-
exports.date2string = date2string;
|
|
13
12
|
//# sourceMappingURL=time.js.map
|
package/util/version.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.flowrVersion =
|
|
3
|
+
exports.flowrVersion = flowrVersion;
|
|
4
4
|
const semver_1 = require("semver");
|
|
5
5
|
// this is automatically replaced with the current version by release-it
|
|
6
|
-
const version = '2.0
|
|
6
|
+
const version = '2.1.0';
|
|
7
7
|
function flowrVersion() {
|
|
8
8
|
return new semver_1.SemVer(version);
|
|
9
9
|
}
|
|
10
|
-
exports.flowrVersion = flowrVersion;
|
|
11
10
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import type { ReplCommand } from './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 { DataflowInformation } from '../../../dataflow/info';
|
|
5
|
-
import type { NormalizedAst } 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 ast - The normalized AST
|
|
11
|
-
* @param dfg - The dataflow graph
|
|
12
|
-
* @returns The lineage of the node represented as a set of node ids
|
|
13
|
-
*/
|
|
14
|
-
export declare function getLineage(criterion: SingleSlicingCriterion, { idMap }: NormalizedAst, dfg: DataflowInformation): Set<NodeId>;
|
|
15
|
-
export declare const getLineageCommand: ReplCommand;
|
|
@@ -1,21 +0,0 @@
|
|
|
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.requestAnalysisMessage = void 0;
|
|
7
|
-
const joi_1 = __importDefault(require("joi"));
|
|
8
|
-
exports.requestAnalysisMessage = {
|
|
9
|
-
type: 'request-file-analysis',
|
|
10
|
-
schema: joi_1.default.object({
|
|
11
|
-
type: joi_1.default.string().valid('request-file-analysis').required(),
|
|
12
|
-
id: joi_1.default.string().optional(),
|
|
13
|
-
filetoken: joi_1.default.string().optional(),
|
|
14
|
-
filename: joi_1.default.string().optional(),
|
|
15
|
-
content: joi_1.default.string().optional(),
|
|
16
|
-
filepath: joi_1.default.alternatives(joi_1.default.string(), joi_1.default.array().items(joi_1.default.string())).optional(),
|
|
17
|
-
cfg: joi_1.default.boolean().optional(),
|
|
18
|
-
format: joi_1.default.string().valid('json', 'n-quads').optional()
|
|
19
|
-
}).xor('content', 'filepath')
|
|
20
|
-
};
|
|
21
|
-
//# sourceMappingURL=analysis.js.map
|