@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
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { SingleSlicingCriterion } from '../../../../slicing/criterion/parse';
|
|
2
|
-
import type { IdMessageBase, MessageDefinition } from './messages';
|
|
2
|
+
import type { IdMessageBase, MessageDefinition } from './all-messages';
|
|
3
3
|
import type { NodeId } from '../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
4
4
|
export interface LineageRequestMessage extends IdMessageBase {
|
|
5
5
|
type: 'request-lineage';
|
|
@@ -14,3 +14,4 @@ export interface LineageResponseMessage extends IdMessageBase {
|
|
|
14
14
|
/** The lineage of the given criterion. With this being the representation of a set, there is no guarantee about order. */
|
|
15
15
|
lineage: NodeId[];
|
|
16
16
|
}
|
|
17
|
+
export declare const responseLineageMessage: MessageDefinition<LineageResponseMessage>;
|
|
@@ -0,0 +1,25 @@
|
|
|
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.responseLineageMessage = exports.requestLineageMessage = void 0;
|
|
7
|
+
const joi_1 = __importDefault(require("joi"));
|
|
8
|
+
exports.requestLineageMessage = {
|
|
9
|
+
type: 'request-lineage',
|
|
10
|
+
schema: joi_1.default.object({
|
|
11
|
+
type: joi_1.default.string().valid('request-lineage').required().description('The type of the message.'),
|
|
12
|
+
id: joi_1.default.string().optional().description('If you give the id, the response will be sent to the client with the same id.'),
|
|
13
|
+
filetoken: joi_1.default.string().required().description('The filetoken of the file/data retrieved from the analysis request.'),
|
|
14
|
+
criterion: joi_1.default.string().required().description('The criterion to start the lineage from.')
|
|
15
|
+
})
|
|
16
|
+
};
|
|
17
|
+
exports.responseLineageMessage = {
|
|
18
|
+
type: 'response-lineage',
|
|
19
|
+
schema: joi_1.default.object({
|
|
20
|
+
type: joi_1.default.string().valid('response-lineage').required(),
|
|
21
|
+
id: joi_1.default.string().optional().description('The id of the message, will be the same for the request.'),
|
|
22
|
+
lineage: joi_1.default.array().items(joi_1.default.string()).required().description('The lineage of the given criterion.')
|
|
23
|
+
})
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=message-lineage.js.map
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { IdMessageBase, MessageDefinition } from './all-messages';
|
|
2
|
+
import type { Queries, QueryResults, SupportedQueryTypes } from '../../../../queries/query';
|
|
3
|
+
export interface QueryRequestMessage extends IdMessageBase {
|
|
4
|
+
type: 'request-query';
|
|
5
|
+
/** The {@link FileAnalysisRequestMessage#filetoken} of the file/data */
|
|
6
|
+
filetoken: string;
|
|
7
|
+
/** The query to run on the file analysis information */
|
|
8
|
+
query: Queries<SupportedQueryTypes>;
|
|
9
|
+
}
|
|
10
|
+
export declare const requestQueryMessage: MessageDefinition<QueryRequestMessage>;
|
|
11
|
+
export interface QueryResponseMessage extends IdMessageBase {
|
|
12
|
+
type: 'response-query';
|
|
13
|
+
/** Contains an entry for each (non-virtual) query type requested */
|
|
14
|
+
results: QueryResults<SupportedQueryTypes>;
|
|
15
|
+
}
|
|
16
|
+
export declare const responseQueryMessage: MessageDefinition<QueryResponseMessage>;
|
|
@@ -0,0 +1,26 @@
|
|
|
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.responseQueryMessage = exports.requestQueryMessage = void 0;
|
|
7
|
+
const joi_1 = __importDefault(require("joi"));
|
|
8
|
+
const query_schema_1 = require("../../../../queries/query-schema");
|
|
9
|
+
exports.requestQueryMessage = {
|
|
10
|
+
type: 'request-query',
|
|
11
|
+
schema: joi_1.default.object({
|
|
12
|
+
type: joi_1.default.string().valid('request-query').required().description('The type of the message.'),
|
|
13
|
+
id: joi_1.default.string().optional().description('If you give the id, the response will be sent to the client with the same id.'),
|
|
14
|
+
filetoken: joi_1.default.string().required().description('The filetoken of the file/data retrieved from the analysis request.'),
|
|
15
|
+
query: query_schema_1.QueriesSchema.required().description('The query to run on the file analysis information.')
|
|
16
|
+
}).description('Request a query to be run on the file analysis information.')
|
|
17
|
+
};
|
|
18
|
+
exports.responseQueryMessage = {
|
|
19
|
+
type: 'response-query',
|
|
20
|
+
schema: joi_1.default.object({
|
|
21
|
+
type: joi_1.default.string().valid('response-query').required(),
|
|
22
|
+
id: joi_1.default.string().optional().description('The id of the message, will be the same for the request.'),
|
|
23
|
+
results: joi_1.default.object().required().description('The results of the query.')
|
|
24
|
+
}).description('The response to a query request.')
|
|
25
|
+
};
|
|
26
|
+
//# sourceMappingURL=message-query.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IdMessageBase, MessageDefinition } from './messages';
|
|
1
|
+
import type { IdMessageBase, MessageDefinition } from './all-messages';
|
|
2
2
|
/**
|
|
3
3
|
* Request the execution of the given expression as a REPL statement.
|
|
4
4
|
* We strongly recommend that you make use of a unique {@link IdMessageBase#id}
|
|
@@ -24,6 +24,7 @@ export interface ExecuteIntermediateResponseMessage extends IdMessageBase {
|
|
|
24
24
|
stream: 'stdout' | 'stderr';
|
|
25
25
|
result: string;
|
|
26
26
|
}
|
|
27
|
+
export declare const responseExecuteReplIntermediateMessage: MessageDefinition<ExecuteIntermediateResponseMessage>;
|
|
27
28
|
/**
|
|
28
29
|
* Marks the end of the execution of the respective {@link ExecuteRequestMessage}.
|
|
29
30
|
* The underlying TCP connection should ensure the ordering so that this message is the last.
|
|
@@ -31,3 +32,4 @@ export interface ExecuteIntermediateResponseMessage extends IdMessageBase {
|
|
|
31
32
|
export interface ExecuteEndMessage extends IdMessageBase {
|
|
32
33
|
type: 'end-repl-execution';
|
|
33
34
|
}
|
|
35
|
+
export declare const responseExecuteReplEndMessage: MessageDefinition<ExecuteEndMessage>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.responseExecuteReplEndMessage = exports.responseExecuteReplIntermediateMessage = exports.requestExecuteReplExpressionMessage = void 0;
|
|
27
|
+
const Joi = __importStar(require("joi"));
|
|
28
|
+
exports.requestExecuteReplExpressionMessage = {
|
|
29
|
+
type: 'request-repl-execution',
|
|
30
|
+
schema: Joi.object({
|
|
31
|
+
type: Joi.string().valid('request-repl-execution').required().description('The type of the message.'),
|
|
32
|
+
id: Joi.string().optional().description('The id of the message, will be the same for the request.'),
|
|
33
|
+
ansi: Joi.boolean().optional().description('Should ansi formatting be enabled for the response? Is `false` by default.'),
|
|
34
|
+
expression: Joi.string().required().description('The expression to execute.'),
|
|
35
|
+
})
|
|
36
|
+
};
|
|
37
|
+
exports.responseExecuteReplIntermediateMessage = {
|
|
38
|
+
type: 'response-repl-execution',
|
|
39
|
+
schema: Joi.object({
|
|
40
|
+
type: Joi.string().valid('response-repl-execution').required().description('The type of the message.'),
|
|
41
|
+
id: Joi.string().optional().description('The id of the message, will be the same for the request.'),
|
|
42
|
+
stream: Joi.string().valid('stdout', 'stderr').required().description('The stream the message is from.'),
|
|
43
|
+
result: Joi.string().required().description('The output of the execution.')
|
|
44
|
+
})
|
|
45
|
+
};
|
|
46
|
+
exports.responseExecuteReplEndMessage = {
|
|
47
|
+
type: 'end-repl-execution',
|
|
48
|
+
schema: Joi.object({
|
|
49
|
+
type: Joi.string().valid('end-repl-execution').required().description('The type of the message.'),
|
|
50
|
+
id: Joi.string().optional().description('The id of the message, will be the same for the request.')
|
|
51
|
+
})
|
|
52
|
+
};
|
|
53
|
+
//# sourceMappingURL=message-repl.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IdMessageBase, MessageDefinition } from './messages';
|
|
1
|
+
import type { IdMessageBase, MessageDefinition } from './all-messages';
|
|
2
2
|
import type { SlicingCriteria } from '../../../../slicing/criterion/parse';
|
|
3
3
|
import type { PipelineOutput } from '../../../../core/steps/pipeline/pipeline';
|
|
4
4
|
import type { DEFAULT_DATAFLOW_PIPELINE, DEFAULT_SLICING_PIPELINE } from '../../../../core/steps/pipeline/default-pipelines';
|
|
@@ -28,3 +28,4 @@ export interface SliceResponseMessage extends IdMessageBase {
|
|
|
28
28
|
/** only contains the results of the slice steps to not repeat ourselves */
|
|
29
29
|
results: Omit<PipelineOutput<typeof DEFAULT_SLICING_PIPELINE>, keyof PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>>;
|
|
30
30
|
}
|
|
31
|
+
export declare const responseSliceMessage: MessageDefinition<SliceResponseMessage>;
|
|
@@ -23,15 +23,23 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.requestSliceMessage = void 0;
|
|
26
|
+
exports.responseSliceMessage = exports.requestSliceMessage = void 0;
|
|
27
27
|
const Joi = __importStar(require("joi"));
|
|
28
28
|
exports.requestSliceMessage = {
|
|
29
29
|
type: 'request-slice',
|
|
30
30
|
schema: Joi.object({
|
|
31
|
-
type: Joi.string().valid('request-slice').required(),
|
|
32
|
-
id: Joi.string().optional(),
|
|
33
|
-
filetoken: Joi.string().required(),
|
|
34
|
-
criterion: Joi.array().items(Joi.string()).min(0).required()
|
|
31
|
+
type: Joi.string().valid('request-slice').required().description('The type of the message.'),
|
|
32
|
+
id: Joi.string().optional().description('The id of the message, if you passed one in the request.'),
|
|
33
|
+
filetoken: Joi.string().required().description('The filetoken of the file to slice must be the same as with the analysis request.'),
|
|
34
|
+
criterion: Joi.array().items(Joi.string()).min(0).required().required().description('The slicing criteria to use.'),
|
|
35
35
|
})
|
|
36
36
|
};
|
|
37
|
-
|
|
37
|
+
exports.responseSliceMessage = {
|
|
38
|
+
type: 'response-slice',
|
|
39
|
+
schema: Joi.object({
|
|
40
|
+
type: Joi.string().valid('response-slice').required().description('The type of the message.'),
|
|
41
|
+
id: Joi.string().optional().description('The id of the message, if you passed one in the request.'),
|
|
42
|
+
results: Joi.object().required().description('The results of the slice (one field per step slicing step).')
|
|
43
|
+
}).description('The response to a slice request.')
|
|
44
|
+
};
|
|
45
|
+
//# sourceMappingURL=message-slice.js.map
|
package/cli/repl/server/net.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IdMessageBase } from './messages/messages';
|
|
1
|
+
import type { IdMessageBase } from './messages/all-messages';
|
|
2
2
|
import type { Socket } from './net';
|
|
3
3
|
export declare function getUnnamedSocketName(c: Socket): string;
|
|
4
4
|
export declare function sendMessage<T extends IdMessageBase>(c: Socket, message: T): void;
|
package/cli/repl/server/send.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getUnnamedSocketName = getUnnamedSocketName;
|
|
4
|
+
exports.sendMessage = sendMessage;
|
|
4
5
|
const server_1 = require("./server");
|
|
5
6
|
const json_1 = require("../../../util/json");
|
|
6
7
|
function getUnnamedSocketName(c) {
|
|
7
8
|
return `${c.remoteAddress ?? '?'}@${c.remotePort ?? '?'}`;
|
|
8
9
|
}
|
|
9
|
-
exports.getUnnamedSocketName = getUnnamedSocketName;
|
|
10
10
|
function sendMessage(c, message) {
|
|
11
11
|
const msg = JSON.stringify(message, json_1.jsonReplacer);
|
|
12
12
|
if (server_1.serverLog.settings.minLevel >= 2 /* LogLevel.Debug */) {
|
|
@@ -14,5 +14,4 @@ function sendMessage(c, message) {
|
|
|
14
14
|
}
|
|
15
15
|
c.write(`${msg}\n`);
|
|
16
16
|
}
|
|
17
|
-
exports.sendMessage = sendMessage;
|
|
18
17
|
//# sourceMappingURL=send.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.FlowRServer = exports.serverLog = void 0;
|
|
4
|
-
const
|
|
4
|
+
const repl_version_1 = require("../commands/repl-version");
|
|
5
5
|
const connection_1 = require("./connection");
|
|
6
6
|
const send_1 = require("./send");
|
|
7
7
|
const net_1 = require("./net");
|
|
@@ -28,7 +28,7 @@ class FlowRServer {
|
|
|
28
28
|
this.allowRSessionAccess = allowRSessionAccess;
|
|
29
29
|
}
|
|
30
30
|
async start(port) {
|
|
31
|
-
this.versionInformation = await (0,
|
|
31
|
+
this.versionInformation = await (0, repl_version_1.retrieveVersionInformation)(this.shell);
|
|
32
32
|
this.server.start(port);
|
|
33
33
|
exports.serverLog.info(`Server listening on port ${port}`);
|
|
34
34
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type * as Joi from 'joi';
|
|
2
|
-
import type { FlowrMessage, IdMessageBase, MessageDefinition } from './messages/messages';
|
|
2
|
+
import type { FlowrMessage, IdMessageBase, MessageDefinition } from './messages/all-messages';
|
|
3
3
|
import type { Socket } from './net';
|
|
4
4
|
export interface ValidationErrorResult {
|
|
5
5
|
type: 'error';
|
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.validateBaseMessageFormat = validateBaseMessageFormat;
|
|
4
|
+
exports.validateMessage = validateMessage;
|
|
5
|
+
exports.answerForValidationError = answerForValidationError;
|
|
4
6
|
const send_1 = require("./send");
|
|
5
|
-
const
|
|
7
|
+
const all_messages_1 = require("./messages/all-messages");
|
|
6
8
|
function validateBaseMessageFormat(input) {
|
|
7
9
|
try {
|
|
8
|
-
return validateMessage(JSON.parse(input),
|
|
10
|
+
return validateMessage(JSON.parse(input), all_messages_1.baseMessage);
|
|
9
11
|
}
|
|
10
12
|
catch (e) {
|
|
11
13
|
return { type: 'error', reason: e };
|
|
12
14
|
}
|
|
13
15
|
}
|
|
14
|
-
exports.validateBaseMessageFormat = validateBaseMessageFormat;
|
|
15
16
|
function validateMessage(input, def) {
|
|
16
17
|
try {
|
|
17
18
|
const result = def.schema.validate(input);
|
|
@@ -21,7 +22,6 @@ function validateMessage(input, def) {
|
|
|
21
22
|
return { type: 'error', reason: e };
|
|
22
23
|
}
|
|
23
24
|
}
|
|
24
|
-
exports.validateMessage = validateMessage;
|
|
25
25
|
function answerForValidationError(client, result, id) {
|
|
26
26
|
(0, send_1.sendMessage)(client, {
|
|
27
27
|
type: 'error',
|
|
@@ -30,5 +30,4 @@ function answerForValidationError(client, result, id) {
|
|
|
30
30
|
reason: `Invalid message format: ${result.reason.message}`
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
-
exports.answerForValidationError = answerForValidationError;
|
|
34
33
|
//# sourceMappingURL=validate.js.map
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { StdioProcessor } from './repl/execute';
|
|
2
|
+
import { scripts } from './common/scripts-info';
|
|
3
|
+
/**
|
|
4
|
+
* Path-safe helper of {@link waitOnScript} for other flowR scripts.
|
|
5
|
+
*
|
|
6
|
+
* @see waitOnScript
|
|
7
|
+
*/
|
|
8
|
+
export declare function runScript(name: keyof typeof scripts, args: readonly string[], io?: StdioProcessor, exitOnError?: boolean): Promise<void>;
|
|
@@ -0,0 +1,18 @@
|
|
|
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.runScript = runScript;
|
|
7
|
+
const execute_1 = require("./repl/execute");
|
|
8
|
+
const scripts_info_1 = require("./common/scripts-info");
|
|
9
|
+
const path_1 = __importDefault(require("path"));
|
|
10
|
+
/**
|
|
11
|
+
* Path-safe helper of {@link waitOnScript} for other flowR scripts.
|
|
12
|
+
*
|
|
13
|
+
* @see waitOnScript
|
|
14
|
+
*/
|
|
15
|
+
async function runScript(name, args, io, exitOnError = false) {
|
|
16
|
+
return (0, execute_1.waitOnScript)(path_1.default.resolve(__dirname, scripts_info_1.scripts[name].target), args, io, exitOnError);
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=run-script.js.map
|
|
@@ -0,0 +1,100 @@
|
|
|
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.flowrScriptGetStats = flowrScriptGetStats;
|
|
7
|
+
const path_1 = __importDefault(require("path"));
|
|
8
|
+
const parallel_1 = require("../../util/parallel");
|
|
9
|
+
const files_1 = require("../../util/files");
|
|
10
|
+
const features_1 = require("../common/features");
|
|
11
|
+
const fs_1 = __importDefault(require("fs"));
|
|
12
|
+
const statistics_file_1 = require("../../statistics/output/statistics-file");
|
|
13
|
+
const json_1 = require("../../util/json");
|
|
14
|
+
const log_1 = require("../../util/log");
|
|
15
|
+
const statistics_helper_core_1 = require("./statistics-helper-core");
|
|
16
|
+
const command_line_args_1 = __importDefault(require("command-line-args"));
|
|
17
|
+
const scripts_info_1 = require("../common/scripts-info");
|
|
18
|
+
const ansi_1 = require("../../util/ansi");
|
|
19
|
+
const testRegex = /[^/]*\/test/i;
|
|
20
|
+
const exampleRegex = /[^/]*\/example/i;
|
|
21
|
+
function getPrefixForFile(file) {
|
|
22
|
+
if (testRegex.test(file)) {
|
|
23
|
+
return 'test-';
|
|
24
|
+
}
|
|
25
|
+
else if (exampleRegex.test(file)) {
|
|
26
|
+
return 'example-';
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
return '';
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
function getSuffixForFile(base, file) {
|
|
33
|
+
const subpath = path_1.default.relative(base, file);
|
|
34
|
+
return '--' + subpath.replace(/\//g, '/');
|
|
35
|
+
}
|
|
36
|
+
async function collectFileArguments(options, verboseAdd, dumpJson, features) {
|
|
37
|
+
const files = [];
|
|
38
|
+
let counter = 0;
|
|
39
|
+
let presentSteps = 5000;
|
|
40
|
+
let skipped = 0;
|
|
41
|
+
for await (const f of (0, files_1.allRFilesFrom)(options.input)) {
|
|
42
|
+
const outputDir = path_1.default.join(options['output-dir'], `${getPrefixForFile(f.content)}${getSuffixForFile(options.input.length === 1 ? options.input[0] : '', f.content)}`);
|
|
43
|
+
const target = (0, features_1.retrieveArchiveName)(outputDir);
|
|
44
|
+
if (fs_1.default.existsSync(target)) {
|
|
45
|
+
console.log(`Archive ${target} exists. Skip.`);
|
|
46
|
+
skipped++;
|
|
47
|
+
continue;
|
|
48
|
+
}
|
|
49
|
+
files.push(['--input', f.content, '--output-dir', outputDir, '--compress', '--root-dir', options.input.length === 1 ? options.input[0] : '""', ...verboseAdd, ...features, ...dumpJson]);
|
|
50
|
+
if (++counter % presentSteps === 0) {
|
|
51
|
+
console.log(`Collected ${counter} files`);
|
|
52
|
+
if (counter >= 10 * presentSteps) {
|
|
53
|
+
presentSteps *= 5;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
console.log(`Total: ${counter} files (${skipped} skipped with archive existing)`);
|
|
58
|
+
return files;
|
|
59
|
+
}
|
|
60
|
+
async function flowrScriptGetStats(options) {
|
|
61
|
+
if (options.input.length === 0) {
|
|
62
|
+
console.error('No input files given. Nothing to do. See \'--help\' if this is an error.');
|
|
63
|
+
process.exit(0);
|
|
64
|
+
}
|
|
65
|
+
if (options['no-ansi']) {
|
|
66
|
+
log_1.log.info('disabling ansi colors');
|
|
67
|
+
(0, ansi_1.setFormatter)(ansi_1.voidFormatter);
|
|
68
|
+
}
|
|
69
|
+
const processedFeatures = (0, features_1.validateFeatures)(options.features);
|
|
70
|
+
(0, statistics_file_1.initFileProvider)(options['output-dir']);
|
|
71
|
+
console.log(`Processing features: ${JSON.stringify(processedFeatures, json_1.jsonReplacer)}`);
|
|
72
|
+
console.log(`Using ${options.parallel} parallel executors`);
|
|
73
|
+
const verboseAdd = options.verbose ? ['--verbose'] : [];
|
|
74
|
+
const features = [...processedFeatures].flatMap(s => ['--features', s]);
|
|
75
|
+
const dumpJson = options['dump-json'] ? ['--dump-json'] : [];
|
|
76
|
+
// we do not use the limit argument to be able to pick the limit randomly
|
|
77
|
+
const args = await collectFileArguments(options, verboseAdd, dumpJson, features);
|
|
78
|
+
if (options.limit) {
|
|
79
|
+
console.log('Shuffle...');
|
|
80
|
+
log_1.log.info(`limiting to ${options.limit} files`);
|
|
81
|
+
// shuffle and limit
|
|
82
|
+
args.sort(() => Math.random() - 0.5);
|
|
83
|
+
}
|
|
84
|
+
console.log('Prepare Pool...');
|
|
85
|
+
const limit = options.limit ?? args.length;
|
|
86
|
+
if (options.parallel > 0) {
|
|
87
|
+
const pool = new parallel_1.LimitedThreadPool(`${__dirname}/statistics-helper-app`, args, limit, options.parallel);
|
|
88
|
+
console.log('Run Pool...');
|
|
89
|
+
await pool.run();
|
|
90
|
+
const stats = pool.getStats();
|
|
91
|
+
console.log(`Processed ${stats.counter} files, skipped ${stats.skipped.length} files due to errors`);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
console.log('Run Sequentially as parallel <= 0...');
|
|
95
|
+
for (const arg of args) {
|
|
96
|
+
await (0, statistics_helper_core_1.getStatsForSingleFile)((0, command_line_args_1.default)(scripts_info_1.scripts['stats-helper'].options, { argv: arg }));
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=statistics-core.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
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.getStatsForSingleFile = getStatsForSingleFile;
|
|
7
|
+
const features_1 = require("../common/features");
|
|
8
|
+
const fs_1 = __importDefault(require("fs"));
|
|
9
|
+
const shell_1 = require("../../r-bridge/shell");
|
|
10
|
+
const statistics_file_1 = require("../../statistics/output/statistics-file");
|
|
11
|
+
const statistics_1 = require("../../statistics/statistics");
|
|
12
|
+
const cfg_1 = require("../../util/cfg/cfg");
|
|
13
|
+
const print_1 = require("../../core/print/print");
|
|
14
|
+
const _00_parse_1 = require("../../core/steps/all/core/00-parse");
|
|
15
|
+
const _10_normalize_1 = require("../../core/steps/all/core/10-normalize");
|
|
16
|
+
const _20_dataflow_1 = require("../../core/steps/all/core/20-dataflow");
|
|
17
|
+
const json_1 = require("../../util/json");
|
|
18
|
+
const log_1 = require("../../util/log");
|
|
19
|
+
const assert_1 = require("../../util/assert");
|
|
20
|
+
const time_1 = require("../../util/time");
|
|
21
|
+
const tar_1 = require("tar");
|
|
22
|
+
const ansi_1 = require("../../util/ansi");
|
|
23
|
+
function compressFolder(folder, target) {
|
|
24
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call,@typescript-eslint/no-unsafe-member-access
|
|
25
|
+
return (0, tar_1.create)({
|
|
26
|
+
gzip: true,
|
|
27
|
+
file: target,
|
|
28
|
+
portable: true,
|
|
29
|
+
preservePaths: false
|
|
30
|
+
}, [folder]).then(() => {
|
|
31
|
+
// now, remove the folder
|
|
32
|
+
fs_1.default.rmSync(folder, { recursive: true, force: true });
|
|
33
|
+
}, () => {
|
|
34
|
+
console.log(`failed to compress ${folder}`);
|
|
35
|
+
}).catch((e) => {
|
|
36
|
+
console.error('Error during compression:', e);
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
async function getStatsForSingleFile(options) {
|
|
40
|
+
if (options['no-ansi']) {
|
|
41
|
+
log_1.log.info('disabling ansi colors');
|
|
42
|
+
(0, ansi_1.setFormatter)(ansi_1.voidFormatter);
|
|
43
|
+
}
|
|
44
|
+
let target = undefined;
|
|
45
|
+
if (options.compress) {
|
|
46
|
+
target = (0, features_1.retrieveArchiveName)(options['output-dir']);
|
|
47
|
+
if (fs_1.default.existsSync(target)) {
|
|
48
|
+
console.log(`Archive ${target} exists. Skip.`);
|
|
49
|
+
process.exit(0);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
// assume correct
|
|
53
|
+
const processedFeatures = new Set(options.features);
|
|
54
|
+
const shell = new shell_1.RShell();
|
|
55
|
+
(0, statistics_file_1.initFileProvider)(options['output-dir']);
|
|
56
|
+
await shell.obtainTmpDir();
|
|
57
|
+
const stats = await (0, statistics_1.extractUsageStatistics)(shell, () => { }, processedFeatures, (0, statistics_1.staticRequests)({ request: 'file', content: options.input }), options['root-dir']);
|
|
58
|
+
// console.warn(`skipped ${stats.meta.failedRequests.length} requests due to errors (run with logs to get more info)`)
|
|
59
|
+
if (stats.outputs.size === 1) {
|
|
60
|
+
if (options['dump-json']) {
|
|
61
|
+
const [, output] = [...stats.outputs.entries()][0];
|
|
62
|
+
const cfg = (0, cfg_1.extractCFG)(output.normalize);
|
|
63
|
+
statistics_file_1.statisticsFileProvider.append('output-json', 'parse', await (0, print_1.printStepResult)(_00_parse_1.PARSE_WITH_R_SHELL_STEP, output.parse, 2 /* StepOutputFormat.Json */));
|
|
64
|
+
statistics_file_1.statisticsFileProvider.append('output-json', 'normalize', await (0, print_1.printStepResult)(_10_normalize_1.NORMALIZE, output.normalize, 2 /* StepOutputFormat.Json */));
|
|
65
|
+
statistics_file_1.statisticsFileProvider.append('output-json', 'dataflow', await (0, print_1.printStepResult)(_20_dataflow_1.STATIC_DATAFLOW, output.dataflow, 2 /* StepOutputFormat.Json */));
|
|
66
|
+
statistics_file_1.statisticsFileProvider.append('output-json', 'cfg', JSON.stringify(cfg, json_1.jsonReplacer));
|
|
67
|
+
}
|
|
68
|
+
statistics_file_1.statisticsFileProvider.append('meta', 'stats', JSON.stringify({ ...stats.meta, file: options.input }, json_1.jsonReplacer));
|
|
69
|
+
statistics_file_1.statisticsFileProvider.append('meta', 'features', JSON.stringify(stats.features, json_1.jsonReplacer));
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
log_1.log.error(`expected exactly one output vs. ${stats.outputs.size}, got: ${JSON.stringify([...stats.outputs.keys()], json_1.jsonReplacer, 2)}`);
|
|
73
|
+
}
|
|
74
|
+
if (options.compress) {
|
|
75
|
+
(0, assert_1.guard)(target !== undefined, 'target must be defined given the compress option');
|
|
76
|
+
console.log(`[${(0, time_1.date2string)(new Date())}] Compressing ${options['output-dir']} to ${target}`);
|
|
77
|
+
await compressFolder(options['output-dir'], target);
|
|
78
|
+
}
|
|
79
|
+
shell.close();
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=statistics-helper-core.js.map
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.flowrScriptSummarizer = flowrScriptSummarizer;
|
|
4
|
+
const summarizer_1 = require("../../statistics/summarizer/summarizer");
|
|
5
|
+
const summarizer_2 = require("../../benchmark/summarizer/summarizer");
|
|
6
|
+
const auto_detect_1 = require("../../statistics/summarizer/auto-detect");
|
|
7
|
+
const feature_1 = require("../../statistics/features/feature");
|
|
8
|
+
function getBenchmarkSummarizer(options, outputBase) {
|
|
9
|
+
return new summarizer_2.BenchmarkSummarizer({
|
|
10
|
+
graphOutputPath: options.graph ? `${outputBase}-graph.json` : undefined,
|
|
11
|
+
inputPath: options.input,
|
|
12
|
+
intermediateOutputPath: outputBase,
|
|
13
|
+
outputPath: `${outputBase}-ultimate.json`,
|
|
14
|
+
logger: console.log
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
function getStatisticsSummarizer(options, outputBase) {
|
|
18
|
+
return new summarizer_1.StatisticsSummarizer({
|
|
19
|
+
inputPath: options.input,
|
|
20
|
+
outputPath: `${outputBase}-final`,
|
|
21
|
+
intermediateOutputPath: `${outputBase}-intermediate/`,
|
|
22
|
+
projectSkip: options['project-skip'],
|
|
23
|
+
featuresToUse: feature_1.allFeatureNames,
|
|
24
|
+
logger: console.log
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
async function retrieveSummarizer(options, outputBase) {
|
|
28
|
+
const type = options.type === 'auto' ? await (0, auto_detect_1.detectSummarizationType)(options.input) : options.type;
|
|
29
|
+
if (type === "benchmark" /* SummarizerType.Benchmark */) {
|
|
30
|
+
console.log('Summarizing benchmark');
|
|
31
|
+
return getBenchmarkSummarizer(options, outputBase);
|
|
32
|
+
}
|
|
33
|
+
else if (type === "statistics" /* SummarizerType.Statistics */) {
|
|
34
|
+
console.log('Summarizing statistics');
|
|
35
|
+
return getStatisticsSummarizer(options, outputBase);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
console.error('Unknown type', type, 'either give "benchmark" or "statistics"');
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async function flowrScriptSummarizer(options) {
|
|
43
|
+
const outputBase = (options.output ?? options.input).replace(/\.json$|\/$/, '-summary');
|
|
44
|
+
console.log(`Writing outputs to base ${outputBase}`);
|
|
45
|
+
const summarizer = await retrieveSummarizer(options, outputBase);
|
|
46
|
+
if (!options['ultimate-only']) {
|
|
47
|
+
await summarizer.preparationPhase(options.categorize);
|
|
48
|
+
}
|
|
49
|
+
await summarizer.summarizePhase();
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=summarizer-core.js.map
|