@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
|
@@ -2,8 +2,8 @@ import type { Base, Location, NoInfo, RNode } from '../model';
|
|
|
2
2
|
import type { RType } from '../type';
|
|
3
3
|
import type { RExpressionList } from './r-expression-list';
|
|
4
4
|
/**
|
|
5
|
-
* ```
|
|
6
|
-
* while
|
|
5
|
+
* ```r
|
|
6
|
+
* while(<condition>) <body>
|
|
7
7
|
* ```
|
|
8
8
|
*/
|
|
9
9
|
export interface RWhileLoop<Info = NoInfo> extends Base<Info>, Location {
|
|
@@ -1,48 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.UnaryOperatorsInRAst = exports.OperatorsInRAst = exports.Operators = exports.OperatorDatabase = void 0;
|
|
4
|
+
const type_1 = require("./type");
|
|
4
5
|
/* eslint-disable */
|
|
5
6
|
exports.OperatorDatabase = {
|
|
6
7
|
/* model formulae */
|
|
7
|
-
'~': { name: 'model formulae', stringUsedInRAst:
|
|
8
|
+
'~': { name: 'model formulae', stringUsedInRAst: type_1.RawRType.Tilde, stringUsedInternally: '~', writtenAs: 'infix', arity: 3 /* OperatorArity.Both */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'model-formula', 'function-calls'] },
|
|
8
9
|
/* arithmetic */
|
|
9
|
-
'+': { name: 'addition or unary +', stringUsedInRAst:
|
|
10
|
-
'-': { name: 'subtraction or unary -', stringUsedInRAst:
|
|
11
|
-
'*': { name: 'multiplication', stringUsedInRAst:
|
|
12
|
-
'/': { name: 'division', stringUsedInRAst:
|
|
13
|
-
'^': { name: 'exponentiation', stringUsedInRAst:
|
|
10
|
+
'+': { name: 'addition or unary +', stringUsedInRAst: type_1.RawRType.Plus, stringUsedInternally: '+', writtenAs: 'infix', arity: 3 /* OperatorArity.Both */, usedAs: 'operation', capabilities: ['function-calls'] },
|
|
11
|
+
'-': { name: 'subtraction or unary -', stringUsedInRAst: type_1.RawRType.Minus, stringUsedInternally: '-', writtenAs: 'infix', arity: 3 /* OperatorArity.Both */, usedAs: 'operation', capabilities: ['function-calls'] },
|
|
12
|
+
'*': { name: 'multiplication', stringUsedInRAst: type_1.RawRType.Times, stringUsedInternally: '*', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls'] },
|
|
13
|
+
'/': { name: 'division', stringUsedInRAst: type_1.RawRType.Div, stringUsedInternally: '/', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls'] },
|
|
14
|
+
'^': { name: 'exponentiation', stringUsedInRAst: type_1.RawRType.Exp, stringUsedInternally: '^', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls'] },
|
|
14
15
|
/* no error, R uses ^ to represent ** in the AST */
|
|
15
|
-
'**': { name: 'alternative exponentiation', stringUsedInRAst:
|
|
16
|
+
'**': { name: 'alternative exponentiation', stringUsedInRAst: type_1.RawRType.Exp, stringUsedInternally: '**', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls'] },
|
|
16
17
|
'%%': { name: 'modulus', stringUsedInRAst: '%%', stringUsedInternally: '%%', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'special-operator', 'function-calls'] },
|
|
17
18
|
'%/%': { name: 'integer division', stringUsedInRAst: '%/%', stringUsedInternally: '%/%', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'special-operator', 'function-calls'] },
|
|
18
19
|
'%*%': { name: 'matrix product', stringUsedInRAst: '%*%', stringUsedInternally: '%*%', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'special-operator', 'function-calls'] },
|
|
19
20
|
'%o%': { name: 'outer product', stringUsedInRAst: '%o%', stringUsedInternally: '%o%', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'special-operator', 'function-calls'] },
|
|
20
21
|
'%x%': { name: 'kronecker product', stringUsedInRAst: '%x%', stringUsedInternally: '%x%', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'special-operator', 'function-calls'] },
|
|
21
22
|
/* comparison */
|
|
22
|
-
'==': { name: 'equal to', stringUsedInRAst:
|
|
23
|
-
'!=': { name: 'not equal to', stringUsedInRAst:
|
|
24
|
-
'>': { name: 'greater than', stringUsedInRAst:
|
|
25
|
-
'>=': { name: 'greater than or equal to', stringUsedInRAst:
|
|
26
|
-
'<': { name: 'less than', stringUsedInRAst:
|
|
27
|
-
'<=': { name: 'less than or equal to', stringUsedInRAst:
|
|
23
|
+
'==': { name: 'equal to', stringUsedInRAst: type_1.RawRType.Eq, stringUsedInternally: '==', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls'] },
|
|
24
|
+
'!=': { name: 'not equal to', stringUsedInRAst: type_1.RawRType.Ne, stringUsedInternally: '!=', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls'] },
|
|
25
|
+
'>': { name: 'greater than', stringUsedInRAst: type_1.RawRType.Gt, stringUsedInternally: '>', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls'] },
|
|
26
|
+
'>=': { name: 'greater than or equal to', stringUsedInRAst: type_1.RawRType.Ge, stringUsedInternally: '>=', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls'] },
|
|
27
|
+
'<': { name: 'less than', stringUsedInRAst: type_1.RawRType.Lt, stringUsedInternally: '<', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls'] },
|
|
28
|
+
'<=': { name: 'less than or equal to', stringUsedInRAst: type_1.RawRType.Le, stringUsedInternally: '<=', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls'] },
|
|
28
29
|
/* logical */
|
|
29
|
-
'&': { name: 'logical and (vectorized)', stringUsedInRAst:
|
|
30
|
-
'&&': { name: 'logical and (non-vectorized)', stringUsedInRAst:
|
|
31
|
-
'|': { name: 'logical or (vectorized)', stringUsedInRAst:
|
|
32
|
-
'||': { name: 'logical or (not-vectorized)', stringUsedInRAst:
|
|
33
|
-
'!': { name: 'unary not', stringUsedInRAst:
|
|
30
|
+
'&': { name: 'logical and (vectorized)', stringUsedInRAst: type_1.RawRType.And, stringUsedInternally: '&', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls', 'non-strict-logical-operators'] },
|
|
31
|
+
'&&': { name: 'logical and (non-vectorized)', stringUsedInRAst: type_1.RawRType.And2, stringUsedInternally: '&&', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls', 'non-strict-logical-operators'] },
|
|
32
|
+
'|': { name: 'logical or (vectorized)', stringUsedInRAst: type_1.RawRType.Or, stringUsedInternally: '|', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls', 'non-strict-logical-operators'] },
|
|
33
|
+
'||': { name: 'logical or (not-vectorized)', stringUsedInRAst: type_1.RawRType.Or2, stringUsedInternally: '||', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls', 'non-strict-logical-operators'] },
|
|
34
|
+
'!': { name: 'unary not', stringUsedInRAst: type_1.RawRType.Exclamation, stringUsedInternally: '!', writtenAs: 'prefix', arity: 1 /* OperatorArity.Unary */, usedAs: 'operation', capabilities: ['unary-operator', 'function-calls'] },
|
|
34
35
|
'%in%': { name: 'matching operator', stringUsedInRAst: '%in%', stringUsedInternally: '%in%', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'special-operator', 'function-calls'] },
|
|
35
36
|
/* assignment */
|
|
36
|
-
'<-': { name: 'left assignment', stringUsedInRAst:
|
|
37
|
-
':=': { name: 'left assignment', stringUsedInRAst:
|
|
38
|
-
'<<-': { name: 'left global assignment', stringUsedInRAst:
|
|
39
|
-
'->': { name: 'right assignment', stringUsedInRAst:
|
|
40
|
-
'->>': { name: 'right global assignment', stringUsedInRAst:
|
|
41
|
-
'=': { name: 'equal assignment', stringUsedInRAst:
|
|
37
|
+
'<-': { name: 'left assignment', stringUsedInRAst: type_1.RawRType.LeftAssign, stringUsedInternally: '<-', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'assignment', capabilities: ['binary-operator', 'infix-calls', 'assignment-functions', 'local-left-assignment', 'function-calls'] },
|
|
38
|
+
':=': { name: 'left assignment', stringUsedInRAst: type_1.RawRType.LeftAssign, stringUsedInternally: ':=', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'assignment', capabilities: ['binary-operator', 'infix-calls', 'assignment-functions', 'local-table-assignment', 'function-calls'] },
|
|
39
|
+
'<<-': { name: 'left global assignment', stringUsedInRAst: type_1.RawRType.LeftAssign, stringUsedInternally: '<<-', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'assignment', capabilities: ['binary-operator', 'infix-calls', 'assignment-functions', 'super-left-assignment', 'function-calls'] },
|
|
40
|
+
'->': { name: 'right assignment', stringUsedInRAst: type_1.RawRType.RightAssign, stringUsedInternally: '->', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'assignment', capabilities: ['binary-operator', 'infix-calls', 'assignment-functions', 'local-right-assignment', 'function-calls'] },
|
|
41
|
+
'->>': { name: 'right global assignment', stringUsedInRAst: type_1.RawRType.RightAssign, stringUsedInternally: '->>', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'assignment', capabilities: ['binary-operator', 'infix-calls', 'assignment-functions', 'super-right-assignment', 'function-calls'] },
|
|
42
|
+
'=': { name: 'equal assignment', stringUsedInRAst: type_1.RawRType.EqualAssign, stringUsedInternally: '=', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'assignment', capabilities: ['binary-operator', 'infix-calls', 'assignment-functions', 'local-equal-assignment', 'function-calls'] },
|
|
42
43
|
/* others */
|
|
43
44
|
/* maybe introduce custom in-r-ast flavor for these? we consider it arithmetic, as it works on numbers => if we change this we have to create custom tests! (with arithmetic, there is the automatic test set) */
|
|
44
|
-
':': { name: 'sequence operator', stringUsedInRAst:
|
|
45
|
-
'?': { name: 'question', stringUsedInRAst:
|
|
45
|
+
':': { name: 'sequence operator', stringUsedInRAst: type_1.RawRType.Colon, stringUsedInternally: ':', writtenAs: 'infix', arity: 2 /* OperatorArity.Binary */, usedAs: 'operation', capabilities: ['binary-operator', 'infix-calls', 'function-calls'] },
|
|
46
|
+
'?': { name: 'question', stringUsedInRAst: type_1.RawRType.Question, stringUsedInternally: '?', writtenAs: 'prefix', arity: 1 /* OperatorArity.Unary */, usedAs: 'operation', capabilities: ['unary-operator', 'built-in-help'] }
|
|
46
47
|
};
|
|
47
48
|
/* eslint-enable */
|
|
48
49
|
function buildOperatorRAstCollection(operators) {
|
|
@@ -10,9 +10,15 @@
|
|
|
10
10
|
* @module
|
|
11
11
|
*/
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
13
|
+
exports.deterministicCountingIdGenerator = deterministicCountingIdGenerator;
|
|
14
|
+
exports.deterministicPrefixIdGenerator = deterministicPrefixIdGenerator;
|
|
15
|
+
exports.sourcedDeterministicCountingIdGenerator = sourcedDeterministicCountingIdGenerator;
|
|
16
|
+
exports.nodeToLocationId = nodeToLocationId;
|
|
17
|
+
exports.deterministicLocationIdGenerator = deterministicLocationIdGenerator;
|
|
18
|
+
exports.decorateAst = decorateAst;
|
|
14
19
|
const assert_1 = require("../../../../../util/assert");
|
|
15
20
|
const bimap_1 = require("../../../../../util/bimap");
|
|
21
|
+
const type_1 = require("../type");
|
|
16
22
|
const stateful_fold_1 = require("./stateful-fold");
|
|
17
23
|
const r_function_call_1 = require("../nodes/r-function-call");
|
|
18
24
|
/**
|
|
@@ -21,16 +27,13 @@ const r_function_call_1 = require("../nodes/r-function-call");
|
|
|
21
27
|
function deterministicCountingIdGenerator(id = 0) {
|
|
22
28
|
return () => id++;
|
|
23
29
|
}
|
|
24
|
-
exports.deterministicCountingIdGenerator = deterministicCountingIdGenerator;
|
|
25
30
|
function deterministicPrefixIdGenerator(prefix, id = 0) {
|
|
26
31
|
return () => `${prefix}-${id++}`;
|
|
27
32
|
}
|
|
28
|
-
exports.deterministicPrefixIdGenerator = deterministicPrefixIdGenerator;
|
|
29
33
|
function sourcedDeterministicCountingIdGenerator(path, location, start = 0) {
|
|
30
34
|
let id = start;
|
|
31
35
|
return () => `${path}-${loc2Id(location)}-${id++}`;
|
|
32
36
|
}
|
|
33
|
-
exports.sourcedDeterministicCountingIdGenerator = sourcedDeterministicCountingIdGenerator;
|
|
34
37
|
function loc2Id([sl, sc, el, ec]) {
|
|
35
38
|
return `${sl}:${sc}-${el}:${ec}`;
|
|
36
39
|
}
|
|
@@ -44,7 +47,6 @@ function nodeToLocationId(data) {
|
|
|
44
47
|
(0, assert_1.guard)(loc !== undefined, 'location must be defined to generate a location id');
|
|
45
48
|
return loc2Id(loc);
|
|
46
49
|
}
|
|
47
|
-
exports.nodeToLocationId = nodeToLocationId;
|
|
48
50
|
/**
|
|
49
51
|
* Generates unique ids based on the locations of the node (see {@link nodeToLocationId}).
|
|
50
52
|
* If a node has no location information, it will be assigned a unique counter-value.
|
|
@@ -55,13 +57,12 @@ function deterministicLocationIdGenerator(start = 0) {
|
|
|
55
57
|
let id = start;
|
|
56
58
|
return (data) => data.location !== undefined ? nodeToLocationId(data) : `${id++}`;
|
|
57
59
|
}
|
|
58
|
-
exports.deterministicLocationIdGenerator = deterministicLocationIdGenerator;
|
|
59
60
|
const defaultParentContext = {
|
|
60
61
|
role: "root" /* RoleInParent.Root */,
|
|
61
62
|
index: 0
|
|
62
63
|
};
|
|
63
64
|
const nestForElement = new Set([
|
|
64
|
-
|
|
65
|
+
type_1.RType.FunctionDefinition, type_1.RType.ForLoop, type_1.RType.WhileLoop, type_1.RType.RepeatLoop, type_1.RType.IfThenElse,
|
|
65
66
|
]);
|
|
66
67
|
/**
|
|
67
68
|
* Covert the given AST into a doubly linked tree while assigning ids (so it stays serializable).
|
|
@@ -125,7 +126,6 @@ function decorateAst(ast, getId = deterministicCountingIdGenerator(0)) {
|
|
|
125
126
|
idMap
|
|
126
127
|
};
|
|
127
128
|
}
|
|
128
|
-
exports.decorateAst = decorateAst;
|
|
129
129
|
function createFoldForLeaf(info) {
|
|
130
130
|
return (data, nesting) => {
|
|
131
131
|
const id = info.getId(data);
|
|
@@ -153,7 +153,7 @@ function createFoldForBinaryOp(info) {
|
|
|
153
153
|
const rhsInfo = rhs.info;
|
|
154
154
|
rhsInfo.parent = id;
|
|
155
155
|
rhsInfo.index = 1;
|
|
156
|
-
if (data.type ===
|
|
156
|
+
if (data.type === type_1.RType.Pipe) {
|
|
157
157
|
lhsInfo.role = "pipe-lhs" /* RoleInParent.PipeLhs */;
|
|
158
158
|
rhsInfo.role = "pipe-rhs" /* RoleInParent.PipeRhs */;
|
|
159
159
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.foldAst =
|
|
3
|
+
exports.foldAst = foldAst;
|
|
4
4
|
const stateful_fold_1 = require("./stateful-fold");
|
|
5
5
|
const down = () => undefined;
|
|
6
6
|
/**
|
|
@@ -16,5 +16,4 @@ function foldAst(ast, folds) {
|
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
17
17
|
return (0, stateful_fold_1.foldAstStateful)(ast, undefined, statefulFolds);
|
|
18
18
|
}
|
|
19
|
-
exports.foldAst = foldAst;
|
|
20
19
|
//# sourceMappingURL=fold.js.map
|
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
import type { AstIdMap } from './decorate';
|
|
2
|
+
import type { DataflowGraph } from '../../../../../dataflow/graph/graph';
|
|
2
3
|
/** The type of the id assigned to each node. Branded to avoid problematic usages with other string or numeric types. */
|
|
3
4
|
export type NodeId<T extends string | number = string | number> = T & {
|
|
4
5
|
__brand?: 'node-id';
|
|
5
6
|
};
|
|
6
7
|
/** used so that we do not have to store strings for the default numeric ids */
|
|
7
8
|
export declare function normalizeIdToNumberIfPossible(id: NodeId): NodeId;
|
|
9
|
+
/**
|
|
10
|
+
* Recovers the lexeme of a node from its id in the idmap.
|
|
11
|
+
*/
|
|
8
12
|
export declare function recoverName(id: NodeId, idMap?: AstIdMap): string | undefined;
|
|
13
|
+
export declare function recoverContent(id: NodeId, graph: DataflowGraph): string | undefined;
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.normalizeIdToNumberIfPossible = normalizeIdToNumberIfPossible;
|
|
4
|
+
exports.recoverName = recoverName;
|
|
5
|
+
exports.recoverContent = recoverContent;
|
|
6
|
+
const vertex_1 = require("../../../../../dataflow/graph/vertex");
|
|
7
|
+
const retriever_1 = require("../../../../retriever");
|
|
4
8
|
const numIdRegex = /^\d+$/;
|
|
5
9
|
/** used so that we do not have to store strings for the default numeric ids */
|
|
6
10
|
function normalizeIdToNumberIfPossible(id) {
|
|
@@ -10,9 +14,28 @@ function normalizeIdToNumberIfPossible(id) {
|
|
|
10
14
|
}
|
|
11
15
|
return id;
|
|
12
16
|
}
|
|
13
|
-
|
|
17
|
+
/**
|
|
18
|
+
* Recovers the lexeme of a node from its id in the idmap.
|
|
19
|
+
*/
|
|
14
20
|
function recoverName(id, idMap) {
|
|
15
21
|
return idMap?.get(id)?.lexeme;
|
|
16
22
|
}
|
|
17
|
-
|
|
23
|
+
function recoverContent(id, graph) {
|
|
24
|
+
const vertex = graph.getVertex(id);
|
|
25
|
+
if (vertex === undefined) {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
if (vertex.tag === vertex_1.VertexType.FunctionCall && vertex.name) {
|
|
29
|
+
return vertex.name;
|
|
30
|
+
}
|
|
31
|
+
const node = graph.idMap?.get(id);
|
|
32
|
+
if (node === undefined) {
|
|
33
|
+
return undefined;
|
|
34
|
+
}
|
|
35
|
+
const lexeme = node.lexeme ?? node.info.fullLexeme ?? '';
|
|
36
|
+
if (vertex.tag === vertex_1.VertexType.Use) {
|
|
37
|
+
return (0, retriever_1.removeRQuotes)(lexeme);
|
|
38
|
+
}
|
|
39
|
+
return lexeme;
|
|
40
|
+
}
|
|
18
41
|
//# sourceMappingURL=node-id.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.rolesOfParents =
|
|
3
|
+
exports.rolesOfParents = rolesOfParents;
|
|
4
4
|
/**
|
|
5
5
|
* Returns the roles of the parents of the given node, starting with the parent-role of the node itself.
|
|
6
6
|
*/
|
|
@@ -13,5 +13,4 @@ function rolesOfParents(node, idMap) {
|
|
|
13
13
|
}
|
|
14
14
|
return roles;
|
|
15
15
|
}
|
|
16
|
-
exports.rolesOfParents = rolesOfParents;
|
|
17
16
|
//# sourceMappingURL=role.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.foldAstStateful =
|
|
3
|
+
exports.foldAstStateful = foldAstStateful;
|
|
4
4
|
const assert_1 = require("../../../../../util/assert");
|
|
5
|
+
const type_1 = require("../type");
|
|
5
6
|
const r_function_call_1 = require("../nodes/r-function-call");
|
|
6
7
|
/**
|
|
7
8
|
* Folds in old functional-fashion over the AST structure but allowing for a down function which can pass context to child nodes.
|
|
@@ -10,51 +11,50 @@ function foldAstStateful(ast, down, folds) {
|
|
|
10
11
|
const type = ast.type;
|
|
11
12
|
down = folds.down(ast, down);
|
|
12
13
|
switch (type) {
|
|
13
|
-
case
|
|
14
|
+
case type_1.RType.Number:
|
|
14
15
|
return folds.foldNumber(ast, down);
|
|
15
|
-
case
|
|
16
|
+
case type_1.RType.String:
|
|
16
17
|
return folds.foldString(ast, down);
|
|
17
|
-
case
|
|
18
|
+
case type_1.RType.Logical:
|
|
18
19
|
return folds.foldLogical(ast, down);
|
|
19
|
-
case
|
|
20
|
+
case type_1.RType.Symbol:
|
|
20
21
|
return folds.foldSymbol(ast, down);
|
|
21
|
-
case
|
|
22
|
+
case type_1.RType.Comment:
|
|
22
23
|
return folds.other.foldComment(ast, down);
|
|
23
|
-
case
|
|
24
|
+
case type_1.RType.LineDirective:
|
|
24
25
|
return folds.other.foldLineDirective(ast, down);
|
|
25
|
-
case
|
|
26
|
+
case type_1.RType.Pipe:
|
|
26
27
|
return folds.foldPipe(ast, foldAstStateful(ast.lhs, down, folds), foldAstStateful(ast.rhs, down, folds), down);
|
|
27
|
-
case
|
|
28
|
+
case type_1.RType.BinaryOp:
|
|
28
29
|
return folds.foldBinaryOp(ast, foldAstStateful(ast.lhs, down, folds), foldAstStateful(ast.rhs, down, folds), down);
|
|
29
|
-
case
|
|
30
|
+
case type_1.RType.UnaryOp:
|
|
30
31
|
return folds.foldUnaryOp(ast, foldAstStateful(ast.operand, down, folds), down);
|
|
31
|
-
case
|
|
32
|
+
case type_1.RType.Access:
|
|
32
33
|
return folds.foldAccess(ast, foldAstStateful(ast.accessed, down, folds), ast.access.map(access => access === r_function_call_1.EmptyArgument ? r_function_call_1.EmptyArgument : foldAstStateful(access, down, folds)), down);
|
|
33
|
-
case
|
|
34
|
+
case type_1.RType.ForLoop:
|
|
34
35
|
return folds.loop.foldFor(ast, foldAstStateful(ast.variable, down, folds), foldAstStateful(ast.vector, down, folds), foldAstStateful(ast.body, down, folds), down);
|
|
35
|
-
case
|
|
36
|
+
case type_1.RType.WhileLoop:
|
|
36
37
|
return folds.loop.foldWhile(ast, foldAstStateful(ast.condition, down, folds), foldAstStateful(ast.body, down, folds), down);
|
|
37
|
-
case
|
|
38
|
+
case type_1.RType.RepeatLoop:
|
|
38
39
|
return folds.loop.foldRepeat(ast, foldAstStateful(ast.body, down, folds), down);
|
|
39
|
-
case
|
|
40
|
+
case type_1.RType.FunctionCall:
|
|
40
41
|
return folds.functions.foldFunctionCall(ast, foldAstStateful(ast.named ? ast.functionName : ast.calledFunction, down, folds), ast.arguments.map(param => param === r_function_call_1.EmptyArgument ? param : foldAstStateful(param, down, folds)), down);
|
|
41
|
-
case
|
|
42
|
+
case type_1.RType.FunctionDefinition:
|
|
42
43
|
return folds.functions.foldFunctionDefinition(ast, ast.parameters.map(param => foldAstStateful(param, down, folds)), foldAstStateful(ast.body, down, folds), down);
|
|
43
|
-
case
|
|
44
|
+
case type_1.RType.Parameter:
|
|
44
45
|
return folds.functions.foldParameter(ast, foldAstStateful(ast.name, down, folds), ast.defaultValue ? foldAstStateful(ast.defaultValue, down, folds) : undefined, down);
|
|
45
|
-
case
|
|
46
|
+
case type_1.RType.Argument:
|
|
46
47
|
return folds.functions.foldArgument(ast, ast.name ? foldAstStateful(ast.name, down, folds) : undefined, ast.value ? foldAstStateful(ast.value, down, folds) : undefined, down);
|
|
47
|
-
case
|
|
48
|
+
case type_1.RType.Next:
|
|
48
49
|
return folds.loop.foldNext(ast, down);
|
|
49
|
-
case
|
|
50
|
+
case type_1.RType.Break:
|
|
50
51
|
return folds.loop.foldBreak(ast, down);
|
|
51
|
-
case
|
|
52
|
+
case type_1.RType.IfThenElse:
|
|
52
53
|
return folds.foldIfThenElse(ast, foldAstStateful(ast.condition, down, folds), foldAstStateful(ast.then, down, folds), ast.otherwise === undefined ? undefined : foldAstStateful(ast.otherwise, down, folds), down);
|
|
53
|
-
case
|
|
54
|
+
case type_1.RType.ExpressionList:
|
|
54
55
|
return folds.foldExprList(ast, ast.grouping ? [foldAstStateful(ast.grouping[0], down, folds), foldAstStateful(ast.grouping[1], down, folds)] : undefined, ast.children.map(expr => foldAstStateful(expr, down, folds)), down);
|
|
55
56
|
default:
|
|
56
57
|
(0, assert_1.assertUnreachable)(type);
|
|
57
58
|
}
|
|
58
59
|
}
|
|
59
|
-
exports.foldAstStateful = foldAstStateful;
|
|
60
60
|
//# sourceMappingURL=stateful-fold.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.visitAst =
|
|
3
|
+
exports.visitAst = visitAst;
|
|
4
|
+
const type_1 = require("../type");
|
|
4
5
|
const assert_1 = require("../../../../../util/assert");
|
|
5
6
|
const r_function_call_1 = require("../nodes/r-function-call");
|
|
6
7
|
// capsuled as a class to avoid passing onExit and onEnter on *each* visit call
|
|
@@ -18,65 +19,65 @@ class NodeVisitor {
|
|
|
18
19
|
/* let the type system know that the type does not change */
|
|
19
20
|
const type = node.type;
|
|
20
21
|
switch (type) {
|
|
21
|
-
case
|
|
22
|
+
case type_1.RType.FunctionCall:
|
|
22
23
|
this.visitSingle(node.named ? node.functionName : node.calledFunction);
|
|
23
24
|
this.visit(node.arguments);
|
|
24
25
|
break;
|
|
25
|
-
case
|
|
26
|
+
case type_1.RType.FunctionDefinition:
|
|
26
27
|
this.visit(node.parameters);
|
|
27
28
|
this.visitSingle(node.body);
|
|
28
29
|
break;
|
|
29
|
-
case
|
|
30
|
+
case type_1.RType.ExpressionList:
|
|
30
31
|
this.visit(node.grouping);
|
|
31
32
|
this.visit(node.children);
|
|
32
33
|
break;
|
|
33
|
-
case
|
|
34
|
+
case type_1.RType.ForLoop:
|
|
34
35
|
this.visitSingle(node.variable);
|
|
35
36
|
this.visitSingle(node.vector);
|
|
36
37
|
this.visitSingle(node.body);
|
|
37
38
|
break;
|
|
38
|
-
case
|
|
39
|
+
case type_1.RType.WhileLoop:
|
|
39
40
|
this.visitSingle(node.condition);
|
|
40
41
|
this.visitSingle(node.body);
|
|
41
42
|
break;
|
|
42
|
-
case
|
|
43
|
+
case type_1.RType.RepeatLoop:
|
|
43
44
|
this.visitSingle(node.body);
|
|
44
45
|
break;
|
|
45
|
-
case
|
|
46
|
+
case type_1.RType.IfThenElse:
|
|
46
47
|
this.visitSingle(node.condition);
|
|
47
48
|
this.visitSingle(node.then);
|
|
48
49
|
this.visit(node.otherwise);
|
|
49
50
|
break;
|
|
50
|
-
case
|
|
51
|
-
case
|
|
51
|
+
case type_1.RType.BinaryOp:
|
|
52
|
+
case type_1.RType.Pipe:
|
|
52
53
|
this.visitSingle(node.lhs);
|
|
53
54
|
this.visitSingle(node.rhs);
|
|
54
55
|
break;
|
|
55
|
-
case
|
|
56
|
+
case type_1.RType.UnaryOp:
|
|
56
57
|
this.visitSingle(node.operand);
|
|
57
58
|
break;
|
|
58
|
-
case
|
|
59
|
+
case type_1.RType.Parameter:
|
|
59
60
|
this.visitSingle(node.name);
|
|
60
61
|
this.visit(node.defaultValue);
|
|
61
62
|
break;
|
|
62
|
-
case
|
|
63
|
+
case type_1.RType.Argument:
|
|
63
64
|
this.visit(node.name);
|
|
64
65
|
this.visit(node.value);
|
|
65
66
|
break;
|
|
66
|
-
case
|
|
67
|
+
case type_1.RType.Access:
|
|
67
68
|
this.visitSingle(node.accessed);
|
|
68
69
|
if (node.operator === '[' || node.operator === '[[') {
|
|
69
70
|
this.visit(node.access);
|
|
70
71
|
}
|
|
71
72
|
break;
|
|
72
|
-
case
|
|
73
|
-
case
|
|
74
|
-
case
|
|
75
|
-
case
|
|
76
|
-
case
|
|
77
|
-
case
|
|
78
|
-
case
|
|
79
|
-
case
|
|
73
|
+
case type_1.RType.Symbol:
|
|
74
|
+
case type_1.RType.Logical:
|
|
75
|
+
case type_1.RType.Number:
|
|
76
|
+
case type_1.RType.String:
|
|
77
|
+
case type_1.RType.Comment:
|
|
78
|
+
case type_1.RType.Break:
|
|
79
|
+
case type_1.RType.Next:
|
|
80
|
+
case type_1.RType.LineDirective:
|
|
80
81
|
// leafs
|
|
81
82
|
break;
|
|
82
83
|
default:
|
|
@@ -108,5 +109,4 @@ class NodeVisitor {
|
|
|
108
109
|
function visitAst(nodes, onVisit, onExit) {
|
|
109
110
|
return new NodeVisitor(onVisit, onExit).visit(nodes);
|
|
110
111
|
}
|
|
111
|
-
exports.visitAst = visitAst;
|
|
112
112
|
//# sourceMappingURL=visitor.js.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*
|
|
6
6
|
* @see RType
|
|
7
7
|
*/
|
|
8
|
-
export declare
|
|
8
|
+
export declare enum RawRType {
|
|
9
9
|
/** T1 */
|
|
10
10
|
NullConst = "NULL_CONST",
|
|
11
11
|
/** T2 */
|
|
@@ -155,7 +155,7 @@ export declare const enum RawRType {
|
|
|
155
155
|
*
|
|
156
156
|
* @see RawRType
|
|
157
157
|
*/
|
|
158
|
-
export declare
|
|
158
|
+
export declare enum RType {
|
|
159
159
|
/** {@link RAccess} */
|
|
160
160
|
Access = "RAccess",
|
|
161
161
|
/** {@link RArgument} */
|