@eagleoutice/flowr 2.0.25 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/benchmark/slicer.js +2 -1
- package/benchmark/stats/print.js +3 -4
- package/benchmark/stats/size-of.js +9 -7
- package/benchmark/summarizer/first-phase/input.d.ts +0 -1
- package/benchmark/summarizer/first-phase/input.js +2 -3
- package/benchmark/summarizer/first-phase/process.js +7 -7
- package/benchmark/summarizer/second-phase/graph.js +1 -2
- package/benchmark/summarizer/second-phase/process.d.ts +0 -1
- package/benchmark/summarizer/second-phase/process.js +4 -5
- package/benchmark/summarizer/summarizer.js +7 -1
- package/cli/benchmark-app.js +6 -1
- package/cli/common/features.js +2 -3
- package/cli/common/script.js +2 -3
- package/cli/common/scripts-info.d.ts +69 -1
- package/cli/common/scripts-info.js +6 -6
- package/cli/flowr-main-options.d.ts +4 -0
- package/cli/flowr-main-options.js +88 -0
- package/cli/flowr.d.ts +3 -3
- package/cli/flowr.js +22 -31
- package/cli/repl/commands/{cfg.d.ts → repl-cfg.d.ts} +1 -1
- package/cli/repl/commands/{cfg.js → repl-cfg.js} +3 -3
- package/cli/repl/commands/{commands.d.ts → repl-commands.d.ts} +3 -1
- package/cli/repl/commands/{commands.js → repl-commands.js} +56 -35
- package/cli/repl/commands/{dataflow.d.ts → repl-dataflow.d.ts} +1 -1
- package/cli/repl/commands/{dataflow.js → repl-dataflow.js} +2 -2
- package/cli/repl/commands/{execute.d.ts → repl-execute.d.ts} +1 -1
- package/cli/repl/commands/{execute.js → repl-execute.js} +3 -3
- package/cli/repl/commands/repl-lineage.d.ts +15 -0
- package/cli/repl/commands/{lineage.js → repl-lineage.js} +14 -12
- package/cli/repl/commands/{main.js → repl-main.js} +1 -1
- package/cli/repl/commands/{normalize.d.ts → repl-normalize.d.ts} +1 -1
- package/cli/repl/commands/{normalize.js → repl-normalize.js} +3 -3
- package/cli/repl/commands/{parse.d.ts → repl-parse.d.ts} +1 -1
- package/cli/repl/commands/{parse.js → repl-parse.js} +3 -2
- package/cli/repl/commands/repl-query.d.ts +8 -0
- package/cli/repl/commands/repl-query.js +155 -0
- package/cli/repl/commands/repl-quit.d.ts +2 -0
- package/cli/repl/commands/{quit.js → repl-quit.js} +1 -1
- package/cli/repl/commands/{version.d.ts → repl-version.d.ts} +1 -1
- package/cli/repl/commands/{version.js → repl-version.js} +4 -4
- package/cli/repl/core.d.ts +1 -2
- package/cli/repl/core.js +13 -13
- package/cli/repl/execute.d.ts +1 -2
- package/cli/repl/execute.js +2 -3
- package/cli/repl/print-version.js +3 -4
- package/cli/repl/server/connection.d.ts +1 -0
- package/cli/repl/server/connection.js +45 -12
- package/cli/repl/server/messages/{messages.d.ts → all-messages.d.ts} +8 -7
- package/cli/repl/server/messages/{messages.js → all-messages.js} +1 -1
- package/cli/repl/server/messages/{analysis.d.ts → message-analysis.d.ts} +2 -1
- package/cli/repl/server/messages/message-analysis.js +39 -0
- package/cli/repl/server/messages/{error.d.ts → message-error.d.ts} +1 -1
- package/cli/repl/server/messages/{error.js → message-error.js} +1 -1
- package/cli/repl/server/messages/{hello.d.ts → message-hello.d.ts} +4 -3
- package/cli/repl/server/messages/message-hello.js +20 -0
- package/cli/repl/server/messages/{lineage.d.ts → message-lineage.d.ts} +2 -1
- package/cli/repl/server/messages/message-lineage.js +25 -0
- package/cli/repl/server/messages/message-query.d.ts +16 -0
- package/cli/repl/server/messages/message-query.js +26 -0
- package/cli/repl/server/messages/{repl.d.ts → message-repl.d.ts} +3 -1
- package/cli/repl/server/messages/message-repl.js +53 -0
- package/cli/repl/server/messages/{slice.d.ts → message-slice.d.ts} +2 -1
- package/cli/repl/server/messages/{slice.js → message-slice.js} +14 -6
- package/cli/repl/server/net.d.ts +0 -1
- package/cli/repl/server/send.d.ts +1 -1
- package/cli/repl/server/send.js +2 -3
- package/cli/repl/server/server.js +2 -2
- package/cli/repl/server/validate.d.ts +1 -1
- package/cli/repl/server/validate.js +5 -6
- package/cli/run-script.d.ts +8 -0
- package/cli/run-script.js +18 -0
- package/cli/script-core/statistics-core.d.ts +2 -0
- package/cli/script-core/statistics-core.js +100 -0
- package/cli/script-core/statistics-helper-core.d.ts +2 -0
- package/cli/script-core/statistics-helper-core.js +81 -0
- package/cli/script-core/summarizer-core.d.ts +2 -0
- package/cli/script-core/summarizer-core.js +51 -0
- package/cli/statistics-app.js +3 -87
- package/cli/statistics-helper-app.js +3 -77
- package/cli/summarizer-app.js +2 -48
- package/config.d.ts +20 -4
- package/config.js +62 -36
- package/core/pipeline-executor.js +11 -1
- package/core/print/dataflow-printer.js +4 -5
- package/core/print/normalize-printer.js +4 -5
- package/core/print/parse-printer.js +1 -2
- package/core/print/print.js +2 -3
- package/core/print/slice-diff-ansi.js +1 -2
- package/core/steps/pipeline/create-pipeline.js +1 -2
- package/core/steps/pipeline/default-pipelines.d.ts +18 -18
- package/core/steps/pipeline/pipeline.js +1 -2
- package/dataflow/environments/append.js +1 -2
- package/dataflow/environments/built-in-config.d.ts +47 -0
- package/dataflow/environments/built-in-config.js +83 -0
- package/dataflow/environments/built-in.d.ts +49 -6
- package/dataflow/environments/built-in.js +29 -97
- package/dataflow/environments/clone.js +2 -2
- package/dataflow/environments/default-builtin-config.d.ts +5 -0
- package/dataflow/environments/default-builtin-config.js +83 -0
- package/dataflow/environments/define.js +1 -2
- package/dataflow/environments/diff.js +5 -6
- package/dataflow/environments/environment.js +8 -7
- package/dataflow/environments/identifier.d.ts +39 -8
- package/dataflow/environments/identifier.js +33 -0
- package/dataflow/environments/overwrite.d.ts +6 -5
- package/dataflow/environments/overwrite.js +16 -9
- package/dataflow/environments/resolve-by-name.d.ts +3 -1
- package/dataflow/environments/resolve-by-name.js +40 -8
- package/dataflow/environments/scoping.js +2 -3
- package/dataflow/extractor.js +25 -24
- package/dataflow/graph/dataflowgraph-builder.d.ts +139 -0
- package/dataflow/graph/dataflowgraph-builder.js +247 -0
- package/dataflow/graph/diff.js +12 -11
- package/dataflow/graph/edge.d.ts +2 -2
- package/dataflow/graph/edge.js +46 -20
- package/dataflow/graph/graph.d.ts +14 -6
- package/dataflow/graph/graph.js +25 -21
- package/dataflow/graph/quads.js +1 -2
- package/dataflow/graph/resolve-graph.d.ts +7 -0
- package/dataflow/graph/resolve-graph.js +51 -0
- package/dataflow/graph/vertex.d.ts +12 -4
- package/dataflow/graph/vertex.js +19 -11
- package/dataflow/info.d.ts +3 -7
- package/dataflow/info.js +7 -8
- package/dataflow/internal/linker.d.ts +3 -1
- package/dataflow/internal/linker.js +77 -32
- package/dataflow/internal/process/functions/call/argument/make-argument.js +5 -5
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +10 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +5 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +27 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +40 -26
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +30 -20
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +10 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +12 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +7 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +10 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +7 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +6 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +6 -5
- package/dataflow/internal/process/functions/call/common.js +30 -19
- package/dataflow/internal/process/functions/call/default-call-handling.js +1 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +8 -6
- package/dataflow/internal/process/functions/call/named-call-handling.js +7 -6
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +11 -7
- package/dataflow/internal/process/functions/process-argument.js +10 -8
- package/dataflow/internal/process/functions/process-parameter.js +8 -6
- package/dataflow/internal/process/process-named-call.js +3 -3
- package/dataflow/internal/process/process-symbol.js +5 -4
- package/dataflow/internal/process/process-uninteresting-leaf.js +1 -2
- package/dataflow/internal/process/process-value.js +5 -4
- package/dataflow/processor.js +1 -2
- package/documentation/data/dfg/doc-data-dfg-util.d.ts +20 -0
- package/documentation/data/dfg/doc-data-dfg-util.js +13 -0
- package/documentation/data/query/example-query-code.d.ts +1 -0
- package/documentation/data/query/example-query-code.js +25 -0
- package/documentation/data/server/doc-data-server-messages.d.ts +1 -0
- package/documentation/data/server/doc-data-server-messages.js +508 -0
- package/documentation/doc-util/doc-auto-gen.d.ts +7 -0
- package/documentation/doc-util/doc-auto-gen.js +9 -0
- package/documentation/doc-util/doc-cfg.d.ts +7 -0
- package/documentation/doc-util/doc-cfg.js +18 -0
- package/documentation/doc-util/doc-cli-option.d.ts +8 -0
- package/documentation/doc-util/doc-cli-option.js +36 -0
- package/documentation/doc-util/doc-code.d.ts +1 -0
- package/documentation/doc-util/doc-code.js +7 -0
- package/documentation/doc-util/doc-dfg.d.ts +21 -0
- package/documentation/doc-util/doc-dfg.js +93 -0
- package/documentation/doc-util/doc-docker.d.ts +1 -0
- package/documentation/doc-util/doc-docker.js +5 -0
- package/documentation/doc-util/doc-env.d.ts +2 -0
- package/documentation/doc-util/doc-env.js +20 -0
- package/documentation/doc-util/doc-files.d.ts +6 -0
- package/documentation/doc-util/doc-files.js +25 -0
- package/documentation/doc-util/doc-general.d.ts +2 -0
- package/documentation/doc-util/doc-general.js +16 -0
- package/documentation/doc-util/doc-hover-over.d.ts +1 -0
- package/documentation/doc-util/doc-hover-over.js +7 -0
- package/documentation/doc-util/doc-issue.d.ts +1 -0
- package/documentation/doc-util/doc-issue.js +6 -0
- package/documentation/doc-util/doc-ms.d.ts +1 -0
- package/documentation/doc-util/doc-ms.js +8 -0
- package/documentation/doc-util/doc-normalized-ast.d.ts +11 -0
- package/documentation/doc-util/doc-normalized-ast.js +71 -0
- package/documentation/doc-util/doc-query.d.ts +24 -0
- package/documentation/doc-util/doc-query.js +113 -0
- package/documentation/doc-util/doc-repl.d.ts +13 -0
- package/documentation/doc-util/doc-repl.js +79 -0
- package/documentation/doc-util/doc-server-message.d.ts +37 -0
- package/documentation/doc-util/doc-server-message.js +153 -0
- package/documentation/doc-util/doc-structure.d.ts +12 -0
- package/documentation/doc-util/doc-structure.js +21 -0
- package/documentation/doc-util/doc-types.d.ts +38 -0
- package/documentation/doc-util/doc-types.js +276 -0
- package/{r-bridge/data/print.js → documentation/print-capabilities-markdown.js} +8 -4
- package/documentation/print-dataflow-graph-wiki.d.ts +1 -0
- package/documentation/print-dataflow-graph-wiki.js +849 -0
- package/documentation/print-interface-wiki.d.ts +1 -0
- package/documentation/print-interface-wiki.js +401 -0
- package/documentation/print-normalized-ast-wiki.d.ts +1 -0
- package/documentation/print-normalized-ast-wiki.js +98 -0
- package/documentation/print-query-wiki.d.ts +1 -0
- package/documentation/print-query-wiki.js +215 -0
- package/package.json +29 -33
- package/queries/base-query-format.d.ts +11 -0
- package/{cli/repl/server/messages/hello.js → queries/base-query-format.js} +1 -1
- package/queries/call-context-query/call-context-query-executor.d.ts +11 -0
- package/queries/call-context-query/call-context-query-executor.js +255 -0
- package/queries/call-context-query/call-context-query-format.d.ts +72 -0
- package/queries/call-context-query/call-context-query-format.js +17 -0
- package/queries/query-schema.d.ts +7 -0
- package/queries/query-schema.js +31 -0
- package/queries/query.d.ts +35 -0
- package/queries/query.js +57 -0
- package/queries/two-layer-collector.d.ts +8 -0
- package/queries/two-layer-collector.js +31 -0
- package/queries/virtual-query/compound-query.d.ts +24 -0
- package/queries/virtual-query/compound-query.js +18 -0
- package/queries/virtual-query/virtual-queries.d.ts +15 -0
- package/queries/virtual-query/virtual-queries.js +8 -0
- package/r-bridge/data/data.d.ts +5 -0
- package/r-bridge/data/data.js +6 -0
- package/r-bridge/data/get.js +2 -3
- package/r-bridge/init.js +2 -2
- package/r-bridge/lang-4.x/ast/model/collect.js +1 -2
- package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +4 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +10 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/operators.js +27 -26
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +9 -9
- package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -2
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +26 -3
- package/r-bridge/lang-4.x/ast/model/processing/role.js +1 -2
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +23 -23
- package/r-bridge/lang-4.x/ast/model/processing/visitor.js +23 -23
- package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/type.js +221 -12
- package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +6 -5
- package/r-bridge/lang-4.x/ast/parser/xml/input-format.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then-else.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then.js +7 -7
- package/r-bridge/lang-4.x/ast/parser/xml/internal/expression/normalize-expression.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-argument.js +10 -10
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-call.js +18 -18
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-definition.js +8 -8
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-parameter.js +9 -9
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-break.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-for.js +10 -10
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-next.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-repeat.js +5 -5
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-while.js +7 -7
- package/r-bridge/lang-4.x/ast/parser/xml/internal/normalize-access.js +12 -12
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/normalize-binary.js +14 -14
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/normalize-unary.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/other/normalize-comment.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/other/normalize-line-directive.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-delimiter.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-expressions.js +13 -13
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-root.js +6 -6
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-single-node.js +19 -19
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-number.js +5 -5
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-string.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-symbol.js +2 -3
- package/r-bridge/lang-4.x/ast/parser/xml/normalize-meta.js +12 -12
- package/r-bridge/lang-4.x/convert-values.js +7 -7
- package/r-bridge/retriever.js +12 -11
- package/r-bridge/shell.d.ts +0 -1
- package/r-bridge/shell.js +6 -1
- package/reconstruct/auto-select/auto-select-defaults.js +1 -2
- package/reconstruct/auto-select/magic-comments.js +3 -3
- package/reconstruct/reconstruct.js +4 -3
- package/slicing/criterion/collect-all.js +1 -2
- package/slicing/criterion/parse.d.ts +1 -1
- package/slicing/criterion/parse.js +6 -5
- package/slicing/static/fingerprint.js +2 -3
- package/slicing/static/slice-call.js +9 -9
- package/slicing/static/static-slicer.js +5 -4
- package/statistics/features/common-syntax-probability.js +13 -13
- package/statistics/features/feature.d.ts +5 -9
- package/statistics/features/feature.js +2 -2
- package/statistics/features/post-processing.js +2 -3
- package/statistics/features/supported/assignments/assignments.js +3 -2
- package/statistics/features/supported/assignments/post-process.js +1 -2
- package/statistics/features/supported/comments/post-process.js +1 -2
- package/statistics/features/supported/control-flow/control-flow.js +4 -3
- package/statistics/features/supported/control-flow/post-process.js +1 -2
- package/statistics/features/supported/data-access/data-access.d.ts +2 -2
- package/statistics/features/supported/data-access/data-access.js +3 -2
- package/statistics/features/supported/data-access/post-process.js +1 -2
- package/statistics/features/supported/defined-functions/defined-functions.js +9 -7
- package/statistics/features/supported/defined-functions/post-process.d.ts +1 -1
- package/statistics/features/supported/defined-functions/post-process.js +2 -3
- package/statistics/features/supported/expression-list/post-process.js +1 -2
- package/statistics/features/supported/expression-list/{expression-list.js → statistics-expression-list.js} +4 -3
- package/statistics/features/supported/loops/loops.js +8 -7
- package/statistics/features/supported/loops/post-process.js +1 -2
- package/statistics/features/supported/used-functions/post-process.js +2 -3
- package/statistics/features/supported/used-functions/used-functions.d.ts +1 -1
- package/statistics/features/supported/used-functions/used-functions.js +4 -3
- package/statistics/features/supported/used-packages/post-process.js +1 -2
- package/statistics/features/supported/values/post-process.js +1 -2
- package/statistics/features/supported/variables/post-process.js +2 -3
- package/statistics/features/supported/variables/variables.js +2 -1
- package/statistics/meta-statistics.js +1 -2
- package/statistics/output/print-stats.js +4 -5
- package/statistics/output/statistics-file.js +5 -5
- package/statistics/statistics.js +2 -3
- package/statistics/summarizer/auto-detect.js +1 -2
- package/statistics/summarizer/post-process/clusterer.js +1 -2
- package/statistics/summarizer/post-process/file-based-count.js +2 -3
- package/statistics/summarizer/post-process/histogram.js +3 -4
- package/statistics/summarizer/post-process/post-process-output.js +2 -3
- package/statistics/summarizer/second-phase/process.d.ts +2 -0
- package/statistics/summarizer/second-phase/process.js +2 -2
- package/statistics/summarizer/summarizer.js +8 -1
- package/util/ansi.d.ts +1 -0
- package/util/ansi.js +27 -4
- package/util/args.js +2 -3
- package/util/arrays.js +8 -9
- package/util/assert.js +5 -6
- package/util/bimap.d.ts +4 -4
- package/util/cfg/cfg.d.ts +1 -0
- package/util/cfg/cfg.js +8 -5
- package/util/cfg/visitor.d.ts +8 -13
- package/util/cfg/visitor.js +22 -56
- package/util/diff.js +1 -2
- package/util/files.d.ts +0 -1
- package/util/files.js +11 -8
- package/util/json.js +2 -3
- package/util/mermaid/ast.js +7 -7
- package/util/mermaid/cfg.js +2 -3
- package/util/mermaid/dfg.d.ts +12 -4
- package/util/mermaid/dfg.js +28 -16
- package/util/mermaid/mermaid.js +5 -4
- package/util/numbers.js +1 -2
- package/util/objects.d.ts +7 -0
- package/util/objects.js +13 -3
- package/util/os.js +1 -2
- package/util/quads.js +5 -5
- package/util/random.js +2 -2
- package/util/range.js +8 -9
- package/util/schema.d.ts +11 -0
- package/util/schema.js +75 -0
- package/util/set.js +2 -3
- package/util/strings.js +3 -4
- package/util/summarizer.js +4 -4
- package/util/text.d.ts +1 -0
- package/util/text.js +20 -0
- package/util/time.js +1 -2
- package/util/version.js +2 -3
- package/cli/repl/commands/lineage.d.ts +0 -15
- package/cli/repl/commands/quit.d.ts +0 -2
- package/cli/repl/server/messages/analysis.js +0 -21
- package/cli/repl/server/messages/lineage.js +0 -17
- package/cli/repl/server/messages/repl.js +0 -37
- /package/cli/repl/commands/{main.d.ts → repl-main.d.ts} +0 -0
- /package/{r-bridge/data/print.d.ts → documentation/print-capabilities-markdown.d.ts} +0 -0
- /package/statistics/features/supported/expression-list/{expression-list.d.ts → statistics-expression-list.d.ts} +0 -0
package/dataflow/graph/graph.js
CHANGED
|
@@ -1,29 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DataflowGraph =
|
|
3
|
+
exports.DataflowGraph = void 0;
|
|
4
|
+
exports.isPositionalArgument = isPositionalArgument;
|
|
5
|
+
exports.isNamedArgument = isNamedArgument;
|
|
6
|
+
exports.getReferenceOfArgument = getReferenceOfArgument;
|
|
4
7
|
const assert_1 = require("../../util/assert");
|
|
8
|
+
const edge_1 = require("./edge");
|
|
5
9
|
const diff_1 = require("./diff");
|
|
10
|
+
const vertex_1 = require("./vertex");
|
|
6
11
|
const arrays_1 = require("../../util/arrays");
|
|
7
12
|
const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
8
13
|
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
9
14
|
const environment_1 = require("../environments/environment");
|
|
10
15
|
const clone_1 = require("../environments/clone");
|
|
16
|
+
const json_1 = require("../../util/json");
|
|
11
17
|
const built_in_1 = require("../environments/built-in");
|
|
18
|
+
const logger_1 = require("../logger");
|
|
12
19
|
function isPositionalArgument(arg) {
|
|
13
20
|
return arg !== r_function_call_1.EmptyArgument && arg.name === undefined;
|
|
14
21
|
}
|
|
15
|
-
exports.isPositionalArgument = isPositionalArgument;
|
|
16
22
|
function isNamedArgument(arg) {
|
|
17
23
|
return arg !== r_function_call_1.EmptyArgument && arg.name !== undefined;
|
|
18
24
|
}
|
|
19
|
-
exports.isNamedArgument = isNamedArgument;
|
|
20
25
|
function getReferenceOfArgument(arg) {
|
|
21
26
|
if (arg !== r_function_call_1.EmptyArgument) {
|
|
22
27
|
return arg.nodeId;
|
|
23
28
|
}
|
|
24
29
|
return undefined;
|
|
25
30
|
}
|
|
26
|
-
exports.getReferenceOfArgument = getReferenceOfArgument;
|
|
27
31
|
function extractEdgeIds(from, to) {
|
|
28
32
|
const fromId = typeof from === 'object' ? from.nodeId : from;
|
|
29
33
|
const toId = typeof to === 'object' ? to.nodeId : to;
|
|
@@ -164,9 +168,9 @@ class DataflowGraph {
|
|
|
164
168
|
if (oldVertex !== undefined) {
|
|
165
169
|
return this;
|
|
166
170
|
}
|
|
167
|
-
const fallback = vertex.tag ===
|
|
171
|
+
const fallback = vertex.tag === vertex_1.VertexType.VariableDefinition || vertex.tag === vertex_1.VertexType.Use || vertex.tag === vertex_1.VertexType.Value || (vertex.tag === vertex_1.VertexType.FunctionCall && vertex.onlyBuiltin) ? undefined : DataflowGraph.DEFAULT_ENVIRONMENT;
|
|
168
172
|
// keep a clone of the original environment
|
|
169
|
-
const environment = vertex.environment
|
|
173
|
+
const environment = vertex.environment ? (0, clone_1.cloneEnvironmentInformation)(vertex.environment) : fallback;
|
|
170
174
|
this.vertexInformation.set(vertex.id, {
|
|
171
175
|
...vertex,
|
|
172
176
|
environment
|
|
@@ -182,14 +186,13 @@ class DataflowGraph {
|
|
|
182
186
|
* and target will be sorted so that `from` has the lower, and `to` the higher id (default ordering).
|
|
183
187
|
* Please note that this will never make edges to {@link BuiltIn} as they are not part of the graph.
|
|
184
188
|
*/
|
|
185
|
-
addEdge(from, to,
|
|
189
|
+
addEdge(from, to, type) {
|
|
186
190
|
const { fromId, toId } = extractEdgeIds(from, to);
|
|
187
|
-
const { type, ...rest } = edgeInfo;
|
|
188
191
|
if (fromId === toId || toId === built_in_1.BuiltIn) {
|
|
189
192
|
return this;
|
|
190
193
|
}
|
|
191
194
|
/* we now that we pass all required arguments */
|
|
192
|
-
const edge = { types: type
|
|
195
|
+
const edge = { types: type };
|
|
193
196
|
const existingFrom = this.edgeInformation.get(fromId);
|
|
194
197
|
const edgeInFrom = existingFrom?.get(toId);
|
|
195
198
|
if (edgeInFrom === undefined) {
|
|
@@ -208,10 +211,10 @@ class DataflowGraph {
|
|
|
208
211
|
return this;
|
|
209
212
|
}
|
|
210
213
|
installEdge(type, toId, fromId, edge) {
|
|
211
|
-
if (type ===
|
|
214
|
+
if (type === edge_1.EdgeType.DefinesOnCall) {
|
|
212
215
|
const otherEdge = {
|
|
213
216
|
...edge,
|
|
214
|
-
types:
|
|
217
|
+
types: edge_1.EdgeType.DefinedByOnCall
|
|
215
218
|
};
|
|
216
219
|
const existingTo = this.edgeInformation.get(toId);
|
|
217
220
|
if (existingTo === undefined) {
|
|
@@ -275,11 +278,11 @@ class DataflowGraph {
|
|
|
275
278
|
setDefinitionOfVertex(reference) {
|
|
276
279
|
const vertex = this.getVertex(reference.nodeId, true);
|
|
277
280
|
(0, assert_1.guard)(vertex !== undefined, () => `node must be defined for ${JSON.stringify(reference)} to set reference`);
|
|
278
|
-
if (vertex.tag ===
|
|
281
|
+
if (vertex.tag === vertex_1.VertexType.FunctionDefinition || vertex.tag === vertex_1.VertexType.VariableDefinition) {
|
|
279
282
|
vertex.controlDependencies = reference.controlDependencies;
|
|
280
283
|
}
|
|
281
284
|
else {
|
|
282
|
-
this.vertexInformation.set(reference.nodeId, { ...vertex, tag:
|
|
285
|
+
this.vertexInformation.set(reference.nodeId, { ...vertex, tag: vertex_1.VertexType.VariableDefinition });
|
|
283
286
|
}
|
|
284
287
|
}
|
|
285
288
|
/**
|
|
@@ -288,9 +291,8 @@ class DataflowGraph {
|
|
|
288
291
|
*/
|
|
289
292
|
updateToFunctionCall(info) {
|
|
290
293
|
const vertex = this.getVertex(info.id, true);
|
|
291
|
-
(0, assert_1.guard)(vertex !== undefined, () => `node must be
|
|
292
|
-
|
|
293
|
-
this.vertexInformation.set(info.id, { ...vertex, ...info, tag: "function-call" /* VertexType.FunctionCall */ });
|
|
294
|
+
(0, assert_1.guard)(vertex !== undefined && (vertex.tag === vertex_1.VertexType.Use || vertex.tag === vertex_1.VertexType.Value), () => `node must be a use or value node for ${JSON.stringify(info.id)} to update it to a function call but is ${vertex?.tag}`);
|
|
295
|
+
this.vertexInformation.set(info.id, { ...vertex, ...info, tag: vertex_1.VertexType.FunctionCall });
|
|
294
296
|
}
|
|
295
297
|
/** If you do not pass the `to` node, this will just mark the node as maybe */
|
|
296
298
|
addControlDependency(from, to, when) {
|
|
@@ -323,15 +325,17 @@ class DataflowGraph {
|
|
|
323
325
|
}
|
|
324
326
|
exports.DataflowGraph = DataflowGraph;
|
|
325
327
|
function mergeNodeInfos(current, next) {
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
328
|
+
if (current.tag !== next.tag) {
|
|
329
|
+
logger_1.dataflowLogger.warn(`nodes to be joined for the same id should have the same tag, but ${JSON.stringify(current, json_1.jsonReplacer)} vs. ${JSON.stringify(next, json_1.jsonReplacer)} -- we are currently not handling cases in which vertices may be either! Keeping current.`);
|
|
330
|
+
return { ...current };
|
|
331
|
+
}
|
|
332
|
+
if (current.tag === vertex_1.VertexType.VariableDefinition) {
|
|
329
333
|
(0, assert_1.guard)(current.scope === next.scope, 'nodes to be joined for the same id must have the same scope');
|
|
330
334
|
}
|
|
331
|
-
else if (current.tag ===
|
|
335
|
+
else if (current.tag === vertex_1.VertexType.FunctionCall) {
|
|
332
336
|
(0, assert_1.guard)((0, diff_1.equalFunctionArguments)(current.id, current.args, next.args), 'nodes to be joined for the same id must have the same function call information');
|
|
333
337
|
}
|
|
334
|
-
else if (current.tag ===
|
|
338
|
+
else if (current.tag === vertex_1.VertexType.FunctionDefinition) {
|
|
335
339
|
(0, assert_1.guard)(current.scope === next.scope, 'nodes to be joined for the same id must have the same scope');
|
|
336
340
|
(0, assert_1.guard)((0, arrays_1.arrayEqual)(current.exitPoints, next.exitPoints), 'nodes to be joined must have same exist points');
|
|
337
341
|
}
|
package/dataflow/graph/quads.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.df2quads =
|
|
3
|
+
exports.df2quads = df2quads;
|
|
4
4
|
const quads_1 = require("../../util/quads");
|
|
5
5
|
const edge_1 = require("./edge");
|
|
6
6
|
/**
|
|
@@ -23,5 +23,4 @@ function df2quads(graph, config) {
|
|
|
23
23
|
})))
|
|
24
24
|
}, config);
|
|
25
25
|
}
|
|
26
|
-
exports.df2quads = df2quads;
|
|
27
26
|
//# sourceMappingURL=quads.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { DataflowGraph } from './graph';
|
|
2
|
+
import { type AstIdMap } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
3
|
+
/**
|
|
4
|
+
* Resolves the dataflow graph ids from slicing criterion form to ids.
|
|
5
|
+
* This returns a **new** graph with the resolved ids.
|
|
6
|
+
*/
|
|
7
|
+
export declare function resolveDataflowGraph(graph: DataflowGraph, idMap?: AstIdMap): DataflowGraph;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveDataflowGraph = resolveDataflowGraph;
|
|
4
|
+
const graph_1 = require("./graph");
|
|
5
|
+
const assert_1 = require("../../util/assert");
|
|
6
|
+
const parse_1 = require("../../slicing/criterion/parse");
|
|
7
|
+
const edge_1 = require("./edge");
|
|
8
|
+
/**
|
|
9
|
+
* Resolves the dataflow graph ids from slicing criterion form to ids.
|
|
10
|
+
* This returns a **new** graph with the resolved ids.
|
|
11
|
+
*/
|
|
12
|
+
function resolveDataflowGraph(graph, idMap) {
|
|
13
|
+
const resolveMap = idMap ?? graph.idMap;
|
|
14
|
+
(0, assert_1.guard)(resolveMap !== undefined, 'idMap must be provided to resolve the graph');
|
|
15
|
+
const cache = new Map();
|
|
16
|
+
const resolve = (id) => {
|
|
17
|
+
const cached = cache.get(id);
|
|
18
|
+
if (cached !== undefined) {
|
|
19
|
+
return cached;
|
|
20
|
+
}
|
|
21
|
+
let resolved;
|
|
22
|
+
try {
|
|
23
|
+
resolved = (0, parse_1.slicingCriterionToId)(id, resolveMap);
|
|
24
|
+
}
|
|
25
|
+
catch (e) {
|
|
26
|
+
/* just keep it :D */
|
|
27
|
+
resolved = id;
|
|
28
|
+
}
|
|
29
|
+
cache.set(id, resolved);
|
|
30
|
+
return resolved;
|
|
31
|
+
};
|
|
32
|
+
const resultGraph = new graph_1.DataflowGraph(resolveMap);
|
|
33
|
+
const roots = graph.rootIds();
|
|
34
|
+
/* recreate vertices */
|
|
35
|
+
for (const [id, vertex] of graph.vertices(true)) {
|
|
36
|
+
resultGraph.addVertex({
|
|
37
|
+
...vertex,
|
|
38
|
+
id: resolve(id)
|
|
39
|
+
}, roots.has(id));
|
|
40
|
+
}
|
|
41
|
+
/* recreate edges */
|
|
42
|
+
for (const [from, targets] of graph.edges()) {
|
|
43
|
+
for (const [to, info] of targets) {
|
|
44
|
+
for (const type of (0, edge_1.splitEdgeTypes)(info.types)) {
|
|
45
|
+
resultGraph.addEdge(resolve(from), resolve(to), type);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
return resultGraph;
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=resolve-graph.js.map
|
|
@@ -4,7 +4,7 @@ import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-i
|
|
|
4
4
|
import type { REnvironmentInformation } from '../environments/environment';
|
|
5
5
|
import type { ControlDependency } from '../info';
|
|
6
6
|
export type DataflowGraphVertices<Vertex extends DataflowGraphVertexInfo = DataflowGraphVertexInfo> = Map<NodeId, Vertex>;
|
|
7
|
-
export declare
|
|
7
|
+
export declare enum VertexType {
|
|
8
8
|
Value = "value",
|
|
9
9
|
Use = "use",
|
|
10
10
|
FunctionCall = "function-call",
|
|
@@ -36,7 +36,10 @@ interface DataflowGraphVertexBase extends MergeableRecord {
|
|
|
36
36
|
*/
|
|
37
37
|
controlDependencies: ControlDependency[] | undefined;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
/**
|
|
40
|
+
* Marker vertex for a value in the dataflow of the program.
|
|
41
|
+
*/
|
|
42
|
+
export interface DataflowGraphVertexValue extends DataflowGraphVertexBase {
|
|
40
43
|
readonly tag: VertexType.Value;
|
|
41
44
|
readonly environment?: undefined;
|
|
42
45
|
}
|
|
@@ -45,6 +48,7 @@ export interface DataflowGraphValue extends DataflowGraphVertexBase {
|
|
|
45
48
|
*/
|
|
46
49
|
export interface DataflowGraphVertexUse extends DataflowGraphVertexBase {
|
|
47
50
|
readonly tag: VertexType.Use;
|
|
51
|
+
/** Does not require an environment to be attached. If we promote the use to a function call, we attach the environment later. */
|
|
48
52
|
readonly environment?: undefined;
|
|
49
53
|
}
|
|
50
54
|
/**
|
|
@@ -59,9 +63,11 @@ export interface DataflowGraphVertexFunctionCall extends DataflowGraphVertexBase
|
|
|
59
63
|
* have the compound name (e.g., `[<-`).
|
|
60
64
|
*/
|
|
61
65
|
readonly name: string;
|
|
66
|
+
/** The arguments of the function call, in order (as they are passed to the respective call if executed in R. */
|
|
62
67
|
args: FunctionArgument[];
|
|
63
68
|
/** a performance flag to indicate that the respective call is _only_ calling a builtin function without any df graph attached */
|
|
64
69
|
onlyBuiltin: boolean;
|
|
70
|
+
/** The environment attached to the call (if such an attachment is necessary, e.g., because it represents the calling closure */
|
|
65
71
|
environment: REnvironmentInformation | undefined;
|
|
66
72
|
}
|
|
67
73
|
/**
|
|
@@ -69,6 +75,7 @@ export interface DataflowGraphVertexFunctionCall extends DataflowGraphVertexBase
|
|
|
69
75
|
*/
|
|
70
76
|
export interface DataflowGraphVertexVariableDefinition extends DataflowGraphVertexBase {
|
|
71
77
|
readonly tag: VertexType.VariableDefinition;
|
|
78
|
+
/** Does not require an environment, those are attached to the call */
|
|
72
79
|
readonly environment?: undefined;
|
|
73
80
|
}
|
|
74
81
|
export interface DataflowGraphVertexFunctionDefinition extends DataflowGraphVertexBase {
|
|
@@ -76,6 +83,7 @@ export interface DataflowGraphVertexFunctionDefinition extends DataflowGraphVert
|
|
|
76
83
|
/**
|
|
77
84
|
* The static subflow of the function definition, constructed within {@link processFunctionDefinition}.
|
|
78
85
|
* If the vertex is (for example) a function, it can have a subgraph which is used as a template for each call.
|
|
86
|
+
* This is the `body` of the function.
|
|
79
87
|
*/
|
|
80
88
|
subflow: DataflowFunctionFlowInformation;
|
|
81
89
|
/**
|
|
@@ -85,9 +93,9 @@ export interface DataflowGraphVertexFunctionDefinition extends DataflowGraphVert
|
|
|
85
93
|
exitPoints: readonly NodeId[];
|
|
86
94
|
environment?: REnvironmentInformation;
|
|
87
95
|
}
|
|
88
|
-
export type DataflowGraphVertexArgument = DataflowGraphVertexUse | DataflowGraphVertexVariableDefinition | DataflowGraphVertexFunctionDefinition | DataflowGraphVertexFunctionCall |
|
|
96
|
+
export type DataflowGraphVertexArgument = DataflowGraphVertexUse | DataflowGraphVertexVariableDefinition | DataflowGraphVertexFunctionDefinition | DataflowGraphVertexFunctionCall | DataflowGraphVertexValue;
|
|
89
97
|
export type DataflowGraphVertexInfo = Required<DataflowGraphVertexArgument>;
|
|
90
|
-
export declare function isValueVertex(vertex: DataflowGraphVertexBase): vertex is
|
|
98
|
+
export declare function isValueVertex(vertex: DataflowGraphVertexBase): vertex is DataflowGraphVertexValue;
|
|
91
99
|
export declare function isUseVertex(vertex: DataflowGraphVertexBase): vertex is DataflowGraphVertexUse;
|
|
92
100
|
export declare function isFunctionCallVertex(vertex: DataflowGraphVertexBase): vertex is DataflowGraphVertexFunctionCall;
|
|
93
101
|
export declare function isVariableDefinitionVertex(vertex: DataflowGraphVertexBase): vertex is DataflowGraphVertexVariableDefinition;
|
package/dataflow/graph/vertex.js
CHANGED
|
@@ -1,24 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.VertexType = void 0;
|
|
4
|
+
exports.isValueVertex = isValueVertex;
|
|
5
|
+
exports.isUseVertex = isUseVertex;
|
|
6
|
+
exports.isFunctionCallVertex = isFunctionCallVertex;
|
|
7
|
+
exports.isVariableDefinitionVertex = isVariableDefinitionVertex;
|
|
8
|
+
exports.isFunctionDefinitionVertex = isFunctionDefinitionVertex;
|
|
9
|
+
var VertexType;
|
|
10
|
+
(function (VertexType) {
|
|
11
|
+
VertexType["Value"] = "value";
|
|
12
|
+
VertexType["Use"] = "use";
|
|
13
|
+
VertexType["FunctionCall"] = "function-call";
|
|
14
|
+
VertexType["VariableDefinition"] = "variable-definition";
|
|
15
|
+
VertexType["FunctionDefinition"] = "function-definition";
|
|
16
|
+
})(VertexType || (exports.VertexType = VertexType = {}));
|
|
4
17
|
function isValueVertex(vertex) {
|
|
5
|
-
return vertex.tag ===
|
|
18
|
+
return vertex.tag === VertexType.Value;
|
|
6
19
|
}
|
|
7
|
-
exports.isValueVertex = isValueVertex;
|
|
8
20
|
function isUseVertex(vertex) {
|
|
9
|
-
return vertex.tag ===
|
|
21
|
+
return vertex.tag === VertexType.Use;
|
|
10
22
|
}
|
|
11
|
-
exports.isUseVertex = isUseVertex;
|
|
12
23
|
function isFunctionCallVertex(vertex) {
|
|
13
|
-
return vertex.tag ===
|
|
24
|
+
return vertex.tag === VertexType.FunctionCall;
|
|
14
25
|
}
|
|
15
|
-
exports.isFunctionCallVertex = isFunctionCallVertex;
|
|
16
26
|
function isVariableDefinitionVertex(vertex) {
|
|
17
|
-
return vertex.tag ===
|
|
27
|
+
return vertex.tag === VertexType.VariableDefinition;
|
|
18
28
|
}
|
|
19
|
-
exports.isVariableDefinitionVertex = isVariableDefinitionVertex;
|
|
20
29
|
function isFunctionDefinitionVertex(vertex) {
|
|
21
|
-
return vertex.tag ===
|
|
30
|
+
return vertex.tag === VertexType.FunctionDefinition;
|
|
22
31
|
}
|
|
23
|
-
exports.isFunctionDefinitionVertex = isFunctionDefinitionVertex;
|
|
24
32
|
//# sourceMappingURL=vertex.js.map
|
package/dataflow/info.d.ts
CHANGED
|
@@ -29,15 +29,11 @@ export interface ExitPoint {
|
|
|
29
29
|
readonly controlDependencies: ControlDependency[] | undefined;
|
|
30
30
|
}
|
|
31
31
|
export declare function addNonDefaultExitPoints(existing: ExitPoint[], add: readonly ExitPoint[]): void;
|
|
32
|
-
/** The control flow information for the current
|
|
32
|
+
/** The control flow information for the current DataflowInformation. */
|
|
33
33
|
export interface DataflowCfgInformation {
|
|
34
|
-
/**
|
|
35
|
-
* The entry node into the subgraph
|
|
36
|
-
*/
|
|
34
|
+
/** The entry node into the subgraph */
|
|
37
35
|
entryPoint: NodeId;
|
|
38
|
-
/**
|
|
39
|
-
* All already identified exit points (active 'return'/'break'/'next'-likes) of the respective structure.
|
|
40
|
-
*/
|
|
36
|
+
/** All already identified exit points (active 'return'/'break'/'next'-likes) of the respective structure. */
|
|
41
37
|
exitPoints: readonly ExitPoint[];
|
|
42
38
|
}
|
|
43
39
|
/**
|
package/dataflow/info.js
CHANGED
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.addNonDefaultExitPoints = addNonDefaultExitPoints;
|
|
4
|
+
exports.initializeCleanDataflowInformation = initializeCleanDataflowInformation;
|
|
5
|
+
exports.happensInEveryBranch = happensInEveryBranch;
|
|
6
|
+
exports.alwaysExits = alwaysExits;
|
|
7
|
+
exports.filterOutLoopExitPoints = filterOutLoopExitPoints;
|
|
8
|
+
exports.diffControlDependency = diffControlDependency;
|
|
9
|
+
exports.diffControlDependencies = diffControlDependencies;
|
|
4
10
|
const graph_1 = require("./graph/graph");
|
|
5
11
|
function addNonDefaultExitPoints(existing, add) {
|
|
6
12
|
existing.push(...add.filter(({ type }) => type !== 0 /* ExitPointType.Default */));
|
|
7
13
|
}
|
|
8
|
-
exports.addNonDefaultExitPoints = addNonDefaultExitPoints;
|
|
9
14
|
function initializeCleanDataflowInformation(entryPoint, data) {
|
|
10
15
|
return {
|
|
11
16
|
unknownReferences: [],
|
|
@@ -17,7 +22,6 @@ function initializeCleanDataflowInformation(entryPoint, data) {
|
|
|
17
22
|
exitPoints: [{ nodeId: entryPoint, type: 0 /* ExitPointType.Default */, controlDependencies: undefined }]
|
|
18
23
|
};
|
|
19
24
|
}
|
|
20
|
-
exports.initializeCleanDataflowInformation = initializeCleanDataflowInformation;
|
|
21
25
|
function happensInEveryBranch(controlDependencies) {
|
|
22
26
|
if (controlDependencies === undefined) {
|
|
23
27
|
/* the cds are unconstrained */
|
|
@@ -39,15 +43,12 @@ function happensInEveryBranch(controlDependencies) {
|
|
|
39
43
|
}
|
|
40
44
|
return trues.every(id => falseSet.has(id));
|
|
41
45
|
}
|
|
42
|
-
exports.happensInEveryBranch = happensInEveryBranch;
|
|
43
46
|
function alwaysExits(data) {
|
|
44
47
|
return data.exitPoints?.some(e => e.type !== 0 /* ExitPointType.Default */ && happensInEveryBranch(e.controlDependencies)) ?? false;
|
|
45
48
|
}
|
|
46
|
-
exports.alwaysExits = alwaysExits;
|
|
47
49
|
function filterOutLoopExitPoints(exitPoints) {
|
|
48
50
|
return exitPoints.filter(({ type }) => type === 1 /* ExitPointType.Return */ || type === 0 /* ExitPointType.Default */);
|
|
49
51
|
}
|
|
50
|
-
exports.filterOutLoopExitPoints = filterOutLoopExitPoints;
|
|
51
52
|
function diffControlDependency(a, b, info) {
|
|
52
53
|
if (a === undefined || b === undefined) {
|
|
53
54
|
if (a !== b) {
|
|
@@ -62,7 +63,6 @@ function diffControlDependency(a, b, info) {
|
|
|
62
63
|
info.report.addComment(`${info.position}Different control dependency when. ${info.leftname}: ${a.when} vs. ${info.rightname}: ${b.when}`);
|
|
63
64
|
}
|
|
64
65
|
}
|
|
65
|
-
exports.diffControlDependency = diffControlDependency;
|
|
66
66
|
function diffControlDependencies(a, b, info) {
|
|
67
67
|
if (a === undefined || b === undefined) {
|
|
68
68
|
if (a !== b) {
|
|
@@ -77,5 +77,4 @@ function diffControlDependencies(a, b, info) {
|
|
|
77
77
|
diffControlDependency(a[i], b[i], { ...info, position: `${info.position}Control dependency at index: ${i}: ` });
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
|
-
exports.diffControlDependencies = diffControlDependencies;
|
|
81
80
|
//# sourceMappingURL=info.js.map
|
|
@@ -7,7 +7,7 @@ import type { AstIdMap, ParentInformation } from '../../r-bridge/lang-4.x/ast/mo
|
|
|
7
7
|
import type { DataflowGraphVertexFunctionCall, DataflowGraphVertexFunctionDefinition, DataflowGraphVertexInfo } from '../graph/vertex';
|
|
8
8
|
import type { REnvironmentInformation } from '../environments/environment';
|
|
9
9
|
export type NameIdMap = DefaultMap<string, IdentifierReference[]>;
|
|
10
|
-
export declare function findNonLocalReads(graph: DataflowGraph): IdentifierReference[];
|
|
10
|
+
export declare function findNonLocalReads(graph: DataflowGraph, ignore: readonly IdentifierReference[]): IdentifierReference[];
|
|
11
11
|
export declare function produceNameSharedIdMap(references: IdentifierReference[]): NameIdMap;
|
|
12
12
|
export declare function linkArgumentsOnCall(args: FunctionArgument[], params: RParameter<ParentInformation>[], graph: DataflowGraph): void;
|
|
13
13
|
export declare function linkFunctionCallWithSingleTarget(graph: DataflowGraph, def: DataflowGraphVertexFunctionDefinition, info: DataflowGraphVertexFunctionCall, idMap: AstIdMap): void;
|
|
@@ -23,6 +23,8 @@ export declare function linkFunctionCalls(graph: DataflowGraph, idMap: AstIdMap,
|
|
|
23
23
|
functionCall: NodeId;
|
|
24
24
|
called: readonly DataflowGraphVertexInfo[];
|
|
25
25
|
}[];
|
|
26
|
+
/** convenience function returning all known call targets */
|
|
27
|
+
export declare function getAllFunctionCallTargets(call: NodeId, graph: DataflowGraph): NodeId[];
|
|
26
28
|
export declare function getAllLinkedFunctionDefinitions(functionDefinitionReadIds: ReadonlySet<NodeId>, dataflowGraph: DataflowGraph): Set<DataflowGraphVertexInfo>;
|
|
27
29
|
/**
|
|
28
30
|
* This method links a set of read variables to definitions in an environment.
|