@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,6 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.splitComments = splitComments;
|
|
4
|
+
exports.normalizeExpressions = normalizeExpressions;
|
|
5
|
+
exports.parseNodesWithUnknownType = parseNodesWithUnknownType;
|
|
4
6
|
const normalize_single_node_1 = require("./normalize-single-node");
|
|
5
7
|
const parser_1 = require("../../../json/parser");
|
|
6
8
|
const normalize_meta_1 = require("../../normalize-meta");
|
|
@@ -15,6 +17,7 @@ const normalize_symbol_1 = require("../values/normalize-symbol");
|
|
|
15
17
|
const normalize_if_then_1 = require("../control/normalize-if-then");
|
|
16
18
|
const normalize_while_1 = require("../loops/normalize-while");
|
|
17
19
|
const normalize_if_then_else_1 = require("../control/normalize-if-then-else");
|
|
20
|
+
const type_1 = require("../../../../model/type");
|
|
18
21
|
const normalize_comment_1 = require("../other/normalize-comment");
|
|
19
22
|
function normalizeMappedWithoutSemicolonBasedOnType(mappedWithName, data) {
|
|
20
23
|
let result = undefined;
|
|
@@ -46,7 +49,7 @@ function splitComments(tokens) {
|
|
|
46
49
|
const comments = [];
|
|
47
50
|
const others = [];
|
|
48
51
|
for (const elem of tokens) {
|
|
49
|
-
if (elem.name ===
|
|
52
|
+
if (elem.name === type_1.RawRType.Comment) {
|
|
50
53
|
comments.push(elem);
|
|
51
54
|
}
|
|
52
55
|
else {
|
|
@@ -55,19 +58,18 @@ function splitComments(tokens) {
|
|
|
55
58
|
}
|
|
56
59
|
return { comments, others };
|
|
57
60
|
}
|
|
58
|
-
exports.splitComments = splitComments;
|
|
59
61
|
function splitExprs(tokens) {
|
|
60
62
|
let last = 0, i = 0;
|
|
61
63
|
let lastExpr = false;
|
|
62
64
|
const segments = [];
|
|
63
65
|
for (const token of tokens) {
|
|
64
|
-
if (token.name ===
|
|
66
|
+
if (token.name === type_1.RawRType.Semicolon) {
|
|
65
67
|
segments.push(tokens.slice(last, i));
|
|
66
68
|
lastExpr = false;
|
|
67
69
|
last = i + 1;
|
|
68
70
|
}
|
|
69
71
|
else {
|
|
70
|
-
const thisExpr = token.name ===
|
|
72
|
+
const thisExpr = token.name === type_1.RawRType.Expression || token.name === type_1.RawRType.ExprOfAssignOrHelp || token.name === type_1.RawRType.LegacyEqualAssign;
|
|
71
73
|
if (thisExpr && lastExpr) {
|
|
72
74
|
if (i > last) {
|
|
73
75
|
segments.push(tokens.slice(last, i));
|
|
@@ -94,18 +96,18 @@ function handleExpressionList(raw) {
|
|
|
94
96
|
}
|
|
95
97
|
const { comments, others: tokens } = splitComments(raw);
|
|
96
98
|
const first = tokens[0]?.name;
|
|
97
|
-
if (first ===
|
|
99
|
+
if (first === type_1.RawRType.BraceLeft) {
|
|
98
100
|
const endType = tokens[tokens.length - 1].name;
|
|
99
|
-
(0, assert_1.guard)(endType ===
|
|
101
|
+
(0, assert_1.guard)(endType === type_1.RawRType.BraceRight, () => `expected a brace at the end of the expression list as well, but ${endType} :: ${JSON.stringify(tokens[tokens.length - 1], json_1.jsonReplacer)}`);
|
|
100
102
|
return {
|
|
101
103
|
segments: [tokens.slice(1, tokens.length - 1)],
|
|
102
104
|
comments,
|
|
103
105
|
braces: [tokens[0], tokens[tokens.length - 1]]
|
|
104
106
|
};
|
|
105
107
|
}
|
|
106
|
-
else if (first ===
|
|
108
|
+
else if (first === type_1.RawRType.ParenLeft) {
|
|
107
109
|
const endType = tokens[tokens.length - 1].name;
|
|
108
|
-
(0, assert_1.guard)(endType ===
|
|
110
|
+
(0, assert_1.guard)(endType === type_1.RawRType.ParenRight, () => `expected a parenthesis at the end of the expression list as well, but ${endType} :: ${JSON.stringify(tokens[tokens.length - 1], json_1.jsonReplacer)}`);
|
|
109
111
|
return {
|
|
110
112
|
segments: [tokens.slice(1, tokens.length - 1)],
|
|
111
113
|
comments,
|
|
@@ -120,7 +122,7 @@ function processBraces([start, end], processed, comments, data) {
|
|
|
120
122
|
const [newStart, newEnd] = [(0, normalize_symbol_1.tryNormalizeSymbol)(data, [start]), (0, normalize_symbol_1.tryNormalizeSymbol)(data, [end])];
|
|
121
123
|
(0, assert_1.guard)(newStart !== undefined && newEnd !== undefined, () => `expected both start and end to be symbols, but ${JSON.stringify(start, json_1.jsonReplacer)} :: ${JSON.stringify(end, json_1.jsonReplacer)}`);
|
|
122
124
|
return {
|
|
123
|
-
type:
|
|
125
|
+
type: type_1.RType.ExpressionList,
|
|
124
126
|
children: processed,
|
|
125
127
|
grouping: [newStart, newEnd],
|
|
126
128
|
lexeme: undefined,
|
|
@@ -145,7 +147,7 @@ function normalizeExpressions(data, tokens) {
|
|
|
145
147
|
parsedComments = comments.map(c => (0, normalize_comment_1.normalizeComment)(data, c.content));
|
|
146
148
|
if (segments.length > 1 || braces) {
|
|
147
149
|
const processed = segments.flatMap(s => normalizeExpressions(data, s));
|
|
148
|
-
(0, assert_1.guard)(!processed.some(x => x.type ===
|
|
150
|
+
(0, assert_1.guard)(!processed.some(x => x.type === type_1.RType.Delimiter), () => `expected no delimiter tokens in ${JSON.stringify(processed)}`);
|
|
149
151
|
if (braces) {
|
|
150
152
|
return [processBraces(braces, processed, parsedComments, data)];
|
|
151
153
|
}
|
|
@@ -168,7 +170,6 @@ function normalizeExpressions(data, tokens) {
|
|
|
168
170
|
}
|
|
169
171
|
return [...parsedComments, ...normalizeMappedWithoutSemicolonBasedOnType(mappedWithName, data)];
|
|
170
172
|
}
|
|
171
|
-
exports.normalizeExpressions = normalizeExpressions;
|
|
172
173
|
function parseNodesWithUnknownType(data, mappedWithName) {
|
|
173
174
|
const parsedNodes = [];
|
|
174
175
|
// used to indicate the new root node of this set of nodes
|
|
@@ -178,5 +179,4 @@ function parseNodesWithUnknownType(data, mappedWithName) {
|
|
|
178
179
|
}
|
|
179
180
|
return parsedNodes;
|
|
180
181
|
}
|
|
181
|
-
exports.parseNodesWithUnknownType = parseNodesWithUnknownType;
|
|
182
182
|
//# sourceMappingURL=normalize-expressions.js.map
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeRootObjToAst =
|
|
3
|
+
exports.normalizeRootObjToAst = normalizeRootObjToAst;
|
|
4
4
|
const input_format_1 = require("../../input-format");
|
|
5
5
|
const normalize_meta_1 = require("../../normalize-meta");
|
|
6
6
|
const normalize_expressions_1 = require("./normalize-expressions");
|
|
7
7
|
const log_1 = require("../../../../../../../util/log");
|
|
8
8
|
const arrays_1 = require("../../../../../../../util/arrays");
|
|
9
|
+
const type_1 = require("../../../../model/type");
|
|
9
10
|
function normalizeRootObjToAst(data, obj) {
|
|
10
|
-
const exprContent = (0, input_format_1.getKeyGuarded)(obj,
|
|
11
|
-
(0, normalize_meta_1.assureTokenType)(exprContent,
|
|
11
|
+
const exprContent = (0, input_format_1.getKeyGuarded)(obj, type_1.RawRType.ExpressionList);
|
|
12
|
+
(0, normalize_meta_1.assureTokenType)(exprContent, type_1.RawRType.ExpressionList);
|
|
12
13
|
let parsedChildren = [];
|
|
13
14
|
if (input_format_1.childrenKey in exprContent) {
|
|
14
15
|
const children = (0, input_format_1.getKeyGuarded)(exprContent, input_format_1.childrenKey);
|
|
@@ -17,9 +18,9 @@ function normalizeRootObjToAst(data, obj) {
|
|
|
17
18
|
else {
|
|
18
19
|
log_1.log.debug('no children found, assume empty input');
|
|
19
20
|
}
|
|
20
|
-
const [delimiters, nodes] = (0, arrays_1.partition)(parsedChildren, x => x.type ===
|
|
21
|
+
const [delimiters, nodes] = (0, arrays_1.partition)(parsedChildren, x => x.type === type_1.RType.Delimiter || x.type === type_1.RType.Comment);
|
|
21
22
|
return {
|
|
22
|
-
type:
|
|
23
|
+
type: type_1.RType.ExpressionList,
|
|
23
24
|
children: nodes,
|
|
24
25
|
grouping: undefined,
|
|
25
26
|
lexeme: undefined,
|
|
@@ -30,5 +31,4 @@ function normalizeRootObjToAst(data, obj) {
|
|
|
30
31
|
}
|
|
31
32
|
};
|
|
32
33
|
}
|
|
33
|
-
exports.normalizeRootObjToAst = normalizeRootObjToAst;
|
|
34
34
|
//# sourceMappingURL=normalize-root.js.map
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeSingleNode =
|
|
3
|
+
exports.normalizeSingleNode = normalizeSingleNode;
|
|
4
4
|
const normalize_meta_1 = require("../../normalize-meta");
|
|
5
5
|
const input_format_1 = require("../../input-format");
|
|
6
6
|
const normalize_line_directive_1 = require("../other/normalize-line-directive");
|
|
7
7
|
const assert_1 = require("../../../../../../../util/assert");
|
|
8
8
|
const normalize_delimiter_1 = require("./normalize-delimiter");
|
|
9
|
+
const type_1 = require("../../../../model/type");
|
|
9
10
|
const normalize_comment_1 = require("../other/normalize-comment");
|
|
10
11
|
const normalize_expression_1 = require("../expression/normalize-expression");
|
|
11
12
|
const normalize_number_1 = require("../values/normalize-number");
|
|
@@ -23,31 +24,31 @@ const normalize_symbol_1 = require("../values/normalize-symbol");
|
|
|
23
24
|
*/
|
|
24
25
|
function normalizeSingleNode(data, elem) {
|
|
25
26
|
switch (elem.name) {
|
|
26
|
-
case
|
|
27
|
-
case
|
|
28
|
-
case
|
|
29
|
-
case
|
|
27
|
+
case type_1.RawRType.ParenLeft:
|
|
28
|
+
case type_1.RawRType.ParenRight:
|
|
29
|
+
case type_1.RawRType.BraceLeft:
|
|
30
|
+
case type_1.RawRType.BraceRight:
|
|
30
31
|
return (0, normalize_delimiter_1.normalizeDelimiter)(elem);
|
|
31
|
-
case
|
|
32
|
+
case type_1.RawRType.Comment:
|
|
32
33
|
return (0, normalize_comment_1.normalizeComment)(data, elem.content);
|
|
33
|
-
case
|
|
34
|
+
case type_1.RawRType.LineDirective:
|
|
34
35
|
return (0, normalize_line_directive_1.normalizeLineDirective)(data, elem.content);
|
|
35
|
-
case
|
|
36
|
-
case
|
|
37
|
-
case
|
|
38
|
-
case
|
|
36
|
+
case type_1.RawRType.ExpressionList:
|
|
37
|
+
case type_1.RawRType.Expression:
|
|
38
|
+
case type_1.RawRType.ExprOfAssignOrHelp:
|
|
39
|
+
case type_1.RawRType.LegacyEqualAssign:
|
|
39
40
|
return (0, normalize_expression_1.normalizeExpression)(data, elem.content);
|
|
40
|
-
case
|
|
41
|
+
case type_1.RawRType.NumericConst:
|
|
41
42
|
return (0, normalize_number_1.normalizeNumber)(data, elem.content);
|
|
42
|
-
case
|
|
43
|
+
case type_1.RawRType.StringConst:
|
|
43
44
|
return (0, normalize_string_1.normalizeString)(data, elem.content);
|
|
44
|
-
case
|
|
45
|
+
case type_1.RawRType.Break:
|
|
45
46
|
return (0, normalize_break_1.normalizeBreak)(data, elem.content);
|
|
46
|
-
case
|
|
47
|
+
case type_1.RawRType.Next:
|
|
47
48
|
return (0, normalize_next_1.normalizeNext)(data, elem.content);
|
|
48
|
-
case
|
|
49
|
-
case
|
|
50
|
-
case
|
|
49
|
+
case type_1.RawRType.Symbol:
|
|
50
|
+
case type_1.RawRType.Slot:
|
|
51
|
+
case type_1.RawRType.NullConst: {
|
|
51
52
|
const symbol = (0, normalize_symbol_1.tryNormalizeSymbol)(data, (0, normalize_meta_1.getWithTokenType)([elem.content]));
|
|
52
53
|
(0, assert_1.guard)(symbol !== undefined, () => `should have been parsed to a symbol but was ${JSON.stringify(symbol)}`);
|
|
53
54
|
return symbol;
|
|
@@ -56,5 +57,4 @@ function normalizeSingleNode(data, elem) {
|
|
|
56
57
|
throw new input_format_1.XmlParseError(`unknown type ${elem.name} for ${JSON.stringify(elem)} in ${JSON.stringify(data)}`);
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
|
-
exports.normalizeSingleNode = normalizeSingleNode;
|
|
60
60
|
//# sourceMappingURL=normalize-single-node.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeNumber =
|
|
3
|
+
exports.normalizeNumber = normalizeNumber;
|
|
4
4
|
const convert_values_1 = require("../../../../../convert-values");
|
|
5
5
|
const normalize_meta_1 = require("../../normalize-meta");
|
|
6
|
+
const type_1 = require("../../../../model/type");
|
|
6
7
|
/**
|
|
7
8
|
* Normalize the given object as a R number (see {@link number2ts}), supporting booleans (see {@link boolean2ts}),
|
|
8
9
|
* and special values.
|
|
@@ -27,24 +28,23 @@ function normalizeNumber(data, obj) {
|
|
|
27
28
|
return {
|
|
28
29
|
...common,
|
|
29
30
|
namespace: undefined,
|
|
30
|
-
type:
|
|
31
|
+
type: type_1.RType.Symbol,
|
|
31
32
|
content
|
|
32
33
|
};
|
|
33
34
|
}
|
|
34
35
|
else if ((0, convert_values_1.isBoolean)(content)) {
|
|
35
36
|
return {
|
|
36
37
|
...common,
|
|
37
|
-
type:
|
|
38
|
+
type: type_1.RType.Logical,
|
|
38
39
|
content: (0, convert_values_1.boolean2ts)(content)
|
|
39
40
|
};
|
|
40
41
|
}
|
|
41
42
|
else {
|
|
42
43
|
return {
|
|
43
44
|
...common,
|
|
44
|
-
type:
|
|
45
|
+
type: type_1.RType.Number,
|
|
45
46
|
content: (0, convert_values_1.number2ts)(content)
|
|
46
47
|
};
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
exports.normalizeNumber = normalizeNumber;
|
|
50
50
|
//# sourceMappingURL=normalize-number.js.map
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.normalizeString =
|
|
3
|
+
exports.normalizeString = normalizeString;
|
|
4
4
|
const normalize_meta_1 = require("../../normalize-meta");
|
|
5
5
|
const assert_1 = require("../../../../../../../util/assert");
|
|
6
6
|
const convert_values_1 = require("../../../../../convert-values");
|
|
7
|
+
const type_1 = require("../../../../model/type");
|
|
7
8
|
/**
|
|
8
9
|
* Normalize the given object as a R string (see {@link string2ts}).
|
|
9
10
|
* This requires you to check the corresponding name beforehand.
|
|
@@ -21,7 +22,7 @@ function normalizeString(data, obj) {
|
|
|
21
22
|
stringContent = data.currentLexeme;
|
|
22
23
|
}
|
|
23
24
|
return {
|
|
24
|
-
type:
|
|
25
|
+
type: type_1.RType.String,
|
|
25
26
|
location,
|
|
26
27
|
content: (0, convert_values_1.string2ts)(stringContent),
|
|
27
28
|
lexeme: stringContent,
|
|
@@ -32,5 +33,4 @@ function normalizeString(data, obj) {
|
|
|
32
33
|
}
|
|
33
34
|
};
|
|
34
35
|
}
|
|
35
|
-
exports.normalizeString = normalizeString;
|
|
36
36
|
//# sourceMappingURL=normalize-string.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.tryNormalizeSymbol =
|
|
3
|
+
exports.tryNormalizeSymbol = tryNormalizeSymbol;
|
|
4
4
|
const assert_1 = require("../../../../../../../util/assert");
|
|
5
5
|
const parser_1 = require("../../../json/parser");
|
|
6
6
|
const normalize_meta_1 = require("../../normalize-meta");
|
|
@@ -36,7 +36,7 @@ function tryNormalizeSymbol(data, objs) {
|
|
|
36
36
|
return undefined;
|
|
37
37
|
}
|
|
38
38
|
return {
|
|
39
|
-
type:
|
|
39
|
+
type: type_1.RType.Symbol,
|
|
40
40
|
namespace,
|
|
41
41
|
location,
|
|
42
42
|
// remove backticks from symbol
|
|
@@ -49,5 +49,4 @@ function tryNormalizeSymbol(data, objs) {
|
|
|
49
49
|
}
|
|
50
50
|
};
|
|
51
51
|
}
|
|
52
|
-
exports.tryNormalizeSymbol = tryNormalizeSymbol;
|
|
53
52
|
//# sourceMappingURL=normalize-symbol.js.map
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.objectWithArrUnwrap = objectWithArrUnwrap;
|
|
4
|
+
exports.extractLocation = extractLocation;
|
|
5
|
+
exports.retrieveMetaStructure = retrieveMetaStructure;
|
|
6
|
+
exports.assureTokenType = assureTokenType;
|
|
7
|
+
exports.getTokenType = getTokenType;
|
|
8
|
+
exports.getWithTokenType = getWithTokenType;
|
|
9
|
+
exports.retrieveOpName = retrieveOpName;
|
|
10
|
+
exports.ensureChildrenAreLhsAndRhsOrdered = ensureChildrenAreLhsAndRhsOrdered;
|
|
11
|
+
exports.ensureExpressionList = ensureExpressionList;
|
|
4
12
|
const range_1 = require("../../../../../util/range");
|
|
5
13
|
const assert_1 = require("../../../../../util/assert");
|
|
6
14
|
const input_format_1 = require("./input-format");
|
|
15
|
+
const type_1 = require("../../model/type");
|
|
7
16
|
/**
|
|
8
17
|
* if the passed object is an array with only one element, remove the array wrapper
|
|
9
18
|
*/
|
|
@@ -21,14 +30,12 @@ function objectWithArrUnwrap(obj) {
|
|
|
21
30
|
throw new input_format_1.XmlParseError(`expected array or object, yet received ${JSON.stringify(obj)}`);
|
|
22
31
|
}
|
|
23
32
|
}
|
|
24
|
-
exports.objectWithArrUnwrap = objectWithArrUnwrap;
|
|
25
33
|
/**
|
|
26
34
|
* given a xml element, extract the source location of the corresponding element in the R-ast
|
|
27
35
|
*/
|
|
28
36
|
function extractLocation(ast) {
|
|
29
37
|
return (0, range_1.rangeFrom)(ast['line1'], ast['col1'], ast['line2'], ast['col2']);
|
|
30
38
|
}
|
|
31
|
-
exports.extractLocation = extractLocation;
|
|
32
39
|
/**
|
|
33
40
|
* The json object that represents the input xml contains various meta-information.
|
|
34
41
|
* This function extracts the meta-information and returns it.
|
|
@@ -47,14 +54,12 @@ function retrieveMetaStructure(obj) {
|
|
|
47
54
|
content
|
|
48
55
|
};
|
|
49
56
|
}
|
|
50
|
-
exports.retrieveMetaStructure = retrieveMetaStructure;
|
|
51
57
|
function assureTokenType(obj, expectedName) {
|
|
52
58
|
const name = getTokenType(obj);
|
|
53
59
|
if (name !== expectedName) {
|
|
54
60
|
throw new input_format_1.XmlParseError(`expected name to be ${expectedName}, yet received ${name} for ${JSON.stringify(obj)}`);
|
|
55
61
|
}
|
|
56
62
|
}
|
|
57
|
-
exports.assureTokenType = assureTokenType;
|
|
58
63
|
/**
|
|
59
64
|
* Extract the token-type of the given object. This is based on the knowledge, that all json objects created
|
|
60
65
|
* from the R xml have a name attached.
|
|
@@ -64,21 +69,18 @@ exports.assureTokenType = assureTokenType;
|
|
|
64
69
|
function getTokenType(content) {
|
|
65
70
|
return content[input_format_1.nameKey];
|
|
66
71
|
}
|
|
67
|
-
exports.getTokenType = getTokenType;
|
|
68
72
|
function getWithTokenType(obj) {
|
|
69
73
|
return obj.map(content => ({
|
|
70
74
|
name: getTokenType(content),
|
|
71
75
|
content
|
|
72
76
|
}));
|
|
73
77
|
}
|
|
74
|
-
exports.getWithTokenType = getWithTokenType;
|
|
75
78
|
function retrieveOpName(operator) {
|
|
76
79
|
/*
|
|
77
80
|
* only real arithmetic ops have their operation as their own name, the others identify via content
|
|
78
81
|
*/
|
|
79
82
|
return operator.content[input_format_1.contentKey];
|
|
80
83
|
}
|
|
81
|
-
exports.retrieveOpName = retrieveOpName;
|
|
82
84
|
/**
|
|
83
85
|
* Ensure that the first child is completely before the second child.
|
|
84
86
|
*
|
|
@@ -92,11 +94,10 @@ function ensureChildrenAreLhsAndRhsOrdered(first, second) {
|
|
|
92
94
|
throw new input_format_1.XmlParseError(`expected the first child to be the lhs, yet received ${JSON.stringify(first)} & ${JSON.stringify(second)}`);
|
|
93
95
|
}
|
|
94
96
|
}
|
|
95
|
-
exports.ensureChildrenAreLhsAndRhsOrdered = ensureChildrenAreLhsAndRhsOrdered;
|
|
96
97
|
function ensureExpressionList(node) {
|
|
97
|
-
if (node.type !==
|
|
98
|
+
if (node.type !== type_1.RType.ExpressionList) {
|
|
98
99
|
return {
|
|
99
|
-
type:
|
|
100
|
+
type: type_1.RType.ExpressionList,
|
|
100
101
|
grouping: undefined,
|
|
101
102
|
location: node.location,
|
|
102
103
|
info: node.info,
|
|
@@ -106,5 +107,4 @@ function ensureExpressionList(node) {
|
|
|
106
107
|
}
|
|
107
108
|
return node;
|
|
108
109
|
}
|
|
109
|
-
exports.ensureExpressionList = ensureExpressionList;
|
|
110
110
|
//# sourceMappingURL=normalize-meta.js.map
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.RNull = exports.RNa = exports.RInf = exports.RIntegerMarker = exports.RImaginaryMarker = exports.RNumHexFloatRegex = exports.RFalse = exports.RTrue = void 0;
|
|
4
|
+
exports.ts2r = ts2r;
|
|
5
|
+
exports.isBoolean = isBoolean;
|
|
6
|
+
exports.boolean2ts = boolean2ts;
|
|
7
|
+
exports.number2ts = number2ts;
|
|
8
|
+
exports.string2ts = string2ts;
|
|
9
|
+
exports.isNA = isNA;
|
|
4
10
|
class ValueConversionError extends Error {
|
|
5
11
|
constructor(message) {
|
|
6
12
|
super(message);
|
|
@@ -43,7 +49,6 @@ function ts2r(value) {
|
|
|
43
49
|
}
|
|
44
50
|
throw new ValueConversionError(`cannot convert value of type ${typeof value} to R code`);
|
|
45
51
|
}
|
|
46
|
-
exports.ts2r = ts2r;
|
|
47
52
|
/** The R literal for the logical true */
|
|
48
53
|
exports.RTrue = 'TRUE';
|
|
49
54
|
/** The R literal for the logical false */
|
|
@@ -51,7 +56,6 @@ exports.RFalse = 'FALSE';
|
|
|
51
56
|
function isBoolean(value) {
|
|
52
57
|
return value === exports.RTrue || value === exports.RFalse;
|
|
53
58
|
}
|
|
54
|
-
exports.isBoolean = isBoolean;
|
|
55
59
|
function boolean2ts(value) {
|
|
56
60
|
if (value === exports.RTrue) {
|
|
57
61
|
return true;
|
|
@@ -61,7 +65,6 @@ function boolean2ts(value) {
|
|
|
61
65
|
}
|
|
62
66
|
throw new ValueConversionError(`value ${value} is not a legal R boolean`);
|
|
63
67
|
}
|
|
64
|
-
exports.boolean2ts = boolean2ts;
|
|
65
68
|
exports.RNumHexFloatRegex = /^\s*0x(?<intPart>[0-9a-f]+)?(\.(?<floatPart>[0-9a-f]*))?p(?<exp>[-+]?\d+)\s*$/;
|
|
66
69
|
function getDecimalPlacesWithRadix(floatPart, radix) {
|
|
67
70
|
return [...floatPart].reduce((acc, c, idx) => acc + parseInt(c, radix) / (radix ** (idx + 1)), 0);
|
|
@@ -113,7 +116,6 @@ function number2ts(value) {
|
|
|
113
116
|
};
|
|
114
117
|
}
|
|
115
118
|
}
|
|
116
|
-
exports.number2ts = number2ts;
|
|
117
119
|
/**
|
|
118
120
|
* Convert a valid R string into a {@link RStringValue}.
|
|
119
121
|
*
|
|
@@ -147,11 +149,9 @@ function string2ts(value) {
|
|
|
147
149
|
throw new ValueConversionError(`expected string to start with a known quote (' or "), or raw, yet received ${value}`);
|
|
148
150
|
}
|
|
149
151
|
}
|
|
150
|
-
exports.string2ts = string2ts;
|
|
151
152
|
exports.RNa = 'NA';
|
|
152
153
|
exports.RNull = 'NULL';
|
|
153
154
|
function isNA(value) {
|
|
154
155
|
return value === exports.RNa;
|
|
155
156
|
}
|
|
156
|
-
exports.isNA = isNA;
|
|
157
157
|
//# sourceMappingURL=convert-values.js.map
|
package/r-bridge/retriever.js
CHANGED
|
@@ -3,7 +3,16 @@ 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.fileProtocol = void 0;
|
|
7
|
+
exports.requestFromInput = requestFromInput;
|
|
8
|
+
exports.requestProviderFromFile = requestProviderFromFile;
|
|
9
|
+
exports.requestProviderFromText = requestProviderFromText;
|
|
10
|
+
exports.requestFingerprint = requestFingerprint;
|
|
11
|
+
exports.isEmptyRequest = isEmptyRequest;
|
|
12
|
+
exports.retrieveParseDataFromRCode = retrieveParseDataFromRCode;
|
|
13
|
+
exports.retrieveNormalizedAstFromRCode = retrieveNormalizedAstFromRCode;
|
|
14
|
+
exports.removeRQuotes = removeRQuotes;
|
|
15
|
+
exports.retrieveNumberOfRTokensOfLastParse = retrieveNumberOfRTokensOfLastParse;
|
|
7
16
|
const strings_1 = require("../util/strings");
|
|
8
17
|
const assert_1 = require("../util/assert");
|
|
9
18
|
const shell_executor_1 = require("./shell-executor");
|
|
@@ -11,6 +20,7 @@ const object_hash_1 = __importDefault(require("object-hash"));
|
|
|
11
20
|
const parser_1 = require("./lang-4.x/ast/parser/json/parser");
|
|
12
21
|
const init_1 = require("./init");
|
|
13
22
|
const convert_values_1 = require("./lang-4.x/convert-values");
|
|
23
|
+
const type_1 = require("./lang-4.x/ast/model/type");
|
|
14
24
|
exports.fileProtocol = 'file://';
|
|
15
25
|
/**
|
|
16
26
|
* Creates a {@link RParseRequests} from a given input.
|
|
@@ -29,7 +39,6 @@ function requestFromInput(input) {
|
|
|
29
39
|
content: file ? content.slice(7) : content
|
|
30
40
|
};
|
|
31
41
|
}
|
|
32
|
-
exports.requestFromInput = requestFromInput;
|
|
33
42
|
function requestProviderFromFile() {
|
|
34
43
|
return {
|
|
35
44
|
createRequest(path) {
|
|
@@ -40,7 +49,6 @@ function requestProviderFromFile() {
|
|
|
40
49
|
}
|
|
41
50
|
};
|
|
42
51
|
}
|
|
43
|
-
exports.requestProviderFromFile = requestProviderFromFile;
|
|
44
52
|
function requestProviderFromText(text) {
|
|
45
53
|
return {
|
|
46
54
|
createRequest(path) {
|
|
@@ -51,15 +59,12 @@ function requestProviderFromText(text) {
|
|
|
51
59
|
}
|
|
52
60
|
};
|
|
53
61
|
}
|
|
54
|
-
exports.requestProviderFromText = requestProviderFromText;
|
|
55
62
|
function requestFingerprint(request) {
|
|
56
63
|
return (0, object_hash_1.default)(request);
|
|
57
64
|
}
|
|
58
|
-
exports.requestFingerprint = requestFingerprint;
|
|
59
65
|
function isEmptyRequest(request) {
|
|
60
66
|
return request.content.trim().length === 0;
|
|
61
67
|
}
|
|
62
|
-
exports.isEmptyRequest = isEmptyRequest;
|
|
63
68
|
/**
|
|
64
69
|
* Provides the capability to parse R files/R code using the R parser.
|
|
65
70
|
* Depends on {@link RShell} to provide a connection to R.
|
|
@@ -81,7 +86,6 @@ function retrieveParseDataFromRCode(request, shell) {
|
|
|
81
86
|
return shell.sendCommandWithOutput(command).then(result => guardRetrievedOutput(result.join(shell.options.eol), request));
|
|
82
87
|
}
|
|
83
88
|
}
|
|
84
|
-
exports.retrieveParseDataFromRCode = retrieveParseDataFromRCode;
|
|
85
89
|
/**
|
|
86
90
|
* Uses {@link retrieveParseDataFromRCode} and returns the nicely formatted object-AST.
|
|
87
91
|
* If successful, allows further querying the last result with {@link retrieveNumberOfRTokensOfLastParse}.
|
|
@@ -90,7 +94,6 @@ async function retrieveNormalizedAstFromRCode(request, shell) {
|
|
|
90
94
|
const data = await retrieveParseDataFromRCode(request, shell);
|
|
91
95
|
return (0, parser_1.normalize)(data);
|
|
92
96
|
}
|
|
93
|
-
exports.retrieveNormalizedAstFromRCode = retrieveNormalizedAstFromRCode;
|
|
94
97
|
/**
|
|
95
98
|
* If the string has (R-)quotes around it, they will be removed; otherwise the string is returned unchanged.
|
|
96
99
|
*/
|
|
@@ -102,17 +105,15 @@ function removeRQuotes(str) {
|
|
|
102
105
|
return str;
|
|
103
106
|
}
|
|
104
107
|
}
|
|
105
|
-
exports.removeRQuotes = removeRQuotes;
|
|
106
108
|
/**
|
|
107
109
|
* Needs to be called *after* {@link retrieveParseDataFromRCode} (or {@link retrieveNormalizedAstFromRCode})
|
|
108
110
|
*/
|
|
109
111
|
async function retrieveNumberOfRTokensOfLastParse(shell, ignoreComments = false) {
|
|
110
|
-
const rows = ignoreComments ? `flowr_output[flowr_output$token != "${
|
|
112
|
+
const rows = ignoreComments ? `flowr_output[flowr_output$token != "${type_1.RawRType.Comment}", ]` : 'flowr_output';
|
|
111
113
|
const result = await shell.sendCommandWithOutput(`cat(nrow(${rows}),${(0, convert_values_1.ts2r)(shell.options.eol)})`);
|
|
112
114
|
(0, assert_1.guard)(result.length === 1, () => `expected exactly one line to obtain the number of R tokens, but got: ${JSON.stringify(result)}`);
|
|
113
115
|
return Number(result[0]);
|
|
114
116
|
}
|
|
115
|
-
exports.retrieveNumberOfRTokensOfLastParse = retrieveNumberOfRTokensOfLastParse;
|
|
116
117
|
function guardRetrievedOutput(output, request) {
|
|
117
118
|
(0, assert_1.guard)(output !== init_1.ErrorMarker, () => `unable to parse R code (see the log for more information) for request ${JSON.stringify(request)}}`);
|
|
118
119
|
return output;
|
package/r-bridge/shell.d.ts
CHANGED
package/r-bridge/shell.js
CHANGED
|
@@ -333,7 +333,12 @@ class RShellSession {
|
|
|
333
333
|
if (filesToUnlink !== undefined) {
|
|
334
334
|
log_1.log.info(`unlinking ${filesToUnlink.length} files (${JSON.stringify(filesToUnlink)})`);
|
|
335
335
|
for (const f of filesToUnlink) {
|
|
336
|
-
|
|
336
|
+
try {
|
|
337
|
+
fs_1.default.rmSync(f, { recursive: true, force: true });
|
|
338
|
+
}
|
|
339
|
+
catch (e) {
|
|
340
|
+
log_1.log.error(`failed to unlink file ${f}`);
|
|
341
|
+
}
|
|
337
342
|
}
|
|
338
343
|
}
|
|
339
344
|
const killResult = this.bareSession.kill();
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.doNotAutoSelect =
|
|
3
|
+
exports.doNotAutoSelect = doNotAutoSelect;
|
|
4
4
|
/**
|
|
5
5
|
* A variant of the {@link AutoSelectPredicate} which does not select any additional statements (~> false)
|
|
6
6
|
*/
|
|
7
7
|
function doNotAutoSelect(_node) {
|
|
8
8
|
return false;
|
|
9
9
|
}
|
|
10
|
-
exports.doNotAutoSelect = doNotAutoSelect;
|
|
11
10
|
//# sourceMappingURL=auto-select-defaults.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.makeMagicCommentHandler =
|
|
3
|
+
exports.makeMagicCommentHandler = makeMagicCommentHandler;
|
|
4
4
|
const visitor_1 = require("../../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
5
|
+
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
5
6
|
const assert_1 = require("../../util/assert");
|
|
6
7
|
function getLoc({ location, info: { fullRange } }) {
|
|
7
8
|
const loc = location ?? fullRange;
|
|
@@ -58,7 +59,7 @@ function makeMagicCommentHandler(and) {
|
|
|
58
59
|
return;
|
|
59
60
|
}
|
|
60
61
|
for (const c of comments) {
|
|
61
|
-
if (c.type !==
|
|
62
|
+
if (c.type !== type_1.RType.Comment || !c.content.startsWith(' flowr@')) {
|
|
62
63
|
continue;
|
|
63
64
|
}
|
|
64
65
|
const match = commentTriggerRegex.exec(c.content);
|
|
@@ -82,5 +83,4 @@ function makeMagicCommentHandler(and) {
|
|
|
82
83
|
return and?.(node, normalizedAst) ?? false;
|
|
83
84
|
};
|
|
84
85
|
}
|
|
85
|
-
exports.makeMagicCommentHandler = makeMagicCommentHandler;
|
|
86
86
|
//# sourceMappingURL=magic-comments.js.map
|
|
@@ -5,9 +5,11 @@
|
|
|
5
5
|
* @module
|
|
6
6
|
*/
|
|
7
7
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.
|
|
8
|
+
exports.reconstructLogger = void 0;
|
|
9
|
+
exports.reconstructToCode = reconstructToCode;
|
|
9
10
|
const log_1 = require("../util/log");
|
|
10
11
|
const assert_1 = require("../util/assert");
|
|
12
|
+
const type_1 = require("../r-bridge/lang-4.x/ast/model/type");
|
|
11
13
|
const r_function_call_1 = require("../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
12
14
|
const stateful_fold_1 = require("../r-bridge/lang-4.x/ast/model/processing/stateful-fold");
|
|
13
15
|
const auto_select_defaults_1 = require("./auto-select/auto-select-defaults");
|
|
@@ -102,7 +104,7 @@ function reconstructBinaryOp(n, lhs, rhs, config) {
|
|
|
102
104
|
return lhs;
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
|
-
return reconstructRawBinaryOperator(lhs, n.type ===
|
|
107
|
+
return reconstructRawBinaryOperator(lhs, n.type === type_1.RType.Pipe ? '|>' : n.operator, rhs);
|
|
106
108
|
}
|
|
107
109
|
function reconstructForLoop(loop, variable, vector, body, config) {
|
|
108
110
|
if (!isSelected(config, loop) && variable.length === 0 && vector.length === 0) {
|
|
@@ -444,5 +446,4 @@ function reconstructToCode(ast, selection, autoSelectIf = auto_select_defaults_1
|
|
|
444
446
|
(0, log_1.expensiveTrace)(exports.reconstructLogger, () => `reconstructed ast before string conversion: ${JSON.stringify(result)}`);
|
|
445
447
|
return removeOuterExpressionListIfApplicable(result, linesWithAutoSelected.size);
|
|
446
448
|
}
|
|
447
|
-
exports.reconstructToCode = reconstructToCode;
|
|
448
449
|
//# sourceMappingURL=reconstruct.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.collectAllSlicingCriteria =
|
|
3
|
+
exports.collectAllSlicingCriteria = collectAllSlicingCriteria;
|
|
4
4
|
const assert_1 = require("../../util/assert");
|
|
5
5
|
const arrays_1 = require("../../util/arrays");
|
|
6
6
|
const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
@@ -23,5 +23,4 @@ function* collectAllSlicingCriteria(ast, filter) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
}
|
|
26
|
-
exports.collectAllSlicingCriteria = collectAllSlicingCriteria;
|
|
27
26
|
//# sourceMappingURL=collect-all.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
2
2
|
import type { AstIdMap } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
3
3
|
/** Either `line:column`, `line@variable-name`, or `$id` */
|
|
4
|
-
export type SingleSlicingCriterion = `${number}:${number}` | `${number}@${string}` | `$${
|
|
4
|
+
export type SingleSlicingCriterion = `${number}:${number}` | `${number}@${string}` | `$${NodeId}`;
|
|
5
5
|
export type SlicingCriteria = SingleSlicingCriterion[];
|
|
6
6
|
/**
|
|
7
7
|
* Thrown if the given slicing criteria can not be found
|