@eagleoutice/flowr 2.0.25 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/benchmark/slicer.js +2 -1
- package/benchmark/stats/print.js +3 -4
- package/benchmark/stats/size-of.js +9 -7
- package/benchmark/summarizer/first-phase/input.d.ts +0 -1
- package/benchmark/summarizer/first-phase/input.js +2 -3
- package/benchmark/summarizer/first-phase/process.js +7 -7
- package/benchmark/summarizer/second-phase/graph.js +1 -2
- package/benchmark/summarizer/second-phase/process.d.ts +0 -1
- package/benchmark/summarizer/second-phase/process.js +4 -5
- package/benchmark/summarizer/summarizer.js +7 -1
- package/cli/benchmark-app.js +6 -1
- package/cli/common/features.js +2 -3
- package/cli/common/script.js +2 -3
- package/cli/common/scripts-info.d.ts +69 -1
- package/cli/common/scripts-info.js +6 -6
- package/cli/flowr-main-options.d.ts +4 -0
- package/cli/flowr-main-options.js +88 -0
- package/cli/flowr.d.ts +3 -3
- package/cli/flowr.js +22 -31
- package/cli/repl/commands/{cfg.d.ts → repl-cfg.d.ts} +1 -1
- package/cli/repl/commands/{cfg.js → repl-cfg.js} +3 -3
- package/cli/repl/commands/{commands.d.ts → repl-commands.d.ts} +3 -1
- package/cli/repl/commands/{commands.js → repl-commands.js} +56 -35
- package/cli/repl/commands/{dataflow.d.ts → repl-dataflow.d.ts} +1 -1
- package/cli/repl/commands/{dataflow.js → repl-dataflow.js} +2 -2
- package/cli/repl/commands/{execute.d.ts → repl-execute.d.ts} +1 -1
- package/cli/repl/commands/{execute.js → repl-execute.js} +3 -3
- package/cli/repl/commands/repl-lineage.d.ts +15 -0
- package/cli/repl/commands/{lineage.js → repl-lineage.js} +14 -12
- package/cli/repl/commands/{main.js → repl-main.js} +1 -1
- package/cli/repl/commands/{normalize.d.ts → repl-normalize.d.ts} +1 -1
- package/cli/repl/commands/{normalize.js → repl-normalize.js} +3 -3
- package/cli/repl/commands/{parse.d.ts → repl-parse.d.ts} +1 -1
- package/cli/repl/commands/{parse.js → repl-parse.js} +3 -2
- package/cli/repl/commands/repl-query.d.ts +8 -0
- package/cli/repl/commands/repl-query.js +155 -0
- package/cli/repl/commands/repl-quit.d.ts +2 -0
- package/cli/repl/commands/{quit.js → repl-quit.js} +1 -1
- package/cli/repl/commands/{version.d.ts → repl-version.d.ts} +1 -1
- package/cli/repl/commands/{version.js → repl-version.js} +4 -4
- package/cli/repl/core.d.ts +1 -2
- package/cli/repl/core.js +13 -13
- package/cli/repl/execute.d.ts +1 -2
- package/cli/repl/execute.js +2 -3
- package/cli/repl/print-version.js +3 -4
- package/cli/repl/server/connection.d.ts +1 -0
- package/cli/repl/server/connection.js +45 -12
- package/cli/repl/server/messages/{messages.d.ts → all-messages.d.ts} +8 -7
- package/cli/repl/server/messages/{messages.js → all-messages.js} +1 -1
- package/cli/repl/server/messages/{analysis.d.ts → message-analysis.d.ts} +2 -1
- package/cli/repl/server/messages/message-analysis.js +39 -0
- package/cli/repl/server/messages/{error.d.ts → message-error.d.ts} +1 -1
- package/cli/repl/server/messages/{error.js → message-error.js} +1 -1
- package/cli/repl/server/messages/{hello.d.ts → message-hello.d.ts} +4 -3
- package/cli/repl/server/messages/message-hello.js +20 -0
- package/cli/repl/server/messages/{lineage.d.ts → message-lineage.d.ts} +2 -1
- package/cli/repl/server/messages/message-lineage.js +25 -0
- package/cli/repl/server/messages/message-query.d.ts +16 -0
- package/cli/repl/server/messages/message-query.js +26 -0
- package/cli/repl/server/messages/{repl.d.ts → message-repl.d.ts} +3 -1
- package/cli/repl/server/messages/message-repl.js +53 -0
- package/cli/repl/server/messages/{slice.d.ts → message-slice.d.ts} +2 -1
- package/cli/repl/server/messages/{slice.js → message-slice.js} +14 -6
- package/cli/repl/server/net.d.ts +0 -1
- package/cli/repl/server/send.d.ts +1 -1
- package/cli/repl/server/send.js +2 -3
- package/cli/repl/server/server.js +2 -2
- package/cli/repl/server/validate.d.ts +1 -1
- package/cli/repl/server/validate.js +5 -6
- package/cli/run-script.d.ts +8 -0
- package/cli/run-script.js +18 -0
- package/cli/script-core/statistics-core.d.ts +2 -0
- package/cli/script-core/statistics-core.js +100 -0
- package/cli/script-core/statistics-helper-core.d.ts +2 -0
- package/cli/script-core/statistics-helper-core.js +81 -0
- package/cli/script-core/summarizer-core.d.ts +2 -0
- package/cli/script-core/summarizer-core.js +51 -0
- package/cli/statistics-app.js +3 -87
- package/cli/statistics-helper-app.js +3 -77
- package/cli/summarizer-app.js +2 -48
- package/config.d.ts +20 -4
- package/config.js +62 -36
- package/core/pipeline-executor.js +11 -1
- package/core/print/dataflow-printer.js +4 -5
- package/core/print/normalize-printer.js +4 -5
- package/core/print/parse-printer.js +1 -2
- package/core/print/print.js +2 -3
- package/core/print/slice-diff-ansi.js +1 -2
- package/core/steps/pipeline/create-pipeline.js +1 -2
- package/core/steps/pipeline/default-pipelines.d.ts +18 -18
- package/core/steps/pipeline/pipeline.js +1 -2
- package/dataflow/environments/append.js +1 -2
- package/dataflow/environments/built-in-config.d.ts +47 -0
- package/dataflow/environments/built-in-config.js +83 -0
- package/dataflow/environments/built-in.d.ts +49 -6
- package/dataflow/environments/built-in.js +29 -97
- package/dataflow/environments/clone.js +2 -2
- package/dataflow/environments/default-builtin-config.d.ts +5 -0
- package/dataflow/environments/default-builtin-config.js +83 -0
- package/dataflow/environments/define.js +1 -2
- package/dataflow/environments/diff.js +5 -6
- package/dataflow/environments/environment.js +8 -7
- package/dataflow/environments/identifier.d.ts +39 -8
- package/dataflow/environments/identifier.js +33 -0
- package/dataflow/environments/overwrite.d.ts +6 -5
- package/dataflow/environments/overwrite.js +16 -9
- package/dataflow/environments/resolve-by-name.d.ts +3 -1
- package/dataflow/environments/resolve-by-name.js +40 -8
- package/dataflow/environments/scoping.js +2 -3
- package/dataflow/extractor.js +25 -24
- package/dataflow/graph/dataflowgraph-builder.d.ts +139 -0
- package/dataflow/graph/dataflowgraph-builder.js +247 -0
- package/dataflow/graph/diff.js +12 -11
- package/dataflow/graph/edge.d.ts +2 -2
- package/dataflow/graph/edge.js +46 -20
- package/dataflow/graph/graph.d.ts +14 -6
- package/dataflow/graph/graph.js +25 -21
- package/dataflow/graph/quads.js +1 -2
- package/dataflow/graph/resolve-graph.d.ts +7 -0
- package/dataflow/graph/resolve-graph.js +51 -0
- package/dataflow/graph/vertex.d.ts +12 -4
- package/dataflow/graph/vertex.js +19 -11
- package/dataflow/info.d.ts +3 -7
- package/dataflow/info.js +7 -8
- package/dataflow/internal/linker.d.ts +3 -1
- package/dataflow/internal/linker.js +77 -32
- package/dataflow/internal/process/functions/call/argument/make-argument.js +5 -5
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +1 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +10 -8
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +5 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +27 -10
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +40 -26
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +30 -20
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +10 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +12 -11
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +6 -5
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +7 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +10 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +7 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +5 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +6 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +6 -5
- package/dataflow/internal/process/functions/call/common.js +30 -19
- package/dataflow/internal/process/functions/call/default-call-handling.js +1 -2
- package/dataflow/internal/process/functions/call/known-call-handling.js +8 -6
- package/dataflow/internal/process/functions/call/named-call-handling.js +7 -6
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +11 -7
- package/dataflow/internal/process/functions/process-argument.js +10 -8
- package/dataflow/internal/process/functions/process-parameter.js +8 -6
- package/dataflow/internal/process/process-named-call.js +3 -3
- package/dataflow/internal/process/process-symbol.js +5 -4
- package/dataflow/internal/process/process-uninteresting-leaf.js +1 -2
- package/dataflow/internal/process/process-value.js +5 -4
- package/dataflow/processor.js +1 -2
- package/documentation/data/dfg/doc-data-dfg-util.d.ts +20 -0
- package/documentation/data/dfg/doc-data-dfg-util.js +13 -0
- package/documentation/data/query/example-query-code.d.ts +1 -0
- package/documentation/data/query/example-query-code.js +25 -0
- package/documentation/data/server/doc-data-server-messages.d.ts +1 -0
- package/documentation/data/server/doc-data-server-messages.js +508 -0
- package/documentation/doc-util/doc-auto-gen.d.ts +7 -0
- package/documentation/doc-util/doc-auto-gen.js +9 -0
- package/documentation/doc-util/doc-cfg.d.ts +7 -0
- package/documentation/doc-util/doc-cfg.js +18 -0
- package/documentation/doc-util/doc-cli-option.d.ts +8 -0
- package/documentation/doc-util/doc-cli-option.js +36 -0
- package/documentation/doc-util/doc-code.d.ts +1 -0
- package/documentation/doc-util/doc-code.js +7 -0
- package/documentation/doc-util/doc-dfg.d.ts +21 -0
- package/documentation/doc-util/doc-dfg.js +93 -0
- package/documentation/doc-util/doc-docker.d.ts +1 -0
- package/documentation/doc-util/doc-docker.js +5 -0
- package/documentation/doc-util/doc-env.d.ts +2 -0
- package/documentation/doc-util/doc-env.js +20 -0
- package/documentation/doc-util/doc-files.d.ts +6 -0
- package/documentation/doc-util/doc-files.js +25 -0
- package/documentation/doc-util/doc-general.d.ts +2 -0
- package/documentation/doc-util/doc-general.js +16 -0
- package/documentation/doc-util/doc-hover-over.d.ts +1 -0
- package/documentation/doc-util/doc-hover-over.js +7 -0
- package/documentation/doc-util/doc-issue.d.ts +1 -0
- package/documentation/doc-util/doc-issue.js +6 -0
- package/documentation/doc-util/doc-ms.d.ts +1 -0
- package/documentation/doc-util/doc-ms.js +8 -0
- package/documentation/doc-util/doc-normalized-ast.d.ts +11 -0
- package/documentation/doc-util/doc-normalized-ast.js +71 -0
- package/documentation/doc-util/doc-query.d.ts +24 -0
- package/documentation/doc-util/doc-query.js +113 -0
- package/documentation/doc-util/doc-repl.d.ts +13 -0
- package/documentation/doc-util/doc-repl.js +79 -0
- package/documentation/doc-util/doc-server-message.d.ts +37 -0
- package/documentation/doc-util/doc-server-message.js +153 -0
- package/documentation/doc-util/doc-structure.d.ts +12 -0
- package/documentation/doc-util/doc-structure.js +21 -0
- package/documentation/doc-util/doc-types.d.ts +38 -0
- package/documentation/doc-util/doc-types.js +276 -0
- package/{r-bridge/data/print.js → documentation/print-capabilities-markdown.js} +8 -4
- package/documentation/print-dataflow-graph-wiki.d.ts +1 -0
- package/documentation/print-dataflow-graph-wiki.js +849 -0
- package/documentation/print-interface-wiki.d.ts +1 -0
- package/documentation/print-interface-wiki.js +401 -0
- package/documentation/print-normalized-ast-wiki.d.ts +1 -0
- package/documentation/print-normalized-ast-wiki.js +98 -0
- package/documentation/print-query-wiki.d.ts +1 -0
- package/documentation/print-query-wiki.js +215 -0
- package/package.json +29 -33
- package/queries/base-query-format.d.ts +11 -0
- package/{cli/repl/server/messages/hello.js → queries/base-query-format.js} +1 -1
- package/queries/call-context-query/call-context-query-executor.d.ts +11 -0
- package/queries/call-context-query/call-context-query-executor.js +255 -0
- package/queries/call-context-query/call-context-query-format.d.ts +72 -0
- package/queries/call-context-query/call-context-query-format.js +17 -0
- package/queries/query-schema.d.ts +7 -0
- package/queries/query-schema.js +31 -0
- package/queries/query.d.ts +35 -0
- package/queries/query.js +57 -0
- package/queries/two-layer-collector.d.ts +8 -0
- package/queries/two-layer-collector.js +31 -0
- package/queries/virtual-query/compound-query.d.ts +24 -0
- package/queries/virtual-query/compound-query.js +18 -0
- package/queries/virtual-query/virtual-queries.d.ts +15 -0
- package/queries/virtual-query/virtual-queries.js +8 -0
- package/r-bridge/data/data.d.ts +5 -0
- package/r-bridge/data/data.js +6 -0
- package/r-bridge/data/get.js +2 -3
- package/r-bridge/init.js +2 -2
- package/r-bridge/lang-4.x/ast/model/collect.js +1 -2
- package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +4 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +10 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +1 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +3 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/operators.js +27 -26
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +9 -9
- package/r-bridge/lang-4.x/ast/model/processing/fold.js +1 -2
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +5 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +26 -3
- package/r-bridge/lang-4.x/ast/model/processing/role.js +1 -2
- package/r-bridge/lang-4.x/ast/model/processing/stateful-fold.js +23 -23
- package/r-bridge/lang-4.x/ast/model/processing/visitor.js +23 -23
- package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/type.js +221 -12
- package/r-bridge/lang-4.x/ast/parser/json/format.js +2 -2
- package/r-bridge/lang-4.x/ast/parser/json/parser.js +6 -5
- package/r-bridge/lang-4.x/ast/parser/xml/input-format.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then-else.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then.js +7 -7
- package/r-bridge/lang-4.x/ast/parser/xml/internal/expression/normalize-expression.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-argument.js +10 -10
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-call.js +18 -18
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-definition.js +8 -8
- package/r-bridge/lang-4.x/ast/parser/xml/internal/functions/normalize-parameter.js +9 -9
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-break.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-for.js +10 -10
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-next.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-repeat.js +5 -5
- package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-while.js +7 -7
- package/r-bridge/lang-4.x/ast/parser/xml/internal/normalize-access.js +12 -12
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/normalize-binary.js +14 -14
- package/r-bridge/lang-4.x/ast/parser/xml/internal/operators/normalize-unary.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/other/normalize-comment.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/other/normalize-line-directive.js +4 -4
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-delimiter.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-expressions.js +13 -13
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-root.js +6 -6
- package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-single-node.js +19 -19
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-number.js +5 -5
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-string.js +3 -3
- package/r-bridge/lang-4.x/ast/parser/xml/internal/values/normalize-symbol.js +2 -3
- package/r-bridge/lang-4.x/ast/parser/xml/normalize-meta.js +12 -12
- package/r-bridge/lang-4.x/convert-values.js +7 -7
- package/r-bridge/retriever.js +12 -11
- package/r-bridge/shell.d.ts +0 -1
- package/r-bridge/shell.js +6 -1
- package/reconstruct/auto-select/auto-select-defaults.js +1 -2
- package/reconstruct/auto-select/magic-comments.js +3 -3
- package/reconstruct/reconstruct.js +4 -3
- package/slicing/criterion/collect-all.js +1 -2
- package/slicing/criterion/parse.d.ts +1 -1
- package/slicing/criterion/parse.js +6 -5
- package/slicing/static/fingerprint.js +2 -3
- package/slicing/static/slice-call.js +9 -9
- package/slicing/static/static-slicer.js +5 -4
- package/statistics/features/common-syntax-probability.js +13 -13
- package/statistics/features/feature.d.ts +5 -9
- package/statistics/features/feature.js +2 -2
- package/statistics/features/post-processing.js +2 -3
- package/statistics/features/supported/assignments/assignments.js +3 -2
- package/statistics/features/supported/assignments/post-process.js +1 -2
- package/statistics/features/supported/comments/post-process.js +1 -2
- package/statistics/features/supported/control-flow/control-flow.js +4 -3
- package/statistics/features/supported/control-flow/post-process.js +1 -2
- package/statistics/features/supported/data-access/data-access.d.ts +2 -2
- package/statistics/features/supported/data-access/data-access.js +3 -2
- package/statistics/features/supported/data-access/post-process.js +1 -2
- package/statistics/features/supported/defined-functions/defined-functions.js +9 -7
- package/statistics/features/supported/defined-functions/post-process.d.ts +1 -1
- package/statistics/features/supported/defined-functions/post-process.js +2 -3
- package/statistics/features/supported/expression-list/post-process.js +1 -2
- package/statistics/features/supported/expression-list/{expression-list.js → statistics-expression-list.js} +4 -3
- package/statistics/features/supported/loops/loops.js +8 -7
- package/statistics/features/supported/loops/post-process.js +1 -2
- package/statistics/features/supported/used-functions/post-process.js +2 -3
- package/statistics/features/supported/used-functions/used-functions.d.ts +1 -1
- package/statistics/features/supported/used-functions/used-functions.js +4 -3
- package/statistics/features/supported/used-packages/post-process.js +1 -2
- package/statistics/features/supported/values/post-process.js +1 -2
- package/statistics/features/supported/variables/post-process.js +2 -3
- package/statistics/features/supported/variables/variables.js +2 -1
- package/statistics/meta-statistics.js +1 -2
- package/statistics/output/print-stats.js +4 -5
- package/statistics/output/statistics-file.js +5 -5
- package/statistics/statistics.js +2 -3
- package/statistics/summarizer/auto-detect.js +1 -2
- package/statistics/summarizer/post-process/clusterer.js +1 -2
- package/statistics/summarizer/post-process/file-based-count.js +2 -3
- package/statistics/summarizer/post-process/histogram.js +3 -4
- package/statistics/summarizer/post-process/post-process-output.js +2 -3
- package/statistics/summarizer/second-phase/process.d.ts +2 -0
- package/statistics/summarizer/second-phase/process.js +2 -2
- package/statistics/summarizer/summarizer.js +8 -1
- package/util/ansi.d.ts +1 -0
- package/util/ansi.js +27 -4
- package/util/args.js +2 -3
- package/util/arrays.js +8 -9
- package/util/assert.js +5 -6
- package/util/bimap.d.ts +4 -4
- package/util/cfg/cfg.d.ts +1 -0
- package/util/cfg/cfg.js +8 -5
- package/util/cfg/visitor.d.ts +8 -13
- package/util/cfg/visitor.js +22 -56
- package/util/diff.js +1 -2
- package/util/files.d.ts +0 -1
- package/util/files.js +11 -8
- package/util/json.js +2 -3
- package/util/mermaid/ast.js +7 -7
- package/util/mermaid/cfg.js +2 -3
- package/util/mermaid/dfg.d.ts +12 -4
- package/util/mermaid/dfg.js +28 -16
- package/util/mermaid/mermaid.js +5 -4
- package/util/numbers.js +1 -2
- package/util/objects.d.ts +7 -0
- package/util/objects.js +13 -3
- package/util/os.js +1 -2
- package/util/quads.js +5 -5
- package/util/random.js +2 -2
- package/util/range.js +8 -9
- package/util/schema.d.ts +11 -0
- package/util/schema.js +75 -0
- package/util/set.js +2 -3
- package/util/strings.js +3 -4
- package/util/summarizer.js +4 -4
- package/util/text.d.ts +1 -0
- package/util/text.js +20 -0
- package/util/time.js +1 -2
- package/util/version.js +2 -3
- package/cli/repl/commands/lineage.d.ts +0 -15
- package/cli/repl/commands/quit.d.ts +0 -2
- package/cli/repl/server/messages/analysis.js +0 -21
- package/cli/repl/server/messages/lineage.js +0 -17
- package/cli/repl/server/messages/repl.js +0 -37
- /package/cli/repl/commands/{main.d.ts → repl-main.d.ts} +0 -0
- /package/{r-bridge/data/print.d.ts → documentation/print-capabilities-markdown.d.ts} +0 -0
- /package/statistics/features/supported/expression-list/{expression-list.d.ts → statistics-expression-list.d.ts} +0 -0
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.processPipe =
|
|
3
|
+
exports.processPipe = processPipe;
|
|
4
4
|
const known_call_handling_1 = require("../known-call-handling");
|
|
5
5
|
const assert_1 = require("../../../../../../util/assert");
|
|
6
6
|
const unpack_argument_1 = require("../argument/unpack-argument");
|
|
7
7
|
const logger_1 = require("../../../../../logger");
|
|
8
|
+
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
9
|
+
const vertex_1 = require("../../../../../graph/vertex");
|
|
10
|
+
const edge_1 = require("../../../../../graph/edge");
|
|
11
|
+
const identifier_1 = require("../../../../../environments/identifier");
|
|
8
12
|
function processPipe(name, args, rootId, data) {
|
|
9
13
|
const { information } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data });
|
|
10
14
|
if (args.length !== 2) {
|
|
@@ -13,23 +17,23 @@ function processPipe(name, args, rootId, data) {
|
|
|
13
17
|
}
|
|
14
18
|
const [lhs, rhs] = args.map(unpack_argument_1.unpackArgument);
|
|
15
19
|
(0, assert_1.guard)(lhs !== undefined && rhs !== undefined, () => `lhs and rhs must be present, but ${JSON.stringify(lhs)} and ${JSON.stringify(rhs)} were found instead.`);
|
|
16
|
-
if (rhs.type !==
|
|
20
|
+
if (rhs.type !== type_1.RType.FunctionCall) {
|
|
17
21
|
logger_1.dataflowLogger.warn(`Expected rhs of pipe to be a function call, but got ${rhs.type} instead.`);
|
|
18
22
|
}
|
|
19
23
|
else {
|
|
20
24
|
const functionCallNode = information.graph.getVertex(rhs.info.id, true);
|
|
21
|
-
(0, assert_1.guard)(functionCallNode?.tag ===
|
|
25
|
+
(0, assert_1.guard)(functionCallNode?.tag === vertex_1.VertexType.FunctionCall, () => `Expected function call node with id ${rhs.info.id} to be a function call node, but got ${functionCallNode?.tag} instead.`);
|
|
22
26
|
// make the lhs an argument node:
|
|
23
27
|
const argId = lhs.info.id;
|
|
24
28
|
logger_1.dataflowLogger.trace(`Linking pipe arg ${argId} as first argument of ${rhs.info.id}`);
|
|
25
29
|
functionCallNode.args.unshift({
|
|
26
30
|
name: undefined,
|
|
27
31
|
nodeId: argId,
|
|
28
|
-
controlDependencies: data.controlDependencies
|
|
32
|
+
controlDependencies: data.controlDependencies,
|
|
33
|
+
type: identifier_1.ReferenceType.Function
|
|
29
34
|
});
|
|
30
|
-
information.graph.addEdge(functionCallNode.id, argId,
|
|
35
|
+
information.graph.addEdge(functionCallNode.id, argId, edge_1.EdgeType.Argument);
|
|
31
36
|
}
|
|
32
37
|
return information;
|
|
33
38
|
}
|
|
34
|
-
exports.processPipe = processPipe;
|
|
35
39
|
//# sourceMappingURL=built-in-pipe.js.map
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.processQuote =
|
|
3
|
+
exports.processQuote = processQuote;
|
|
4
4
|
const known_call_handling_1 = require("../known-call-handling");
|
|
5
|
+
const edge_1 = require("../../../../../graph/edge");
|
|
5
6
|
function processQuote(name, args, rootId, data, config) {
|
|
6
7
|
const { information, processedArguments, fnRef } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: config.forceArgs });
|
|
7
8
|
const inRefs = [fnRef];
|
|
@@ -15,7 +16,11 @@ function processQuote(name, args, rootId, data, config) {
|
|
|
15
16
|
unknownRefs.push(...processedArg.unknownReferences);
|
|
16
17
|
}
|
|
17
18
|
else if (processedArg) {
|
|
18
|
-
information.graph.addEdge(rootId, processedArg.entryPoint,
|
|
19
|
+
information.graph.addEdge(rootId, processedArg.entryPoint, edge_1.EdgeType.NonStandardEvaluation);
|
|
20
|
+
/* nse actually affects _everything_ within that argument! */
|
|
21
|
+
for (const [vtx,] of processedArg.graph.vertices(true)) {
|
|
22
|
+
information.graph.addEdge(rootId, vtx, edge_1.EdgeType.NonStandardEvaluation);
|
|
23
|
+
}
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
26
|
return {
|
|
@@ -25,5 +30,4 @@ function processQuote(name, args, rootId, data, config) {
|
|
|
25
30
|
unknownReferences: unknownRefs
|
|
26
31
|
};
|
|
27
32
|
}
|
|
28
|
-
exports.processQuote = processQuote;
|
|
29
33
|
//# sourceMappingURL=built-in-quote.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.processRepeatLoop =
|
|
3
|
+
exports.processRepeatLoop = processRepeatLoop;
|
|
4
4
|
const info_1 = require("../../../../../info");
|
|
5
5
|
const linker_1 = require("../../../../linker");
|
|
6
6
|
const known_call_handling_1 = require("../known-call-handling");
|
|
@@ -29,9 +29,8 @@ function processRepeatLoop(name, args, rootId, data) {
|
|
|
29
29
|
});
|
|
30
30
|
const body = processedArguments[0];
|
|
31
31
|
(0, assert_1.guard)(body !== undefined, () => `Repeat-Loop ${name.content} has no body, impossible!`);
|
|
32
|
-
(0, linker_1.linkCircularRedefinitionsWithinALoop)(information.graph, (0, linker_1.produceNameSharedIdMap)((0, linker_1.findNonLocalReads)(information.graph)), body.out);
|
|
32
|
+
(0, linker_1.linkCircularRedefinitionsWithinALoop)(information.graph, (0, linker_1.produceNameSharedIdMap)((0, linker_1.findNonLocalReads)(information.graph, [])), body.out);
|
|
33
33
|
information.exitPoints = (0, info_1.filterOutLoopExitPoints)(information.exitPoints);
|
|
34
34
|
return information;
|
|
35
35
|
}
|
|
36
|
-
exports.processRepeatLoop = processRepeatLoop;
|
|
37
36
|
//# sourceMappingURL=built-in-repeat-loop.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.processReplacementFunction =
|
|
3
|
+
exports.processReplacementFunction = processReplacementFunction;
|
|
4
4
|
const info_1 = require("../../../../../info");
|
|
5
5
|
const known_call_handling_1 = require("../known-call-handling");
|
|
6
6
|
const log_1 = require("../../../../../../util/log");
|
|
@@ -8,7 +8,9 @@ const built_in_assignment_1 = require("./built-in-assignment");
|
|
|
8
8
|
const common_1 = require("../common");
|
|
9
9
|
const assert_1 = require("../../../../../../util/assert");
|
|
10
10
|
const logger_1 = require("../../../../../logger");
|
|
11
|
+
const vertex_1 = require("../../../../../graph/vertex");
|
|
11
12
|
const graph_1 = require("../../../../../graph/graph");
|
|
13
|
+
const edge_1 = require("../../../../../graph/edge");
|
|
12
14
|
const dfg_1 = require("../../../../../../util/mermaid/dfg");
|
|
13
15
|
function processReplacementFunction(name,
|
|
14
16
|
/** The last one has to be the value */
|
|
@@ -31,16 +33,15 @@ args, rootId, data, config) {
|
|
|
31
33
|
forceArgs: config.forceArgs,
|
|
32
34
|
});
|
|
33
35
|
const fn = res.graph.getVertex(rootId, true);
|
|
34
|
-
(0, assert_1.guard)(fn?.tag ===
|
|
36
|
+
(0, assert_1.guard)(fn?.tag === vertex_1.VertexType.FunctionCall && fn.args.length === 2, () => `Function ${rootId} not found in graph or not 2-arg fn-call (${JSON.stringify(fn)}) ${(0, dfg_1.graphToMermaidUrl)(res.graph)}`);
|
|
35
37
|
fn.args = [fn.args[0], ...callArgs, fn.args[1]];
|
|
36
38
|
/* a replacement reads all of its call args as well, at least as far as I am aware of */
|
|
37
39
|
for (const arg of callArgs) {
|
|
38
40
|
const ref = (0, graph_1.getReferenceOfArgument)(arg);
|
|
39
41
|
if (ref !== undefined) {
|
|
40
|
-
res.graph.addEdge(rootId, ref,
|
|
42
|
+
res.graph.addEdge(rootId, ref, edge_1.EdgeType.Reads);
|
|
41
43
|
}
|
|
42
44
|
}
|
|
43
45
|
return res;
|
|
44
46
|
}
|
|
45
|
-
exports.processReplacementFunction = processReplacementFunction;
|
|
46
47
|
//# sourceMappingURL=built-in-replacement.js.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.setSourceProvider = setSourceProvider;
|
|
4
|
+
exports.processSourceCall = processSourceCall;
|
|
5
|
+
exports.sourceRequest = sourceRequest;
|
|
6
|
+
exports.standaloneSourceFile = standaloneSourceFile;
|
|
4
7
|
const shell_executor_1 = require("../../../../../../r-bridge/shell-executor");
|
|
5
8
|
const processor_1 = require("../../../../../processor");
|
|
6
9
|
const info_1 = require("../../../../../info");
|
|
@@ -11,13 +14,13 @@ const retriever_1 = require("../../../../../../r-bridge/retriever");
|
|
|
11
14
|
const decorate_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/processing/decorate");
|
|
12
15
|
const r_function_call_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
13
16
|
const logger_1 = require("../../../../../logger");
|
|
17
|
+
const type_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
14
18
|
const overwrite_1 = require("../../../../../environments/overwrite");
|
|
15
19
|
const log_1 = require("../../../../../../util/log");
|
|
16
20
|
let sourceProvider = (0, retriever_1.requestProviderFromFile)();
|
|
17
21
|
function setSourceProvider(provider) {
|
|
18
22
|
sourceProvider = provider;
|
|
19
23
|
}
|
|
20
|
-
exports.setSourceProvider = setSourceProvider;
|
|
21
24
|
function processSourceCall(name, args, rootId, data, config) {
|
|
22
25
|
const information = config.includeFunctionCall ?
|
|
23
26
|
(0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data }).information
|
|
@@ -28,7 +31,7 @@ function processSourceCall(name, args, rootId, data, config) {
|
|
|
28
31
|
information.graph.markIdForUnknownSideEffects(rootId);
|
|
29
32
|
return information;
|
|
30
33
|
}
|
|
31
|
-
if (sourceFile !== r_function_call_1.EmptyArgument && sourceFile?.value?.type ===
|
|
34
|
+
if (sourceFile !== r_function_call_1.EmptyArgument && sourceFile?.value?.type === type_1.RType.String) {
|
|
32
35
|
const path = (0, retriever_1.removeRQuotes)(sourceFile.lexeme);
|
|
33
36
|
const request = sourceProvider.createRequest(path);
|
|
34
37
|
// check if the sourced file has already been dataflow analyzed, and if so, skip it
|
|
@@ -45,7 +48,6 @@ function processSourceCall(name, args, rootId, data, config) {
|
|
|
45
48
|
return information;
|
|
46
49
|
}
|
|
47
50
|
}
|
|
48
|
-
exports.processSourceCall = processSourceCall;
|
|
49
51
|
function sourceRequest(rootId, request, data, information, getId) {
|
|
50
52
|
const executor = new shell_executor_1.RShellExecutor();
|
|
51
53
|
// parse, normalize and dataflow the sourced file
|
|
@@ -81,7 +83,6 @@ function sourceRequest(rootId, request, data, information, getId) {
|
|
|
81
83
|
}
|
|
82
84
|
return newInformation;
|
|
83
85
|
}
|
|
84
|
-
exports.sourceRequest = sourceRequest;
|
|
85
86
|
function standaloneSourceFile(inputRequest, data, uniqueSourceId, information) {
|
|
86
87
|
const path = inputRequest.request === 'file' ? inputRequest.content : '-inline-';
|
|
87
88
|
/* this way we can still pass content */
|
|
@@ -100,5 +101,4 @@ function standaloneSourceFile(inputRequest, data, uniqueSourceId, information) {
|
|
|
100
101
|
referenceChain: [...data.referenceChain, fingerprint]
|
|
101
102
|
}, information, (0, decorate_1.deterministicPrefixIdGenerator)(path + '@' + uniqueSourceId));
|
|
102
103
|
}
|
|
103
|
-
exports.standaloneSourceFile = standaloneSourceFile;
|
|
104
104
|
//# sourceMappingURL=built-in-source.js.map
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.processSpecialBinOp =
|
|
3
|
+
exports.processSpecialBinOp = processSpecialBinOp;
|
|
4
4
|
const known_call_handling_1 = require("../known-call-handling");
|
|
5
5
|
const logger_1 = require("../../../../../logger");
|
|
6
|
+
const edge_1 = require("../../../../../graph/edge");
|
|
6
7
|
function processSpecialBinOp(name, args, rootId, data, config) {
|
|
7
8
|
if (!config.lazy) {
|
|
8
9
|
return (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data }).information;
|
|
@@ -21,7 +22,7 @@ function processSpecialBinOp(name, args, rootId, data, config) {
|
|
|
21
22
|
});
|
|
22
23
|
for (const arg of processedArguments) {
|
|
23
24
|
if (arg) {
|
|
24
|
-
information.graph.addEdge(name.info.id, arg.entryPoint,
|
|
25
|
+
information.graph.addEdge(name.info.id, arg.entryPoint, edge_1.EdgeType.Reads);
|
|
25
26
|
}
|
|
26
27
|
// only do first if lazy
|
|
27
28
|
if (config.lazy) {
|
|
@@ -30,5 +31,4 @@ function processSpecialBinOp(name, args, rootId, data, config) {
|
|
|
30
31
|
}
|
|
31
32
|
return information;
|
|
32
33
|
}
|
|
33
|
-
exports.processSpecialBinOp = processSpecialBinOp;
|
|
34
34
|
//# sourceMappingURL=built-in-special-bin-op.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.processWhileLoop =
|
|
3
|
+
exports.processWhileLoop = processWhileLoop;
|
|
4
4
|
const info_1 = require("../../../../../info");
|
|
5
5
|
const linker_1 = require("../../../../linker");
|
|
6
6
|
const known_call_handling_1 = require("../known-call-handling");
|
|
@@ -9,6 +9,8 @@ const unpack_argument_1 = require("../argument/unpack-argument");
|
|
|
9
9
|
const r_function_call_1 = require("../../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
10
10
|
const logger_1 = require("../../../../../logger");
|
|
11
11
|
const environment_1 = require("../../../../../environments/environment");
|
|
12
|
+
const edge_1 = require("../../../../../graph/edge");
|
|
13
|
+
const identifier_1 = require("../../../../../environments/identifier");
|
|
12
14
|
function processWhileLoop(name, args, rootId, data) {
|
|
13
15
|
if (args.length !== 2 || args[1] === r_function_call_1.EmptyArgument) {
|
|
14
16
|
logger_1.dataflowLogger.warn(`While-Loop ${name.content} does not have 2 arguments, skipping`);
|
|
@@ -44,12 +46,12 @@ function processWhileLoop(name, args, rootId, data) {
|
|
|
44
46
|
...(0, environment_1.makeAllMaybe)(body.unknownReferences, information.graph, information.environment, false),
|
|
45
47
|
...(0, environment_1.makeAllMaybe)(body.in, information.graph, information.environment, false)
|
|
46
48
|
], information.environment, [...condition.in, ...condition.unknownReferences], information.graph, true);
|
|
47
|
-
(0, linker_1.linkCircularRedefinitionsWithinALoop)(information.graph, (0, linker_1.produceNameSharedIdMap)((0, linker_1.findNonLocalReads)(information.graph)), body.out);
|
|
49
|
+
(0, linker_1.linkCircularRedefinitionsWithinALoop)(information.graph, (0, linker_1.produceNameSharedIdMap)((0, linker_1.findNonLocalReads)(information.graph, condition.in)), body.out);
|
|
48
50
|
// as the while-loop always evaluates its condition
|
|
49
|
-
information.graph.addEdge(name.info.id, condition.entryPoint,
|
|
51
|
+
information.graph.addEdge(name.info.id, condition.entryPoint, edge_1.EdgeType.Reads);
|
|
50
52
|
return {
|
|
51
53
|
unknownReferences: [],
|
|
52
|
-
in: [{ nodeId: name.info.id, name: name.lexeme, controlDependencies: originalDependency }, ...remainingInputs],
|
|
54
|
+
in: [{ nodeId: name.info.id, name: name.lexeme, controlDependencies: originalDependency, type: identifier_1.ReferenceType.Function }, ...remainingInputs],
|
|
53
55
|
out: [...(0, environment_1.makeAllMaybe)(body.out, information.graph, information.environment, true), ...condition.out],
|
|
54
56
|
entryPoint: name.info.id,
|
|
55
57
|
exitPoints: (0, info_1.filterOutLoopExitPoints)(body.exitPoints),
|
|
@@ -57,5 +59,4 @@ function processWhileLoop(name, args, rootId, data) {
|
|
|
57
59
|
environment: information.environment
|
|
58
60
|
};
|
|
59
61
|
}
|
|
60
|
-
exports.processWhileLoop = processWhileLoop;
|
|
61
62
|
//# sourceMappingURL=built-in-while-loop.js.map
|
|
@@ -1,26 +1,31 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.processAllArguments = processAllArguments;
|
|
4
|
+
exports.patchFunctionCall = patchFunctionCall;
|
|
5
|
+
const info_1 = require("../../../../info");
|
|
4
6
|
const processor_1 = require("../../../../processor");
|
|
5
7
|
const r_function_call_1 = require("../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
8
|
+
const identifier_1 = require("../../../../environments/identifier");
|
|
6
9
|
const overwrite_1 = require("../../../../environments/overwrite");
|
|
7
10
|
const resolve_by_name_1 = require("../../../../environments/resolve-by-name");
|
|
11
|
+
const type_1 = require("../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
8
12
|
const vertex_1 = require("../../../../graph/vertex");
|
|
13
|
+
const edge_1 = require("../../../../graph/edge");
|
|
9
14
|
function forceVertexArgumentValueReferences(rootId, value, graph, env) {
|
|
10
15
|
const valueVertex = graph.getVertex(value.entryPoint);
|
|
11
16
|
if (!valueVertex) {
|
|
12
17
|
return;
|
|
13
18
|
}
|
|
14
19
|
// link read if it is function definition directly and reference the exit point
|
|
15
|
-
if (valueVertex.tag !==
|
|
16
|
-
if (valueVertex.tag ===
|
|
20
|
+
if (valueVertex.tag !== vertex_1.VertexType.Value) {
|
|
21
|
+
if (valueVertex.tag === vertex_1.VertexType.FunctionDefinition) {
|
|
17
22
|
for (const exit of valueVertex.exitPoints) {
|
|
18
|
-
graph.addEdge(rootId, exit,
|
|
23
|
+
graph.addEdge(rootId, exit, edge_1.EdgeType.Reads);
|
|
19
24
|
}
|
|
20
25
|
}
|
|
21
26
|
else {
|
|
22
27
|
for (const exit of value.exitPoints) {
|
|
23
|
-
graph.addEdge(rootId, exit.nodeId,
|
|
28
|
+
graph.addEdge(rootId, exit.nodeId, edge_1.EdgeType.Reads);
|
|
24
29
|
}
|
|
25
30
|
}
|
|
26
31
|
}
|
|
@@ -30,9 +35,9 @@ function forceVertexArgumentValueReferences(rootId, value, graph, env) {
|
|
|
30
35
|
// try to resolve them against the current environment
|
|
31
36
|
for (const ref of [...value.in, ...containedSubflowIn.flatMap(n => n.subflow.in)]) {
|
|
32
37
|
if (ref.name) {
|
|
33
|
-
const resolved = (0, resolve_by_name_1.resolveByName)(ref.name, env) ?? [];
|
|
38
|
+
const resolved = (0, resolve_by_name_1.resolveByName)(ref.name, env, ref.type) ?? [];
|
|
34
39
|
for (const resolve of resolved) {
|
|
35
|
-
graph.addEdge(ref.nodeId, resolve.nodeId,
|
|
40
|
+
graph.addEdge(ref.nodeId, resolve.nodeId, edge_1.EdgeType.Reads);
|
|
36
41
|
}
|
|
37
42
|
}
|
|
38
43
|
}
|
|
@@ -54,52 +59,58 @@ function processAllArguments({ functionName, args, data, finalGraph, functionRoo
|
|
|
54
59
|
continue;
|
|
55
60
|
}
|
|
56
61
|
const processed = (0, processor_1.processDataflowFor)(arg, { ...data, environment: argEnv });
|
|
57
|
-
if (arg.type ===
|
|
62
|
+
if (arg.type === type_1.RType.Argument && arg.value && (forceArgs === 'all' || forceArgs[i]) && arg.value.type !== type_1.RType.Number && arg.value.type !== type_1.RType.String && arg.value.type !== type_1.RType.Logical) {
|
|
58
63
|
forceVertexArgumentValueReferences(functionRootId, processed, processed.graph, argEnv);
|
|
59
64
|
}
|
|
60
65
|
processedArguments.push(processed);
|
|
61
66
|
finalEnv = (0, overwrite_1.overwriteEnvironment)(finalEnv, processed.environment);
|
|
62
67
|
// resolve reads within argument, we resolve before adding the `processed.environment` to avoid cyclic dependencies
|
|
63
68
|
for (const ingoing of [...processed.in, ...processed.unknownReferences]) {
|
|
64
|
-
const tryToResolve = ingoing.name ? (0, resolve_by_name_1.resolveByName)(ingoing.name, argEnv) : undefined;
|
|
69
|
+
const tryToResolve = ingoing.name ? (0, resolve_by_name_1.resolveByName)(ingoing.name, argEnv, identifier_1.ReferenceType.Unknown) : undefined;
|
|
65
70
|
if (tryToResolve === undefined) {
|
|
66
71
|
remainingReadInArgs.push(ingoing);
|
|
67
72
|
}
|
|
68
73
|
else {
|
|
74
|
+
/* maybe all targets are not definitely of the current scope and should be still kept */
|
|
75
|
+
let assumeItMayHaveAHigherTarget = true;
|
|
69
76
|
for (const resolved of tryToResolve) {
|
|
70
|
-
|
|
77
|
+
if ((0, info_1.happensInEveryBranch)(resolved.controlDependencies)) {
|
|
78
|
+
assumeItMayHaveAHigherTarget = false;
|
|
79
|
+
}
|
|
80
|
+
finalGraph.addEdge(ingoing.nodeId, resolved.nodeId, edge_1.EdgeType.Reads);
|
|
81
|
+
}
|
|
82
|
+
if (assumeItMayHaveAHigherTarget) {
|
|
83
|
+
remainingReadInArgs.push(ingoing);
|
|
71
84
|
}
|
|
72
85
|
}
|
|
73
86
|
}
|
|
74
87
|
argEnv = (0, overwrite_1.overwriteEnvironment)(argEnv, processed.environment);
|
|
75
88
|
finalGraph.mergeWith(processed.graph);
|
|
76
|
-
if (arg.type !==
|
|
77
|
-
callArgs.push({ nodeId: processed.entryPoint, controlDependencies: undefined });
|
|
89
|
+
if (arg.type !== type_1.RType.Argument || !arg.name) {
|
|
90
|
+
callArgs.push({ nodeId: processed.entryPoint, controlDependencies: undefined, type: identifier_1.ReferenceType.Argument });
|
|
78
91
|
}
|
|
79
92
|
else {
|
|
80
|
-
callArgs.push({ nodeId: processed.entryPoint, name: arg.name.content, controlDependencies: undefined });
|
|
93
|
+
callArgs.push({ nodeId: processed.entryPoint, name: arg.name.content, controlDependencies: undefined, type: identifier_1.ReferenceType.Argument });
|
|
81
94
|
}
|
|
82
|
-
finalGraph.addEdge(functionRootId, processed.entryPoint,
|
|
95
|
+
finalGraph.addEdge(functionRootId, processed.entryPoint, edge_1.EdgeType.Argument);
|
|
83
96
|
}
|
|
84
97
|
return { finalEnv, callArgs, remainingReadInArgs, processedArguments };
|
|
85
98
|
}
|
|
86
|
-
exports.processAllArguments = processAllArguments;
|
|
87
99
|
function patchFunctionCall({ nextGraph, rootId, name, data, argumentProcessResult }) {
|
|
88
100
|
nextGraph.addVertex({
|
|
89
|
-
tag:
|
|
101
|
+
tag: vertex_1.VertexType.FunctionCall,
|
|
90
102
|
id: rootId,
|
|
91
103
|
name: name.content,
|
|
92
104
|
environment: data.environment,
|
|
93
105
|
/* will be overwritten accordingly */
|
|
94
106
|
onlyBuiltin: false,
|
|
95
107
|
controlDependencies: data.controlDependencies,
|
|
96
|
-
args: argumentProcessResult.map(arg => arg === undefined ? r_function_call_1.EmptyArgument : { nodeId: arg.entryPoint, controlDependencies: undefined, call: undefined })
|
|
108
|
+
args: argumentProcessResult.map(arg => arg === undefined ? r_function_call_1.EmptyArgument : { nodeId: arg.entryPoint, controlDependencies: undefined, call: undefined, type: identifier_1.ReferenceType.Argument }),
|
|
97
109
|
});
|
|
98
110
|
for (const arg of argumentProcessResult) {
|
|
99
111
|
if (arg) {
|
|
100
|
-
nextGraph.addEdge(rootId, arg.entryPoint,
|
|
112
|
+
nextGraph.addEdge(rootId, arg.entryPoint, edge_1.EdgeType.Argument);
|
|
101
113
|
}
|
|
102
114
|
}
|
|
103
115
|
}
|
|
104
|
-
exports.patchFunctionCall = patchFunctionCall;
|
|
105
116
|
//# sourceMappingURL=common.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.processFunctionCall =
|
|
3
|
+
exports.processFunctionCall = processFunctionCall;
|
|
4
4
|
const named_call_handling_1 = require("./named-call-handling");
|
|
5
5
|
const unnamed_call_handling_1 = require("./unnamed-call-handling");
|
|
6
6
|
function processFunctionCall(functionCall, data) {
|
|
@@ -11,5 +11,4 @@ function processFunctionCall(functionCall, data) {
|
|
|
11
11
|
return (0, unnamed_call_handling_1.processUnnamedFunctionCall)(functionCall, data);
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
exports.processFunctionCall = processFunctionCall;
|
|
15
14
|
//# sourceMappingURL=default-call-handling.js.map
|
|
@@ -1,17 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.markNonStandardEvaluationEdges = markNonStandardEvaluationEdges;
|
|
4
|
+
exports.processKnownFunctionCall = processKnownFunctionCall;
|
|
4
5
|
const processor_1 = require("../../../../processor");
|
|
5
6
|
const common_1 = require("./common");
|
|
7
|
+
const identifier_1 = require("../../../../environments/identifier");
|
|
6
8
|
const graph_1 = require("../../../../graph/graph");
|
|
9
|
+
const edge_1 = require("../../../../graph/edge");
|
|
7
10
|
const logger_1 = require("../../../../logger");
|
|
11
|
+
const vertex_1 = require("../../../../graph/vertex");
|
|
8
12
|
const log_1 = require("../../../../../util/log");
|
|
9
13
|
function markNonStandardEvaluationEdges(markAsNSE, callArgs, finalGraph, rootId) {
|
|
10
14
|
for (const nse of markAsNSE) {
|
|
11
15
|
if (nse < callArgs.length) {
|
|
12
16
|
const arg = callArgs[nse];
|
|
13
17
|
if (arg !== undefined) {
|
|
14
|
-
finalGraph.addEdge(rootId, arg.entryPoint,
|
|
18
|
+
finalGraph.addEdge(rootId, arg.entryPoint, edge_1.EdgeType.NonStandardEvaluation);
|
|
15
19
|
}
|
|
16
20
|
}
|
|
17
21
|
else {
|
|
@@ -19,7 +23,6 @@ function markNonStandardEvaluationEdges(markAsNSE, callArgs, finalGraph, rootId)
|
|
|
19
23
|
}
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
|
-
exports.markNonStandardEvaluationEdges = markNonStandardEvaluationEdges;
|
|
23
26
|
function processKnownFunctionCall({ name, args, rootId, data, reverseOrder = false, markAsNSE = undefined, forceArgs, patchData = d => d, hasUnknownSideEffect }) {
|
|
24
27
|
const functionName = (0, processor_1.processDataflowFor)(name, data);
|
|
25
28
|
const finalGraph = new graph_1.DataflowGraph(data.completeAst.idMap);
|
|
@@ -31,7 +34,7 @@ function processKnownFunctionCall({ name, args, rootId, data, reverseOrder = fal
|
|
|
31
34
|
markNonStandardEvaluationEdges(markAsNSE, processedArguments, finalGraph, rootId);
|
|
32
35
|
}
|
|
33
36
|
finalGraph.addVertex({
|
|
34
|
-
tag:
|
|
37
|
+
tag: vertex_1.VertexType.FunctionCall,
|
|
35
38
|
id: rootId,
|
|
36
39
|
environment: data.environment,
|
|
37
40
|
name: functionCallName,
|
|
@@ -44,7 +47,7 @@ function processKnownFunctionCall({ name, args, rootId, data, reverseOrder = fal
|
|
|
44
47
|
finalGraph.markIdForUnknownSideEffects(rootId);
|
|
45
48
|
}
|
|
46
49
|
const inIds = remainingReadInArgs;
|
|
47
|
-
const fnRef = { nodeId: rootId, name: functionCallName, controlDependencies: data.controlDependencies,
|
|
50
|
+
const fnRef = { nodeId: rootId, name: functionCallName, controlDependencies: data.controlDependencies, type: identifier_1.ReferenceType.Function };
|
|
48
51
|
inIds.push(fnRef);
|
|
49
52
|
return {
|
|
50
53
|
information: {
|
|
@@ -61,5 +64,4 @@ function processKnownFunctionCall({ name, args, rootId, data, reverseOrder = fal
|
|
|
61
64
|
fnRef
|
|
62
65
|
};
|
|
63
66
|
}
|
|
64
|
-
exports.processKnownFunctionCall = processKnownFunctionCall;
|
|
65
67
|
//# sourceMappingURL=known-call-handling.js.map
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.processNamedCall =
|
|
3
|
+
exports.processNamedCall = processNamedCall;
|
|
4
4
|
const info_1 = require("../../../../info");
|
|
5
5
|
const known_call_handling_1 = require("./known-call-handling");
|
|
6
6
|
const append_1 = require("../../../../environments/append");
|
|
7
7
|
const resolve_by_name_1 = require("../../../../environments/resolve-by-name");
|
|
8
|
+
const vertex_1 = require("../../../../graph/vertex");
|
|
9
|
+
const identifier_1 = require("../../../../environments/identifier");
|
|
8
10
|
function mergeInformation(info, newInfo) {
|
|
9
11
|
if (info === undefined) {
|
|
10
12
|
return newInfo;
|
|
@@ -20,18 +22,18 @@ function mergeInformation(info, newInfo) {
|
|
|
20
22
|
};
|
|
21
23
|
}
|
|
22
24
|
function processDefaultFunctionProcessor(information, name, args, rootId, data) {
|
|
23
|
-
const resolve = (0, resolve_by_name_1.resolveByName)(name.content, data.environment);
|
|
25
|
+
const resolve = (0, resolve_by_name_1.resolveByName)(name.content, data.environment, identifier_1.ReferenceType.Function);
|
|
24
26
|
/* if we do not know where we land, we force! */
|
|
25
27
|
const call = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs: (resolve?.length ?? 0) > 0 ? undefined : 'all' });
|
|
26
28
|
return mergeInformation(information, call.information);
|
|
27
29
|
}
|
|
28
30
|
function processNamedCall(name, args, rootId, data) {
|
|
29
|
-
const resolved = (0, resolve_by_name_1.resolveByName)(name.content, data.environment) ?? [];
|
|
31
|
+
const resolved = (0, resolve_by_name_1.resolveByName)(name.content, data.environment, identifier_1.ReferenceType.Function) ?? [];
|
|
30
32
|
let defaultProcessor = resolved.length === 0;
|
|
31
33
|
let information = undefined;
|
|
32
34
|
let builtIn = false;
|
|
33
35
|
for (const resolvedFunction of resolved) {
|
|
34
|
-
if (resolvedFunction.
|
|
36
|
+
if (resolvedFunction.type === identifier_1.ReferenceType.BuiltInFunction) {
|
|
35
37
|
builtIn = true;
|
|
36
38
|
information = mergeInformation(information, resolvedFunction.processor(name, args, rootId, data));
|
|
37
39
|
}
|
|
@@ -45,12 +47,11 @@ function processNamedCall(name, args, rootId, data) {
|
|
|
45
47
|
else if (information && builtIn) {
|
|
46
48
|
// mark the function call as built in only
|
|
47
49
|
const v = information.graph.getVertex(rootId);
|
|
48
|
-
if (v?.tag ===
|
|
50
|
+
if (v?.tag === vertex_1.VertexType.FunctionCall) {
|
|
49
51
|
v.onlyBuiltin = true;
|
|
50
52
|
v.environment = undefined;
|
|
51
53
|
}
|
|
52
54
|
}
|
|
53
55
|
return information ?? (0, info_1.initializeCleanDataflowInformation)(rootId, data);
|
|
54
56
|
}
|
|
55
|
-
exports.processNamedCall = processNamedCall;
|
|
56
57
|
//# sourceMappingURL=named-call-handling.js.map
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.UnnamedFunctionCallPrefix = void 0;
|
|
4
|
+
exports.processUnnamedFunctionCall = processUnnamedFunctionCall;
|
|
4
5
|
const processor_1 = require("../../../../processor");
|
|
5
6
|
const common_1 = require("./common");
|
|
6
7
|
const linker_1 = require("../../../linker");
|
|
8
|
+
const edge_1 = require("../../../../graph/edge");
|
|
7
9
|
const graph_1 = require("../../../../graph/graph");
|
|
10
|
+
const vertex_1 = require("../../../../graph/vertex");
|
|
11
|
+
const type_1 = require("../../../../../r-bridge/lang-4.x/ast/model/type");
|
|
8
12
|
const logger_1 = require("../../../../logger");
|
|
13
|
+
const identifier_1 = require("../../../../environments/identifier");
|
|
9
14
|
exports.UnnamedFunctionCallPrefix = 'unnamed-function-call-';
|
|
10
15
|
function processUnnamedFunctionCall(functionCall, data) {
|
|
11
16
|
const calledFunction = (0, processor_1.processDataflowFor)(functionCall.calledFunction, data);
|
|
@@ -15,8 +20,8 @@ function processUnnamedFunctionCall(functionCall, data) {
|
|
|
15
20
|
const functionCallName = `${exports.UnnamedFunctionCallPrefix}${functionRootId}`;
|
|
16
21
|
logger_1.dataflowLogger.debug(`Using ${functionRootId} as root for the unnamed function call`);
|
|
17
22
|
// we know that it calls the toplevel:
|
|
18
|
-
finalGraph.addEdge(functionRootId, calledRootId,
|
|
19
|
-
finalGraph.addEdge(functionRootId, calledRootId,
|
|
23
|
+
finalGraph.addEdge(functionRootId, calledRootId, edge_1.EdgeType.Calls);
|
|
24
|
+
finalGraph.addEdge(functionRootId, calledRootId, edge_1.EdgeType.Reads);
|
|
20
25
|
// keep the defined function
|
|
21
26
|
finalGraph.mergeWith(calledFunction.graph);
|
|
22
27
|
const { finalEnv, callArgs, remainingReadInArgs } = (0, common_1.processAllArguments)({
|
|
@@ -28,7 +33,7 @@ function processUnnamedFunctionCall(functionCall, data) {
|
|
|
28
33
|
/* we know the call is right there and fully resolved, there is no need to artificially force arguments as we identify them within the subtree */
|
|
29
34
|
});
|
|
30
35
|
finalGraph.addVertex({
|
|
31
|
-
tag:
|
|
36
|
+
tag: vertex_1.VertexType.FunctionCall,
|
|
32
37
|
id: functionRootId,
|
|
33
38
|
environment: data.environment,
|
|
34
39
|
name: functionCallName,
|
|
@@ -38,8 +43,8 @@ function processUnnamedFunctionCall(functionCall, data) {
|
|
|
38
43
|
args: callArgs // same reference
|
|
39
44
|
});
|
|
40
45
|
const inIds = remainingReadInArgs;
|
|
41
|
-
inIds.push({ nodeId: functionRootId, name: functionCallName, controlDependencies: data.controlDependencies });
|
|
42
|
-
if (functionCall.calledFunction.type ===
|
|
46
|
+
inIds.push({ nodeId: functionRootId, name: functionCallName, controlDependencies: data.controlDependencies, type: identifier_1.ReferenceType.Function });
|
|
47
|
+
if (functionCall.calledFunction.type === type_1.RType.FunctionDefinition) {
|
|
43
48
|
(0, linker_1.linkArgumentsOnCall)(callArgs, functionCall.calledFunction.parameters, finalGraph);
|
|
44
49
|
}
|
|
45
50
|
// push the called function to the ids:
|
|
@@ -55,5 +60,4 @@ function processUnnamedFunctionCall(functionCall, data) {
|
|
|
55
60
|
exitPoints: calledFunction.exitPoints
|
|
56
61
|
};
|
|
57
62
|
}
|
|
58
|
-
exports.processUnnamedFunctionCall = processUnnamedFunctionCall;
|
|
59
63
|
//# sourceMappingURL=unnamed-call-handling.js.map
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.linkReadsForArgument = linkReadsForArgument;
|
|
4
|
+
exports.processFunctionArgument = processFunctionArgument;
|
|
4
5
|
const processor_1 = require("../../../processor");
|
|
5
6
|
const collect_1 = require("../../../../r-bridge/lang-4.x/ast/model/collect");
|
|
6
7
|
const graph_1 = require("../../../graph/graph");
|
|
8
|
+
const type_1 = require("../../../../r-bridge/lang-4.x/ast/model/type");
|
|
9
|
+
const edge_1 = require("../../../graph/edge");
|
|
10
|
+
const vertex_1 = require("../../../graph/vertex");
|
|
7
11
|
function linkReadsForArgument(root, ingoingRefs, graph) {
|
|
8
|
-
const allIdsBeforeArguments = new Set((0, collect_1.collectAllIds)(root, n => n.type ===
|
|
12
|
+
const allIdsBeforeArguments = new Set((0, collect_1.collectAllIds)(root, n => n.type === type_1.RType.Argument && n.info.id !== root.info.id));
|
|
9
13
|
const ingoingBeforeArgs = ingoingRefs.filter(r => allIdsBeforeArguments.has(r.nodeId));
|
|
10
14
|
for (const ref of ingoingBeforeArgs) {
|
|
11
15
|
// link against the root reference currently I do not know how to deal with nested function calls otherwise
|
|
12
|
-
graph.addEdge(root.info.id, ref,
|
|
16
|
+
graph.addEdge(root.info.id, ref, edge_1.EdgeType.Reads);
|
|
13
17
|
}
|
|
14
18
|
}
|
|
15
|
-
exports.linkReadsForArgument = linkReadsForArgument;
|
|
16
19
|
function processFunctionArgument(argument, data) {
|
|
17
20
|
const name = argument.name === undefined ? undefined : (0, processor_1.processDataflowFor)(argument.name, data);
|
|
18
21
|
const value = argument.value === undefined ? undefined : (0, processor_1.processDataflowFor)(argument.value, data);
|
|
@@ -22,15 +25,15 @@ function processFunctionArgument(argument, data) {
|
|
|
22
25
|
let entryPoint = value?.entryPoint;
|
|
23
26
|
if (argumentName) {
|
|
24
27
|
graph.addVertex({
|
|
25
|
-
tag:
|
|
28
|
+
tag: vertex_1.VertexType.Use,
|
|
26
29
|
id: argument.info.id,
|
|
27
30
|
controlDependencies: data.controlDependencies
|
|
28
31
|
});
|
|
29
32
|
entryPoint = argument.info.id;
|
|
30
33
|
}
|
|
31
34
|
const ingoingRefs = [...value?.unknownReferences ?? [], ...value?.in ?? [], ...(name === undefined ? [] : [...name.in])];
|
|
32
|
-
if (entryPoint && argument.value?.type ===
|
|
33
|
-
graph.addEdge(entryPoint, argument.value.info.id,
|
|
35
|
+
if (entryPoint && argument.value?.type === type_1.RType.FunctionDefinition) {
|
|
36
|
+
graph.addEdge(entryPoint, argument.value.info.id, edge_1.EdgeType.Reads);
|
|
34
37
|
}
|
|
35
38
|
else if (argumentName) {
|
|
36
39
|
// we only need to link against those which are not already bound to another function call argument
|
|
@@ -47,5 +50,4 @@ function processFunctionArgument(argument, data) {
|
|
|
47
50
|
exitPoints: value?.exitPoints ?? name?.exitPoints ?? [{ nodeId: argument.info.id, type: 0 /* ExitPointType.Default */, controlDependencies: data.controlDependencies }]
|
|
48
51
|
};
|
|
49
52
|
}
|
|
50
|
-
exports.processFunctionArgument = processFunctionArgument;
|
|
51
53
|
//# sourceMappingURL=process-argument.js.map
|