@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/benchmark/slicer.js
CHANGED
|
@@ -18,6 +18,7 @@ const shell_1 = require("../r-bridge/shell");
|
|
|
18
18
|
const default_pipelines_1 = require("../core/steps/pipeline/default-pipelines");
|
|
19
19
|
const retriever_1 = require("../r-bridge/retriever");
|
|
20
20
|
const collect_all_1 = require("../slicing/criterion/collect-all");
|
|
21
|
+
const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
|
|
21
22
|
const visitor_1 = require("../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
22
23
|
const size_of_1 = require("./stats/size-of");
|
|
23
24
|
/**
|
|
@@ -97,7 +98,7 @@ class BenchmarkSlicer {
|
|
|
97
98
|
let commentCharsNoWhitespace = 0;
|
|
98
99
|
(0, visitor_1.visitAst)(this.normalizedAst.ast, t => {
|
|
99
100
|
nodes++;
|
|
100
|
-
const comments = t.info.additionalTokens?.filter(t => t.type ===
|
|
101
|
+
const comments = t.info.additionalTokens?.filter(t => t.type === type_1.RType.Comment);
|
|
101
102
|
if (comments && comments.length > 0) {
|
|
102
103
|
const content = comments.map(c => c.lexeme ?? '').join('');
|
|
103
104
|
commentChars += content.length;
|
package/benchmark/stats/print.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.formatNanoseconds = formatNanoseconds;
|
|
4
|
+
exports.stats2string = stats2string;
|
|
5
|
+
exports.ultimateStats2String = ultimateStats2String;
|
|
4
6
|
const assert_1 = require("../../util/assert");
|
|
5
7
|
const padSize = 15;
|
|
6
8
|
function pad(string) {
|
|
@@ -26,7 +28,6 @@ function formatNanoseconds(nanoseconds) {
|
|
|
26
28
|
return pad(`${millis}:${String(nanos).padStart(6, '0')}ms`);
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
|
-
exports.formatNanoseconds = formatNanoseconds;
|
|
30
31
|
function print(measurements, key) {
|
|
31
32
|
const time = measurements.get(key);
|
|
32
33
|
(0, assert_1.guard)(time !== undefined, `Measurement for ${JSON.stringify(key)} not found`);
|
|
@@ -145,7 +146,6 @@ Dataflow:
|
|
|
145
146
|
Number of function defs: ${pad(stats.dataflow.numberOfFunctionDefinitions)}
|
|
146
147
|
Size of graph: ${convertNumberToNiceBytes(stats.dataflow.sizeOfObject)}`;
|
|
147
148
|
}
|
|
148
|
-
exports.stats2string = stats2string;
|
|
149
149
|
function ultimateStats2String(stats) {
|
|
150
150
|
const slice = stats.totalSlices > 0 ? `Slice summary for:
|
|
151
151
|
Total: ${formatSummarizedTimeMeasure(stats.perSliceMeasurements.get('total'))}
|
|
@@ -202,7 +202,6 @@ Dataflow:
|
|
|
202
202
|
Size of graph: ${formatSummarizedMeasure(stats.dataflow.sizeOfObject, convertNumberToNiceBytes)}
|
|
203
203
|
`;
|
|
204
204
|
}
|
|
205
|
-
exports.ultimateStats2String = ultimateStats2String;
|
|
206
205
|
function reduction2String(title, reduction) {
|
|
207
206
|
return `
|
|
208
207
|
${title} (reduced by x%):
|
|
@@ -3,9 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.getSizeOfDfGraph =
|
|
6
|
+
exports.getSizeOfDfGraph = getSizeOfDfGraph;
|
|
7
7
|
const environment_1 = require("../../dataflow/environments/environment");
|
|
8
|
+
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
9
|
+
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
8
10
|
const object_sizeof_1 = __importDefault(require("object-sizeof"));
|
|
11
|
+
const objects_1 = require("../../util/objects");
|
|
9
12
|
/* we have to kill all processors linked in the default environment as they cannot be serialized and they are shared anyway */
|
|
10
13
|
function killBuiltInEnv(env) {
|
|
11
14
|
if (env === undefined) {
|
|
@@ -21,7 +24,7 @@ function killBuiltInEnv(env) {
|
|
|
21
24
|
}
|
|
22
25
|
const memory = new Map();
|
|
23
26
|
for (const [k, v] of env.memory) {
|
|
24
|
-
memory.set(k, v.filter(v =>
|
|
27
|
+
memory.set(k, v.filter(v => v.type !== identifier_1.ReferenceType.BuiltInFunction && v.type !== identifier_1.ReferenceType.BuiltInConstant && !('processor' in v)));
|
|
25
28
|
}
|
|
26
29
|
return {
|
|
27
30
|
id: env.id,
|
|
@@ -43,7 +46,7 @@ function getSizeOfDfGraph(df) {
|
|
|
43
46
|
}
|
|
44
47
|
};
|
|
45
48
|
}
|
|
46
|
-
if (vertex.tag ===
|
|
49
|
+
if (vertex.tag === vertex_1.VertexType.FunctionDefinition) {
|
|
47
50
|
vertex = {
|
|
48
51
|
...vertex,
|
|
49
52
|
subflow: {
|
|
@@ -55,14 +58,13 @@ function getSizeOfDfGraph(df) {
|
|
|
55
58
|
}
|
|
56
59
|
};
|
|
57
60
|
}
|
|
58
|
-
vertex = {
|
|
61
|
+
vertex = (0, objects_1.compactRecord)({
|
|
59
62
|
...vertex,
|
|
60
63
|
/* shared anyway by using constants */
|
|
61
|
-
tag:
|
|
62
|
-
};
|
|
64
|
+
tag: undefined
|
|
65
|
+
});
|
|
63
66
|
verts.push(vertex);
|
|
64
67
|
}
|
|
65
68
|
return (0, object_sizeof_1.default)([...verts, ...df.edges()]);
|
|
66
69
|
}
|
|
67
|
-
exports.getSizeOfDfGraph = getSizeOfDfGraph;
|
|
68
70
|
//# sourceMappingURL=size-of.js.map
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
export declare function processRunMeasurement(line: Buffer, fileNum: number, lineNum: number, textOutputAppendPath: string, rawOutputPath: string): Promise<void>;
|
|
3
2
|
export declare function processSummarizedRunMeasurement(runNum: number, summarizedFiles: string[], appendPath: string): void;
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.processRunMeasurement = processRunMeasurement;
|
|
7
|
+
exports.processSummarizedRunMeasurement = processSummarizedRunMeasurement;
|
|
7
8
|
const fs_1 = __importDefault(require("fs"));
|
|
8
9
|
const process_1 = require("../second-phase/process");
|
|
9
10
|
const process_2 = require("./process");
|
|
@@ -49,7 +50,6 @@ async function processRunMeasurement(line, fileNum, lineNum, textOutputAppendPat
|
|
|
49
50
|
console.log(` - Append textual summary to ${textOutputAppendPath}`);
|
|
50
51
|
fs_1.default.appendFileSync(textOutputAppendPath, `${(0, print_1.stats2string)(summarized)}\n`);
|
|
51
52
|
}
|
|
52
|
-
exports.processRunMeasurement = processRunMeasurement;
|
|
53
53
|
function processSummarizedRunMeasurement(runNum, summarizedFiles, appendPath) {
|
|
54
54
|
console.log(`Summarizing all file statistics for run ${runNum}`);
|
|
55
55
|
const summaries = [];
|
|
@@ -59,7 +59,6 @@ function processSummarizedRunMeasurement(runNum, summarizedFiles, appendPath) {
|
|
|
59
59
|
fs_1.default.appendFileSync(appendPath, `${JSON.stringify((0, process_1.summarizeAllSummarizedStats)(summaries), json_1.jsonReplacer)}\n`);
|
|
60
60
|
console.log(`Appended summary of run ${runNum} to ${appendPath}`);
|
|
61
61
|
}
|
|
62
|
-
exports.processSummarizedRunMeasurement = processSummarizedRunMeasurement;
|
|
63
62
|
function mapPerSliceStats(k, v) {
|
|
64
63
|
return [k, {
|
|
65
64
|
reconstructedCode: v.reconstructedCode,
|
|
@@ -26,7 +26,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
26
26
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.
|
|
29
|
+
exports.summarizeSlicerStats = summarizeSlicerStats;
|
|
30
|
+
exports.summarizeSummarizedMeasurement = summarizeSummarizedMeasurement;
|
|
31
|
+
exports.summarizeSummarizedReductions = summarizeSummarizedReductions;
|
|
32
|
+
exports.summarizeSummarizedTimePerToken = summarizeSummarizedTimePerToken;
|
|
33
|
+
exports.summarizeTimePerToken = summarizeTimePerToken;
|
|
30
34
|
const tmp = __importStar(require("tmp"));
|
|
31
35
|
const fs_1 = __importDefault(require("fs"));
|
|
32
36
|
const defaultmap_1 = require("../../../util/defaultmap");
|
|
@@ -37,6 +41,7 @@ const assert_1 = require("../../../util/assert");
|
|
|
37
41
|
const shell_1 = require("../../../r-bridge/shell");
|
|
38
42
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
39
43
|
const visitor_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
44
|
+
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
40
45
|
const tempfile = (() => {
|
|
41
46
|
let _tempfile = undefined;
|
|
42
47
|
return () => {
|
|
@@ -144,7 +149,7 @@ async function summarizeSlicerStats(stats, report = () => {
|
|
|
144
149
|
let commentCharsNoWhitespace = 0;
|
|
145
150
|
(0, visitor_1.visitAst)(reParsed.ast, t => {
|
|
146
151
|
numberOfNormalizedTokens++;
|
|
147
|
-
const comments = t.info.additionalTokens?.filter(t => t.type ===
|
|
152
|
+
const comments = t.info.additionalTokens?.filter(t => t.type === type_1.RType.Comment);
|
|
148
153
|
if (comments && comments.length > 0) {
|
|
149
154
|
const content = comments.map(c => c.lexeme ?? '').join('');
|
|
150
155
|
commentChars += content.length;
|
|
@@ -237,7 +242,6 @@ async function summarizeSlicerStats(stats, report = () => {
|
|
|
237
242
|
}
|
|
238
243
|
};
|
|
239
244
|
}
|
|
240
|
-
exports.summarizeSlicerStats = summarizeSlicerStats;
|
|
241
245
|
function summarizeSummarizedMeasurement(data) {
|
|
242
246
|
data = data.filter(assert_1.isNotUndefined);
|
|
243
247
|
const min = data.map(d => d.min).filter(assert_1.isNotUndefined).reduce((a, b) => Math.min(a, b), Infinity);
|
|
@@ -251,7 +255,6 @@ function summarizeSummarizedMeasurement(data) {
|
|
|
251
255
|
const total = data.map(d => d.total).filter(assert_1.isNotUndefined).reduce((a, b) => a + b, 0);
|
|
252
256
|
return { min, max, median, mean, std, total };
|
|
253
257
|
}
|
|
254
|
-
exports.summarizeSummarizedMeasurement = summarizeSummarizedMeasurement;
|
|
255
258
|
function summarizeSummarizedReductions(reductions) {
|
|
256
259
|
return {
|
|
257
260
|
numberOfDataflowNodes: summarizeSummarizedMeasurement(reductions.map(r => r.numberOfDataflowNodes)),
|
|
@@ -263,7 +266,6 @@ function summarizeSummarizedReductions(reductions) {
|
|
|
263
266
|
numberOfRTokens: summarizeSummarizedMeasurement(reductions.map(r => r.numberOfRTokens))
|
|
264
267
|
};
|
|
265
268
|
}
|
|
266
|
-
exports.summarizeSummarizedReductions = summarizeSummarizedReductions;
|
|
267
269
|
function summarizeReductions(reductions) {
|
|
268
270
|
return {
|
|
269
271
|
numberOfLines: (0, summarizer_1.summarizeMeasurement)(reductions.map(r => r.numberOfLines).filter(assert_1.isNotUndefined)),
|
|
@@ -281,12 +283,10 @@ function summarizeSummarizedTimePerToken(times) {
|
|
|
281
283
|
normalized: summarizeSummarizedMeasurement(times.map(t => t.normalized)),
|
|
282
284
|
};
|
|
283
285
|
}
|
|
284
|
-
exports.summarizeSummarizedTimePerToken = summarizeSummarizedTimePerToken;
|
|
285
286
|
function summarizeTimePerToken(times) {
|
|
286
287
|
return {
|
|
287
288
|
raw: (0, summarizer_1.summarizeMeasurement)(times.map(t => t.raw)),
|
|
288
289
|
normalized: (0, summarizer_1.summarizeMeasurement)(times.map(t => t.normalized)),
|
|
289
290
|
};
|
|
290
291
|
}
|
|
291
|
-
exports.summarizeTimePerToken = summarizeTimePerToken;
|
|
292
292
|
//# sourceMappingURL=process.js.map
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.writeGraphOutput =
|
|
6
|
+
exports.writeGraphOutput = writeGraphOutput;
|
|
7
7
|
const fs_1 = __importDefault(require("fs"));
|
|
8
8
|
const json_1 = require("../../../util/json");
|
|
9
9
|
function writeGraphOutput(ultimate, outputGraphPath) {
|
|
@@ -57,5 +57,4 @@ function writeGraphOutput(ultimate, outputGraphPath) {
|
|
|
57
57
|
// write the output file
|
|
58
58
|
fs_1.default.writeFileSync(outputGraphPath, JSON.stringify(data, json_1.jsonReplacer));
|
|
59
59
|
}
|
|
60
|
-
exports.writeGraphOutput = writeGraphOutput;
|
|
61
60
|
//# sourceMappingURL=graph.js.map
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import type { SummarizedSlicerStats, UltimateSlicerStats } from '../data';
|
|
3
2
|
export declare function summarizeAllSummarizedStats(stats: SummarizedSlicerStats[]): UltimateSlicerStats;
|
|
4
3
|
export declare function summarizeAllUltimateStats(stats: UltimateSlicerStats[]): UltimateSlicerStats;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.summarizeAllSummarizedStats = summarizeAllSummarizedStats;
|
|
4
|
+
exports.summarizeAllUltimateStats = summarizeAllUltimateStats;
|
|
5
|
+
exports.processNextSummary = processNextSummary;
|
|
6
|
+
exports.processNextUltimateSummary = processNextUltimateSummary;
|
|
4
7
|
const process_1 = require("../first-phase/process");
|
|
5
8
|
const defaultmap_1 = require("../../../util/defaultmap");
|
|
6
9
|
const summarizer_1 = require("../../../util/summarizer");
|
|
@@ -86,7 +89,6 @@ function summarizeAllSummarizedStats(stats) {
|
|
|
86
89
|
}
|
|
87
90
|
};
|
|
88
91
|
}
|
|
89
|
-
exports.summarizeAllSummarizedStats = summarizeAllSummarizedStats;
|
|
90
92
|
function summarizeAllUltimateStats(stats) {
|
|
91
93
|
return {
|
|
92
94
|
// these should be deterministic, so we don't technically need to use max, but we do just in case something unexpected happens :)
|
|
@@ -127,7 +129,6 @@ function summarizeAllUltimateStats(stats) {
|
|
|
127
129
|
}
|
|
128
130
|
};
|
|
129
131
|
}
|
|
130
|
-
exports.summarizeAllUltimateStats = summarizeAllUltimateStats;
|
|
131
132
|
function processNextSummary(line, allSummarized) {
|
|
132
133
|
let got = JSON.parse(line.toString());
|
|
133
134
|
got = {
|
|
@@ -150,7 +151,6 @@ function processNextSummary(line, allSummarized) {
|
|
|
150
151
|
};
|
|
151
152
|
allSummarized.push(got.summarize);
|
|
152
153
|
}
|
|
153
|
-
exports.processNextSummary = processNextSummary;
|
|
154
154
|
function processNextUltimateSummary(line, allSummarized) {
|
|
155
155
|
let got = JSON.parse(line.toString());
|
|
156
156
|
got = {
|
|
@@ -161,5 +161,4 @@ function processNextUltimateSummary(line, allSummarized) {
|
|
|
161
161
|
};
|
|
162
162
|
allSummarized.push(got);
|
|
163
163
|
}
|
|
164
|
-
exports.processNextUltimateSummary = processNextUltimateSummary;
|
|
165
164
|
//# sourceMappingURL=process.js.map
|
|
@@ -14,6 +14,7 @@ const files_1 = require("../../util/files");
|
|
|
14
14
|
const json_1 = require("../../util/json");
|
|
15
15
|
const print_1 = require("../stats/print");
|
|
16
16
|
const defaultmap_1 = require("../../util/defaultmap");
|
|
17
|
+
const log_1 = require("../../util/log");
|
|
17
18
|
class BenchmarkSummarizer extends summarizer_1.Summarizer {
|
|
18
19
|
constructor(config) {
|
|
19
20
|
super(config);
|
|
@@ -61,7 +62,12 @@ class BenchmarkSummarizer extends summarizer_1.Summarizer {
|
|
|
61
62
|
removeIfExists(path) {
|
|
62
63
|
if (path && fs_1.default.existsSync(path)) {
|
|
63
64
|
this.log(`Removing existing ${path}`);
|
|
64
|
-
|
|
65
|
+
try {
|
|
66
|
+
fs_1.default.rmSync(path, { recursive: true });
|
|
67
|
+
}
|
|
68
|
+
catch (e) {
|
|
69
|
+
log_1.log.error('failure in cleanup');
|
|
70
|
+
}
|
|
65
71
|
}
|
|
66
72
|
}
|
|
67
73
|
summaryFile() {
|
package/cli/benchmark-app.js
CHANGED
|
@@ -27,7 +27,12 @@ const numberRegex = /^\d+$/;
|
|
|
27
27
|
function removeIfExists(summarizedRaw) {
|
|
28
28
|
if (fs_1.default.existsSync(summarizedRaw)) {
|
|
29
29
|
console.log(`Removing existing ${summarizedRaw}`);
|
|
30
|
-
|
|
30
|
+
try {
|
|
31
|
+
fs_1.default.rmSync(summarizedRaw, { recursive: true });
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
log_1.log.error('failure in cleanup');
|
|
35
|
+
}
|
|
31
36
|
}
|
|
32
37
|
}
|
|
33
38
|
async function benchmark() {
|
package/cli/common/features.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.validateFeatures = validateFeatures;
|
|
7
|
+
exports.retrieveArchiveName = retrieveArchiveName;
|
|
7
8
|
const path_1 = __importDefault(require("path"));
|
|
8
9
|
const feature_1 = require("../../statistics/features/feature");
|
|
9
10
|
function validateFeatures(features) {
|
|
@@ -21,10 +22,8 @@ function validateFeatures(features) {
|
|
|
21
22
|
}
|
|
22
23
|
return features[0] === 'all' ? feature_1.allFeatureNames : new Set(features);
|
|
23
24
|
}
|
|
24
|
-
exports.validateFeatures = validateFeatures;
|
|
25
25
|
function retrieveArchiveName(p) {
|
|
26
26
|
const basepath = path_1.default.normalize(p);
|
|
27
27
|
return `${basepath.endsWith(path_1.default.sep) ? basepath.substring(0, basepath.length - 1) : basepath}.tar.gz`;
|
|
28
28
|
}
|
|
29
|
-
exports.retrieveArchiveName = retrieveArchiveName;
|
|
30
29
|
//# sourceMappingURL=features.js.map
|
package/cli/common/script.js
CHANGED
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.helpForOptions = helpForOptions;
|
|
7
|
+
exports.processCommandLineArgs = processCommandLineArgs;
|
|
7
8
|
/**
|
|
8
9
|
* The goal of this module is simply to streamline the creation of new scripts.
|
|
9
10
|
*
|
|
@@ -34,7 +35,6 @@ function helpForOptions(script, content) {
|
|
|
34
35
|
}
|
|
35
36
|
]);
|
|
36
37
|
}
|
|
37
|
-
exports.helpForOptions = helpForOptions;
|
|
38
38
|
function processCommandLineArgs(script, requireAdditionally, help) {
|
|
39
39
|
const options = (0, command_line_args_1.default)(scripts_info_1.scripts[script].options);
|
|
40
40
|
if (options.help) {
|
|
@@ -57,5 +57,4 @@ function processCommandLineArgs(script, requireAdditionally, help) {
|
|
|
57
57
|
}
|
|
58
58
|
return options;
|
|
59
59
|
}
|
|
60
|
-
exports.processCommandLineArgs = processCommandLineArgs;
|
|
61
60
|
//# sourceMappingURL=script.js.map
|
|
@@ -6,10 +6,15 @@
|
|
|
6
6
|
import type { OptionDefinition } from 'command-line-usage';
|
|
7
7
|
import type { MergeableRecord } from '../../util/objects';
|
|
8
8
|
interface BaseScriptInformation extends MergeableRecord {
|
|
9
|
+
/** name of the tool to present to the user */
|
|
9
10
|
toolName: string;
|
|
11
|
+
/** internal module name to fork/execute, make sure to use the correct path to it with the help of `__dirname` */
|
|
10
12
|
target: string;
|
|
13
|
+
/** description of the tool for the user */
|
|
11
14
|
description: string;
|
|
15
|
+
/** example usage */
|
|
12
16
|
usageExample: string;
|
|
17
|
+
/** command line options that are available */
|
|
13
18
|
options: OptionDefinition[];
|
|
14
19
|
}
|
|
15
20
|
export interface MasterScriptInformation extends BaseScriptInformation {
|
|
@@ -20,6 +25,69 @@ export interface HelperScriptInformation extends BaseScriptInformation {
|
|
|
20
25
|
masterScripts: string[];
|
|
21
26
|
}
|
|
22
27
|
export type ScriptInformation = MasterScriptInformation | HelperScriptInformation;
|
|
23
|
-
|
|
28
|
+
/**
|
|
29
|
+
* We hold `_scripts` internally, as the modifiable variant and export the readonly scripts
|
|
30
|
+
*/
|
|
31
|
+
declare const _scripts: {
|
|
32
|
+
slicer: {
|
|
33
|
+
toolName: string;
|
|
34
|
+
target: string;
|
|
35
|
+
description: string;
|
|
36
|
+
options: OptionDefinition[];
|
|
37
|
+
usageExample: string;
|
|
38
|
+
type: string;
|
|
39
|
+
};
|
|
40
|
+
benchmark: {
|
|
41
|
+
toolName: string;
|
|
42
|
+
target: string;
|
|
43
|
+
description: string;
|
|
44
|
+
type: string;
|
|
45
|
+
usageExample: string;
|
|
46
|
+
options: OptionDefinition[];
|
|
47
|
+
};
|
|
48
|
+
'benchmark-helper': {
|
|
49
|
+
toolName: string;
|
|
50
|
+
target: string;
|
|
51
|
+
description: string;
|
|
52
|
+
usageExample: string;
|
|
53
|
+
options: OptionDefinition[];
|
|
54
|
+
type: string;
|
|
55
|
+
masterScripts: string[];
|
|
56
|
+
};
|
|
57
|
+
summarizer: {
|
|
58
|
+
toolName: string;
|
|
59
|
+
target: string;
|
|
60
|
+
description: string;
|
|
61
|
+
options: OptionDefinition[];
|
|
62
|
+
usageExample: string;
|
|
63
|
+
type: string;
|
|
64
|
+
};
|
|
65
|
+
'export-quads': {
|
|
66
|
+
toolName: string;
|
|
67
|
+
target: string;
|
|
68
|
+
description: string;
|
|
69
|
+
usageExample: string;
|
|
70
|
+
options: OptionDefinition[];
|
|
71
|
+
type: string;
|
|
72
|
+
};
|
|
73
|
+
stats: {
|
|
74
|
+
toolName: string;
|
|
75
|
+
target: string;
|
|
76
|
+
description: string;
|
|
77
|
+
options: OptionDefinition[];
|
|
78
|
+
usageExample: string;
|
|
79
|
+
type: string;
|
|
80
|
+
};
|
|
81
|
+
'stats-helper': {
|
|
82
|
+
toolName: string;
|
|
83
|
+
target: string;
|
|
84
|
+
description: string;
|
|
85
|
+
options: OptionDefinition[];
|
|
86
|
+
usageExample: string;
|
|
87
|
+
type: string;
|
|
88
|
+
masterScripts: string[];
|
|
89
|
+
};
|
|
90
|
+
};
|
|
91
|
+
export declare const scripts: Record<keyof typeof _scripts, ScriptInformation>;
|
|
24
92
|
export declare function getValidOptionsForCompletion(options: readonly OptionDefinition[], prevArgs: readonly string[]): string[];
|
|
25
93
|
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.scripts = void 0;
|
|
4
|
+
exports.getValidOptionsForCompletion = getValidOptionsForCompletion;
|
|
4
5
|
const options_1 = require("./options");
|
|
5
|
-
const
|
|
6
|
+
const repl_commands_1 = require("../repl/commands/repl-commands");
|
|
6
7
|
/**
|
|
7
8
|
* We hold `_scripts` internally, as the modifiable variant and export the readonly scripts
|
|
8
9
|
*/
|
|
@@ -69,15 +70,14 @@ const _scripts = {
|
|
|
69
70
|
exports.scripts = _scripts;
|
|
70
71
|
function getValidOptionsForCompletion(options, prevArgs) {
|
|
71
72
|
return options.filter(o => canAddOption(o, prevArgs)).flatMap(o => {
|
|
72
|
-
const args = [(0,
|
|
73
|
+
const args = [(0, repl_commands_1.asOptionName)(o.name)];
|
|
73
74
|
if (o.alias) {
|
|
74
|
-
args.push((0,
|
|
75
|
+
args.push((0, repl_commands_1.asOptionName)(o.alias));
|
|
75
76
|
}
|
|
76
77
|
return args;
|
|
77
78
|
});
|
|
78
79
|
}
|
|
79
|
-
exports.getValidOptionsForCompletion = getValidOptionsForCompletion;
|
|
80
80
|
function canAddOption(option, prevArgs) {
|
|
81
|
-
return option.multiple || !prevArgs.includes((0,
|
|
81
|
+
return option.multiple || !prevArgs.includes((0, repl_commands_1.asOptionName)(option.name)) && (!option.alias || !prevArgs.includes((0, repl_commands_1.asOptionName)(option.alias)));
|
|
82
82
|
}
|
|
83
83
|
//# sourceMappingURL=scripts-info.js.map
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defaultConfigFile = exports.flowrMainOptionDefinitions = void 0;
|
|
4
|
+
exports.getScriptsText = getScriptsText;
|
|
5
|
+
const scripts_info_1 = require("./common/scripts-info");
|
|
6
|
+
let _scriptsText;
|
|
7
|
+
function getScriptsText() {
|
|
8
|
+
if (_scriptsText === undefined) {
|
|
9
|
+
_scriptsText = Array.from(Object.entries(scripts_info_1.scripts).filter(([, { type }]) => type === 'master script'), ([k]) => k).join(', ');
|
|
10
|
+
}
|
|
11
|
+
return _scriptsText;
|
|
12
|
+
}
|
|
13
|
+
exports.flowrMainOptionDefinitions = [
|
|
14
|
+
{ name: 'config-file', type: String, description: 'The name of the configuration file to use', multiple: false },
|
|
15
|
+
{
|
|
16
|
+
name: 'config-json',
|
|
17
|
+
type: String,
|
|
18
|
+
description: 'The flowR configuration to use, as a JSON string',
|
|
19
|
+
multiple: false
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
name: 'execute',
|
|
23
|
+
alias: 'e',
|
|
24
|
+
type: String,
|
|
25
|
+
description: 'Execute the given command and exit. Use a semicolon ";" to separate multiple commands.',
|
|
26
|
+
typeLabel: '{underline command}',
|
|
27
|
+
multiple: false
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
name: 'help',
|
|
31
|
+
alias: 'h',
|
|
32
|
+
type: Boolean,
|
|
33
|
+
description: 'Print this usage guide (or the guide of the corresponding script)'
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
name: 'no-ansi',
|
|
37
|
+
type: Boolean,
|
|
38
|
+
description: 'Disable ansi-escape-sequences in the output. Useful, if you want to redirect the output to a file.'
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
name: 'port',
|
|
42
|
+
type: Number,
|
|
43
|
+
description: 'The port to listen on, if --server is given.',
|
|
44
|
+
defaultValue: 1042,
|
|
45
|
+
typeLabel: '{underline port}'
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'r-path',
|
|
49
|
+
type: String,
|
|
50
|
+
description: 'The path to the R executable to use. Defaults to your PATH.',
|
|
51
|
+
multiple: false
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
name: 'r-session-access',
|
|
55
|
+
type: Boolean,
|
|
56
|
+
description: 'Allow to access the underlying R session when using flowR (security warning: this allows the execution of arbitrary R code!)'
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'script',
|
|
60
|
+
alias: 's',
|
|
61
|
+
type: String,
|
|
62
|
+
description: `The sub-script to run (${getScriptsText()})`,
|
|
63
|
+
multiple: false,
|
|
64
|
+
defaultOption: true,
|
|
65
|
+
typeLabel: '{underline files}',
|
|
66
|
+
defaultValue: undefined
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
name: 'server',
|
|
70
|
+
type: Boolean,
|
|
71
|
+
description: 'Do not drop into a repl, but instead start a server on the given port (default: 1042) and listen for messages.'
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
name: 'verbose',
|
|
75
|
+
alias: 'v',
|
|
76
|
+
type: Boolean,
|
|
77
|
+
description: 'Run with verbose logging (will be passed to the corresponding script)'
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: 'version',
|
|
81
|
+
alias: 'V',
|
|
82
|
+
type: Boolean,
|
|
83
|
+
description: 'Provide information about the version of flowR as well as its underlying R system and exit.'
|
|
84
|
+
},
|
|
85
|
+
{ name: 'ws', type: Boolean, description: 'If the server flag is set, use websocket for messaging' }
|
|
86
|
+
];
|
|
87
|
+
exports.defaultConfigFile = 'flowr.json';
|
|
88
|
+
//# sourceMappingURL=flowr-main-options.js.map
|
package/cli/flowr.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import
|
|
1
|
+
import commandLineUsage from 'command-line-usage';
|
|
2
2
|
export declare const toolName = "flowr";
|
|
3
|
-
export declare const optionDefinitions: OptionDefinition[];
|
|
4
3
|
export interface FlowrCliOptions {
|
|
5
4
|
'config-file': string;
|
|
5
|
+
'config-json': string;
|
|
6
6
|
'no-ansi': boolean;
|
|
7
7
|
'r-path': string | undefined;
|
|
8
8
|
'r-session-access': boolean;
|
|
@@ -25,6 +25,6 @@ export declare const optionHelp: ({
|
|
|
25
25
|
optionList?: undefined;
|
|
26
26
|
} | {
|
|
27
27
|
header: string;
|
|
28
|
-
optionList: OptionDefinition[];
|
|
28
|
+
optionList: commandLineUsage.OptionDefinition[];
|
|
29
29
|
content?: undefined;
|
|
30
30
|
})[];
|