@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,9 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.CriteriaParseError = void 0;
|
|
4
|
+
exports.slicingCriterionToId = slicingCriterionToId;
|
|
5
|
+
exports.convertAllSlicingCriteriaToIds = convertAllSlicingCriteriaToIds;
|
|
4
6
|
const log_1 = require("../../util/log");
|
|
5
7
|
const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
|
|
6
8
|
const static_slicer_1 = require("../static/static-slicer");
|
|
9
|
+
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
7
10
|
/**
|
|
8
11
|
* Thrown if the given slicing criteria can not be found
|
|
9
12
|
*/
|
|
@@ -35,7 +38,6 @@ function slicingCriterionToId(criterion, idMap) {
|
|
|
35
38
|
}
|
|
36
39
|
return resolved;
|
|
37
40
|
}
|
|
38
|
-
exports.slicingCriterionToId = slicingCriterionToId;
|
|
39
41
|
function locationToId(location, dataflowIdMap) {
|
|
40
42
|
let candidate;
|
|
41
43
|
for (const [id, nodeInfo] of dataflowIdMap.entries()) {
|
|
@@ -44,7 +46,7 @@ function locationToId(location, dataflowIdMap) {
|
|
|
44
46
|
}
|
|
45
47
|
(0, log_1.expensiveTrace)(static_slicer_1.slicerLogger, () => `can resolve id ${id} (${JSON.stringify(nodeInfo.location)}) for location ${JSON.stringify(location)}`);
|
|
46
48
|
// function calls have the same location as the symbol they refer to, so we need to prefer the function call
|
|
47
|
-
if (candidate !== undefined && nodeInfo.type !==
|
|
49
|
+
if (candidate !== undefined && nodeInfo.type !== type_1.RType.FunctionCall || nodeInfo.type === type_1.RType.Argument || nodeInfo.type === type_1.RType.ExpressionList) {
|
|
48
50
|
continue;
|
|
49
51
|
}
|
|
50
52
|
candidate = nodeInfo;
|
|
@@ -63,7 +65,7 @@ function conventionalCriteriaToId(line, name, dataflowIdMap) {
|
|
|
63
65
|
}
|
|
64
66
|
static_slicer_1.slicerLogger.trace(`can resolve id ${id} (${JSON.stringify(nodeInfo)}) for line ${line} and name ${name}`);
|
|
65
67
|
// function calls have the same location as the symbol they refer to, so we need to prefer the function call
|
|
66
|
-
if (candidate !== undefined && nodeInfo.type !==
|
|
68
|
+
if (candidate !== undefined && nodeInfo.type !== type_1.RType.FunctionCall || nodeInfo.type === type_1.RType.Argument || nodeInfo.type === type_1.RType.ExpressionList) {
|
|
67
69
|
continue;
|
|
68
70
|
}
|
|
69
71
|
candidate = nodeInfo;
|
|
@@ -77,5 +79,4 @@ function conventionalCriteriaToId(line, name, dataflowIdMap) {
|
|
|
77
79
|
function convertAllSlicingCriteriaToIds(criteria, decorated) {
|
|
78
80
|
return criteria.map(l => ({ criterion: l, id: slicingCriterionToId(l, decorated) }));
|
|
79
81
|
}
|
|
80
|
-
exports.convertAllSlicingCriteriaToIds = convertAllSlicingCriteriaToIds;
|
|
81
82
|
//# sourceMappingURL=parse.js.map
|
|
@@ -3,16 +3,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.envFingerprint = envFingerprint;
|
|
7
|
+
exports.fingerprint = fingerprint;
|
|
7
8
|
const object_hash_1 = __importDefault(require("object-hash"));
|
|
8
9
|
const environment_1 = require("../../dataflow/environments/environment");
|
|
9
10
|
const built_in_1 = require("../../dataflow/environments/built-in");
|
|
10
11
|
function envFingerprint(env) {
|
|
11
12
|
return (0, object_hash_1.default)(env, { excludeKeys: key => key === 'id', replacer: (v) => (v === environment_1.BuiltInEnvironment || v === built_in_1.EmptyBuiltInMemory) ? undefined : v });
|
|
12
13
|
}
|
|
13
|
-
exports.envFingerprint = envFingerprint;
|
|
14
14
|
function fingerprint(id, envFingerprint, onlyForSideEffects) {
|
|
15
15
|
return `${id}-${envFingerprint}-${onlyForSideEffects ? '0' : '1'}`;
|
|
16
16
|
}
|
|
17
|
-
exports.fingerprint = fingerprint;
|
|
18
17
|
//# sourceMappingURL=fingerprint.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.sliceForCall = sliceForCall;
|
|
4
|
+
exports.handleReturns = handleReturns;
|
|
4
5
|
const assert_1 = require("../../util/assert");
|
|
5
6
|
const fingerprint_1 = require("./fingerprint");
|
|
6
7
|
const linker_1 = require("../../dataflow/internal/linker");
|
|
@@ -11,6 +12,7 @@ const graph_1 = require("../../dataflow/graph/graph");
|
|
|
11
12
|
const built_in_1 = require("../../dataflow/environments/built-in");
|
|
12
13
|
const resolve_by_name_1 = require("../../dataflow/environments/resolve-by-name");
|
|
13
14
|
const edge_1 = require("../../dataflow/graph/edge");
|
|
15
|
+
const identifier_1 = require("../../dataflow/environments/identifier");
|
|
14
16
|
function retrieveActiveEnvironment(callerInfo, baseEnvironment) {
|
|
15
17
|
let callerEnvironment = callerInfo.environment;
|
|
16
18
|
const level = callerEnvironment?.level ?? 0;
|
|
@@ -36,7 +38,7 @@ function linkCallTargets(onlyForSideEffects, functionCallTargets, baseEnvironmen
|
|
|
36
38
|
for (const functionCallTarget of functionCallTargets) {
|
|
37
39
|
// all those linked within the scopes of other functions are already linked when exiting a function definition
|
|
38
40
|
for (const openIn of functionCallTarget.subflow.in) {
|
|
39
|
-
const defs = openIn.name ? (0, resolve_by_name_1.resolveByName)(openIn.name, activeEnvironment) : undefined;
|
|
41
|
+
const defs = openIn.name ? (0, resolve_by_name_1.resolveByName)(openIn.name, activeEnvironment, openIn.type) : undefined;
|
|
40
42
|
if (defs === undefined) {
|
|
41
43
|
continue;
|
|
42
44
|
}
|
|
@@ -61,9 +63,9 @@ function sliceForCall(current, callerInfo, dataflowGraph, queue) {
|
|
|
61
63
|
const activeEnvironmentFingerprint = (0, fingerprint_1.envFingerprint)(activeEnvironment);
|
|
62
64
|
const name = callerInfo.name;
|
|
63
65
|
(0, assert_1.guard)(name !== undefined, () => `name of id: ${callerInfo.id} can not be found in id map`);
|
|
64
|
-
const functionCallDefs = (0, resolve_by_name_1.resolveByName)(name, activeEnvironment)?.filter(d => d.definedAt !== built_in_1.BuiltIn)?.map(d => d.nodeId) ?? [];
|
|
66
|
+
const functionCallDefs = (0, resolve_by_name_1.resolveByName)(name, activeEnvironment, identifier_1.ReferenceType.Unknown)?.filter(d => d.definedAt !== built_in_1.BuiltIn)?.map(d => d.nodeId) ?? [];
|
|
65
67
|
for (const [target, outgoingEdge] of outgoingEdges[1].entries()) {
|
|
66
|
-
if ((0, edge_1.edgeIncludesType)(outgoingEdge.types,
|
|
68
|
+
if ((0, edge_1.edgeIncludesType)(outgoingEdge.types, edge_1.EdgeType.Calls)) {
|
|
67
69
|
functionCallDefs.push(target);
|
|
68
70
|
}
|
|
69
71
|
}
|
|
@@ -80,11 +82,10 @@ function sliceForCall(current, callerInfo, dataflowGraph, queue) {
|
|
|
80
82
|
}
|
|
81
83
|
linkCallTargets(current.onlyForSideEffects, functionCallTargets, baseEnvironment, baseEnvPrint, activeEnvironment, activeEnvironmentFingerprint, queue);
|
|
82
84
|
}
|
|
83
|
-
exports.sliceForCall = sliceForCall;
|
|
84
85
|
/** Returns true if we found at least one return edge */
|
|
85
86
|
function handleReturns(queue, currentEdges, baseEnvFingerprint, baseEnvironment) {
|
|
86
87
|
const e = [...currentEdges.entries()];
|
|
87
|
-
const found = e.filter(([_, edge]) => (0, edge_1.edgeIncludesType)(edge.types,
|
|
88
|
+
const found = e.filter(([_, edge]) => (0, edge_1.edgeIncludesType)(edge.types, edge_1.EdgeType.Returns));
|
|
88
89
|
if (found.length === 0) {
|
|
89
90
|
return false;
|
|
90
91
|
}
|
|
@@ -92,10 +93,10 @@ function handleReturns(queue, currentEdges, baseEnvFingerprint, baseEnvironment)
|
|
|
92
93
|
queue.add(target, baseEnvironment, baseEnvFingerprint, false);
|
|
93
94
|
}
|
|
94
95
|
for (const [target, edge] of e) {
|
|
95
|
-
if ((0, edge_1.edgeIncludesType)(edge.types,
|
|
96
|
+
if ((0, edge_1.edgeIncludesType)(edge.types, edge_1.EdgeType.Reads)) {
|
|
96
97
|
queue.add(target, baseEnvironment, baseEnvFingerprint, false);
|
|
97
98
|
}
|
|
98
|
-
else if ((0, edge_1.edgeIncludesType)(edge.types,
|
|
99
|
+
else if ((0, edge_1.edgeIncludesType)(edge.types, edge_1.EdgeType.Argument)) {
|
|
99
100
|
queue.potentialArguments.set(target, {
|
|
100
101
|
id: target,
|
|
101
102
|
baseEnvironment,
|
|
@@ -105,5 +106,4 @@ function handleReturns(queue, currentEdges, baseEnvFingerprint, baseEnvironment)
|
|
|
105
106
|
}
|
|
106
107
|
return true;
|
|
107
108
|
}
|
|
108
|
-
exports.handleReturns = handleReturns;
|
|
109
109
|
//# sourceMappingURL=slice-call.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.slicerLogger = void 0;
|
|
4
|
+
exports.staticSlicing = staticSlicing;
|
|
4
5
|
const assert_1 = require("../../util/assert");
|
|
5
6
|
const log_1 = require("../../util/log");
|
|
6
7
|
const fingerprint_1 = require("./fingerprint");
|
|
@@ -8,6 +9,7 @@ const visiting_queue_1 = require("./visiting-queue");
|
|
|
8
9
|
const slice_call_1 = require("./slice-call");
|
|
9
10
|
const parse_1 = require("../criterion/parse");
|
|
10
11
|
const environment_1 = require("../../dataflow/environments/environment");
|
|
12
|
+
const vertex_1 = require("../../dataflow/graph/vertex");
|
|
11
13
|
const edge_1 = require("../../dataflow/graph/edge");
|
|
12
14
|
exports.slicerLogger = log_1.log.getSubLogger({ name: 'slicer' });
|
|
13
15
|
/**
|
|
@@ -64,7 +66,7 @@ function staticSlicing(graph, { idMap }, criteria, threshold = 75) {
|
|
|
64
66
|
}
|
|
65
67
|
}
|
|
66
68
|
if (!onlyForSideEffects) {
|
|
67
|
-
if (currentVertex.tag ===
|
|
69
|
+
if (currentVertex.tag === vertex_1.VertexType.FunctionCall && !currentVertex.onlyBuiltin) {
|
|
68
70
|
(0, slice_call_1.sliceForCall)(current, currentVertex, graph, queue);
|
|
69
71
|
}
|
|
70
72
|
const ret = (0, slice_call_1.handleReturns)(queue, currentEdges, baseEnvFingerprint, baseEnvironment);
|
|
@@ -73,7 +75,7 @@ function staticSlicing(graph, { idMap }, criteria, threshold = 75) {
|
|
|
73
75
|
}
|
|
74
76
|
}
|
|
75
77
|
for (const [target, { types }] of currentEdges) {
|
|
76
|
-
if ((0, edge_1.edgeIncludesType)(types,
|
|
78
|
+
if ((0, edge_1.edgeIncludesType)(types, edge_1.EdgeType.NonStandardEvaluation)) {
|
|
77
79
|
continue;
|
|
78
80
|
}
|
|
79
81
|
const t = (0, edge_1.shouldTraverseEdge)(types);
|
|
@@ -94,5 +96,4 @@ function staticSlicing(graph, { idMap }, criteria, threshold = 75) {
|
|
|
94
96
|
}
|
|
95
97
|
return { ...queue.status(), decodedCriteria };
|
|
96
98
|
}
|
|
97
|
-
exports.staticSlicing = staticSlicing;
|
|
98
99
|
//# sourceMappingURL=static-slicer.js.map
|
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.emptyCommonSyntaxTypeCounts = emptyCommonSyntaxTypeCounts;
|
|
4
|
+
exports.updateCommonSyntaxTypeCounts = updateCommonSyntaxTypeCounts;
|
|
5
|
+
exports.appendCommonSyntaxTypeCounter = appendCommonSyntaxTypeCounter;
|
|
6
|
+
exports.summarizeCommonSyntaxTypeCounter = summarizeCommonSyntaxTypeCounter;
|
|
4
7
|
/**
|
|
5
8
|
* Defines the type of syntax constructs that we track (e.g., true, false, 0, 1, T, F, conditions...)
|
|
6
9
|
*/
|
|
7
10
|
const numbers_1 = require("../../util/numbers");
|
|
8
11
|
const summarizer_1 = require("../../util/summarizer");
|
|
9
12
|
const convert_values_1 = require("../../r-bridge/lang-4.x/convert-values");
|
|
13
|
+
const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
|
|
10
14
|
function emptyCommonSyntaxTypeCounts(init = () => 0n) {
|
|
11
15
|
return {
|
|
12
16
|
total: init(),
|
|
@@ -27,7 +31,6 @@ function emptyCommonSyntaxTypeCounts(init = () => 0n) {
|
|
|
27
31
|
other: {}
|
|
28
32
|
};
|
|
29
33
|
}
|
|
30
|
-
exports.emptyCommonSyntaxTypeCounts = emptyCommonSyntaxTypeCounts;
|
|
31
34
|
function incrementEntry(map, key) {
|
|
32
35
|
map[key] = (map[key] ?? 0n) + 1n;
|
|
33
36
|
}
|
|
@@ -45,7 +48,7 @@ function updateCommonSyntaxTypeCounts(current, ...nodes) {
|
|
|
45
48
|
return current;
|
|
46
49
|
}
|
|
47
50
|
let node = nodes[0];
|
|
48
|
-
if (node.type ===
|
|
51
|
+
if (node.type === type_1.RType.Argument) {
|
|
49
52
|
if (node.name !== undefined) {
|
|
50
53
|
current.withArgument++;
|
|
51
54
|
}
|
|
@@ -58,16 +61,16 @@ function updateCommonSyntaxTypeCounts(current, ...nodes) {
|
|
|
58
61
|
}
|
|
59
62
|
}
|
|
60
63
|
switch (node.type) {
|
|
61
|
-
case
|
|
64
|
+
case type_1.RType.String:
|
|
62
65
|
incrementEntry(current.string, node.content.str);
|
|
63
66
|
break;
|
|
64
|
-
case
|
|
67
|
+
case type_1.RType.Symbol:
|
|
65
68
|
incrementEntry(current.singleVar, node.content);
|
|
66
69
|
break;
|
|
67
|
-
case
|
|
70
|
+
case type_1.RType.Logical:
|
|
68
71
|
incrementEntry(current.logical, node.content ? convert_values_1.RTrue : convert_values_1.RFalse);
|
|
69
72
|
break;
|
|
70
|
-
case
|
|
73
|
+
case type_1.RType.Number:
|
|
71
74
|
if (node.content.complexNumber) {
|
|
72
75
|
incrementEntry(current.complex, node.content.num);
|
|
73
76
|
}
|
|
@@ -78,7 +81,7 @@ function updateCommonSyntaxTypeCounts(current, ...nodes) {
|
|
|
78
81
|
incrementEntry(current.number, node.content.num);
|
|
79
82
|
}
|
|
80
83
|
break;
|
|
81
|
-
case
|
|
84
|
+
case type_1.RType.FunctionCall:
|
|
82
85
|
if (!node.named) {
|
|
83
86
|
current.unnamedCall++;
|
|
84
87
|
}
|
|
@@ -86,10 +89,10 @@ function updateCommonSyntaxTypeCounts(current, ...nodes) {
|
|
|
86
89
|
incrementEntry(current.call, node.functionName.content);
|
|
87
90
|
}
|
|
88
91
|
break;
|
|
89
|
-
case
|
|
92
|
+
case type_1.RType.BinaryOp:
|
|
90
93
|
incrementEntry(current.binOp, node.operator);
|
|
91
94
|
break;
|
|
92
|
-
case
|
|
95
|
+
case type_1.RType.UnaryOp:
|
|
93
96
|
incrementEntry(current.unaryOp, node.operator);
|
|
94
97
|
break;
|
|
95
98
|
default:
|
|
@@ -101,7 +104,6 @@ function updateCommonSyntaxTypeCounts(current, ...nodes) {
|
|
|
101
104
|
}
|
|
102
105
|
return current;
|
|
103
106
|
}
|
|
104
|
-
exports.updateCommonSyntaxTypeCounts = updateCommonSyntaxTypeCounts;
|
|
105
107
|
function appendRecord(a, b) {
|
|
106
108
|
for (const [key, val] of Object.entries(b)) {
|
|
107
109
|
const get = a[key];
|
|
@@ -131,7 +133,6 @@ function appendCommonSyntaxTypeCounter(a, b) {
|
|
|
131
133
|
appendRecord(a.unaryOp, b.unaryOp);
|
|
132
134
|
appendRecord(a.other, b.other);
|
|
133
135
|
}
|
|
134
|
-
exports.appendCommonSyntaxTypeCounter = appendCommonSyntaxTypeCounter;
|
|
135
136
|
function summarizeRecord(a) {
|
|
136
137
|
return Object.fromEntries(Object.entries(a).map(([key, val]) => [key, (0, summarizer_1.summarizeMeasurement)(val.flat(), val.length)]));
|
|
137
138
|
}
|
|
@@ -155,5 +156,4 @@ function summarizeCommonSyntaxTypeCounter(a) {
|
|
|
155
156
|
other: summarizeRecord(a.other)
|
|
156
157
|
};
|
|
157
158
|
}
|
|
158
|
-
exports.summarizeCommonSyntaxTypeCounter = summarizeCommonSyntaxTypeCounter;
|
|
159
159
|
//# sourceMappingURL=common-syntax-probability.js.map
|
|
@@ -11,6 +11,7 @@ import type { StatisticsSummarizerConfiguration } from '../summarizer/summarizer
|
|
|
11
11
|
import type { MergeableRecord } from '../../util/objects';
|
|
12
12
|
import type { DataflowInformation } from '../../dataflow/info';
|
|
13
13
|
import type { NormalizedAst } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
14
|
+
import type { Document } from '@xmldom/xmldom';
|
|
14
15
|
/**
|
|
15
16
|
* Maps each sub-feature name to the number of occurrences of that sub-feature.
|
|
16
17
|
* Allows for one nesting level to denote hierarchical features.
|
|
@@ -97,17 +98,12 @@ export declare const ALL_FEATURES: {
|
|
|
97
98
|
lambdasOnly: number;
|
|
98
99
|
assignedFunctions: number;
|
|
99
100
|
nestedFunctions: number;
|
|
100
|
-
recursive: number;
|
|
101
|
-
* Maps each sub-feature name to the number of occurrences of that sub-feature.
|
|
102
|
-
* Allows for one nesting level to denote hierarchical features.
|
|
103
|
-
* <p>
|
|
104
|
-
* Since we are writing to files {@link process}, we only count feature occurrences (some feature/parts are not written to file)
|
|
105
|
-
*/
|
|
101
|
+
recursive: number;
|
|
106
102
|
deepestNesting: number;
|
|
107
103
|
}>>;
|
|
108
104
|
readonly usedFunctions: Feature<import("ts-essentials").Writable<{
|
|
109
105
|
allFunctionCalls: number;
|
|
110
|
-
args: Record<number, bigint | import("./common-syntax-probability").CommonSyntaxTypeCounts
|
|
106
|
+
args: Record<number, bigint | import("./common-syntax-probability").CommonSyntaxTypeCounts>;
|
|
111
107
|
nestedFunctionCalls: number;
|
|
112
108
|
deepestNesting: number;
|
|
113
109
|
unnamedCalls: number;
|
|
@@ -152,8 +148,8 @@ export declare const ALL_FEATURES: {
|
|
|
152
148
|
switchCase: import("./common-syntax-probability").CommonSyntaxTypeCounts<bigint>;
|
|
153
149
|
}>>;
|
|
154
150
|
readonly dataAccess: Feature<import("ts-essentials").Writable<{
|
|
155
|
-
singleBracket: Record<number, bigint | import("./common-syntax-probability").CommonSyntaxTypeCounts
|
|
156
|
-
doubleBracket: Record<number, bigint | import("./common-syntax-probability").CommonSyntaxTypeCounts
|
|
151
|
+
singleBracket: Record<number, bigint | import("./common-syntax-probability").CommonSyntaxTypeCounts>;
|
|
152
|
+
doubleBracket: Record<number, bigint | import("./common-syntax-probability").CommonSyntaxTypeCounts>;
|
|
157
153
|
chainedOrNestedAccess: number;
|
|
158
154
|
longestChain: number;
|
|
159
155
|
deepestNesting: number;
|
|
@@ -17,7 +17,7 @@ const assignments_1 = require("./supported/assignments/assignments");
|
|
|
17
17
|
const loops_1 = require("./supported/loops/loops");
|
|
18
18
|
const control_flow_1 = require("./supported/control-flow/control-flow");
|
|
19
19
|
const data_access_1 = require("./supported/data-access/data-access");
|
|
20
|
-
const
|
|
20
|
+
const statistics_expression_list_1 = require("./supported/expression-list/statistics-expression-list");
|
|
21
21
|
const variables_1 = require("./supported/variables/variables");
|
|
22
22
|
/**
|
|
23
23
|
* The source of truth for all features that are supported by the statistics.
|
|
@@ -32,7 +32,7 @@ exports.ALL_FEATURES = {
|
|
|
32
32
|
loops: loops_1.loops,
|
|
33
33
|
controlflow: control_flow_1.controlflow,
|
|
34
34
|
dataAccess: data_access_1.dataAccess,
|
|
35
|
-
expressionList:
|
|
35
|
+
expressionList: statistics_expression_list_1.expressionList,
|
|
36
36
|
variables: variables_1.variables
|
|
37
37
|
};
|
|
38
38
|
exports.allFeatureNames = new Set(Object.keys(exports.ALL_FEATURES));
|
|
@@ -3,7 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.emptySummarizedWithProject = emptySummarizedWithProject;
|
|
7
|
+
exports.recordFilePath = recordFilePath;
|
|
7
8
|
const path_1 = __importDefault(require("path"));
|
|
8
9
|
function emptySummarizedWithProject() {
|
|
9
10
|
return {
|
|
@@ -12,10 +13,8 @@ function emptySummarizedWithProject() {
|
|
|
12
13
|
count: []
|
|
13
14
|
};
|
|
14
15
|
}
|
|
15
|
-
exports.emptySummarizedWithProject = emptySummarizedWithProject;
|
|
16
16
|
function recordFilePath(summarize, filepath, config) {
|
|
17
17
|
summarize.uniqueFiles.add(filepath);
|
|
18
18
|
summarize.uniqueProjects.add(filepath.split(path_1.default.sep)[config.projectSkip] ?? '');
|
|
19
19
|
}
|
|
20
|
-
exports.recordFilePath = recordFilePath;
|
|
21
20
|
//# sourceMappingURL=post-processing.js.map
|
|
@@ -4,6 +4,7 @@ exports.assignments = exports.AssignmentOperators = void 0;
|
|
|
4
4
|
const common_syntax_probability_1 = require("../../common-syntax-probability");
|
|
5
5
|
const post_process_1 = require("./post-process");
|
|
6
6
|
const visitor_1 = require("../../../../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
7
|
+
const type_1 = require("../../../../r-bridge/lang-4.x/ast/model/type");
|
|
7
8
|
const operators_1 = require("../../../../r-bridge/lang-4.x/ast/model/operators");
|
|
8
9
|
const initialAssignmentInfo = {
|
|
9
10
|
// operator to occurrence count
|
|
@@ -17,7 +18,7 @@ exports.AssignmentOperators = new Set(operators_1.Operators.filter(op => operato
|
|
|
17
18
|
function visitAssignment(info, input) {
|
|
18
19
|
const assignmentStack = [];
|
|
19
20
|
(0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
|
|
20
|
-
if (node.type !==
|
|
21
|
+
if (node.type !== type_1.RType.BinaryOp || !exports.AssignmentOperators.has(node.operator)) {
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
23
24
|
if (assignmentStack.length > 0) {
|
|
@@ -37,7 +38,7 @@ function visitAssignment(info, input) {
|
|
|
37
38
|
}
|
|
38
39
|
}, node => {
|
|
39
40
|
// drop again :D
|
|
40
|
-
if (node.type ===
|
|
41
|
+
if (node.type === type_1.RType.BinaryOp && node.flavor === 'assignment') {
|
|
41
42
|
assignmentStack.pop();
|
|
42
43
|
}
|
|
43
44
|
});
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.postProcess =
|
|
6
|
+
exports.postProcess = postProcess;
|
|
7
7
|
const common_syntax_probability_1 = require("../../common-syntax-probability");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -120,5 +120,4 @@ function postProcess(featureRoot, info, outputPath, config) {
|
|
|
120
120
|
writeAssignmentMetadataToCsv(outputPath, collected);
|
|
121
121
|
writeAssignedTypesToCsv(outputPath, collected);
|
|
122
122
|
}
|
|
123
|
-
exports.postProcess = postProcess;
|
|
124
123
|
//# sourceMappingURL=post-process.js.map
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.postProcess =
|
|
6
|
+
exports.postProcess = postProcess;
|
|
7
7
|
const comments_1 = require("./comments");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -45,5 +45,4 @@ function postProcess(featureRoot, info, outputPath, config) {
|
|
|
45
45
|
fnOutStream.write(`${JSON.stringify(key)},${uniqueProjects.size},${uniqueFiles.size},${(0, summarizer_1.summarizedMeasurement2Csv)(counts)},${(0, summarizer_1.summarizedMeasurement2Csv)(lineFrac)}\n`);
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
exports.postProcess = postProcess;
|
|
49
48
|
//# sourceMappingURL=post-process.js.map
|
|
@@ -4,6 +4,7 @@ exports.controlflow = void 0;
|
|
|
4
4
|
const common_syntax_probability_1 = require("../../common-syntax-probability");
|
|
5
5
|
const post_process_1 = require("./post-process");
|
|
6
6
|
const unpack_argument_1 = require("../../../../dataflow/internal/process/functions/call/argument/unpack-argument");
|
|
7
|
+
const type_1 = require("../../../../r-bridge/lang-4.x/ast/model/type");
|
|
7
8
|
const visitor_1 = require("../../../../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
8
9
|
const initialControlflowInfo = {
|
|
9
10
|
ifThen: (0, common_syntax_probability_1.emptyCommonSyntaxTypeCounts)(),
|
|
@@ -20,8 +21,8 @@ const initialControlflowInfo = {
|
|
|
20
21
|
function visitIfThenElse(info, input) {
|
|
21
22
|
const ifThenElseStack = [];
|
|
22
23
|
(0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
|
|
23
|
-
if (node.type !==
|
|
24
|
-
if (node.type ===
|
|
24
|
+
if (node.type !== type_1.RType.IfThenElse) {
|
|
25
|
+
if (node.type === type_1.RType.FunctionCall && node.named && node.functionName.content === 'switch') {
|
|
25
26
|
const initialArg = (0, unpack_argument_1.unpackArgument)(node.arguments[0]);
|
|
26
27
|
if (initialArg) {
|
|
27
28
|
info.switchCase = (0, common_syntax_probability_1.updateCommonSyntaxTypeCounts)(info.switchCase, initialArg);
|
|
@@ -50,7 +51,7 @@ function visitIfThenElse(info, input) {
|
|
|
50
51
|
}
|
|
51
52
|
}, node => {
|
|
52
53
|
// drop again :D
|
|
53
|
-
if (node.type ===
|
|
54
|
+
if (node.type === type_1.RType.IfThenElse) {
|
|
54
55
|
ifThenElseStack.pop();
|
|
55
56
|
}
|
|
56
57
|
});
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.postProcess =
|
|
6
|
+
exports.postProcess = postProcess;
|
|
7
7
|
const common_syntax_probability_1 = require("../../common-syntax-probability");
|
|
8
8
|
const post_processing_1 = require("../../post-processing");
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -60,5 +60,4 @@ function postProcess(featureRoot, info, outputPath, config) {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
exports.postProcess = postProcess;
|
|
64
63
|
//# sourceMappingURL=post-process.js.map
|
|
@@ -2,8 +2,8 @@ import type { Feature } from '../../feature';
|
|
|
2
2
|
import type { Writable } from 'ts-essentials';
|
|
3
3
|
import type { CommonSyntaxTypeCounts } from '../../common-syntax-probability';
|
|
4
4
|
declare const initialDataAccessInfo: {
|
|
5
|
-
singleBracket: Record<number, bigint | CommonSyntaxTypeCounts
|
|
6
|
-
doubleBracket: Record<number, bigint | CommonSyntaxTypeCounts
|
|
5
|
+
singleBracket: Record<number, bigint | CommonSyntaxTypeCounts>;
|
|
6
|
+
doubleBracket: Record<number, bigint | CommonSyntaxTypeCounts>;
|
|
7
7
|
chainedOrNestedAccess: number;
|
|
8
8
|
longestChain: number;
|
|
9
9
|
deepestNesting: number;
|
|
@@ -4,6 +4,7 @@ exports.dataAccess = void 0;
|
|
|
4
4
|
const common_syntax_probability_1 = require("../../common-syntax-probability");
|
|
5
5
|
const post_process_1 = require("./post-process");
|
|
6
6
|
const assert_1 = require("../../../../util/assert");
|
|
7
|
+
const type_1 = require("../../../../r-bridge/lang-4.x/ast/model/type");
|
|
7
8
|
const visitor_1 = require("../../../../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
8
9
|
const role_1 = require("../../../../r-bridge/lang-4.x/ast/model/processing/role");
|
|
9
10
|
const statistics_file_1 = require("../../../output/statistics-file");
|
|
@@ -46,7 +47,7 @@ function visitAccess(info, input) {
|
|
|
46
47
|
const accessChain = [];
|
|
47
48
|
const parentRoleCache = new Map();
|
|
48
49
|
(0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
|
|
49
|
-
if (node.type !==
|
|
50
|
+
if (node.type !== type_1.RType.Access) {
|
|
50
51
|
return;
|
|
51
52
|
}
|
|
52
53
|
const roles = (0, role_1.rolesOfParents)(node, input.normalizedRAst.idMap);
|
|
@@ -96,7 +97,7 @@ function visitAccess(info, input) {
|
|
|
96
97
|
(0, assert_1.guard)(Array.isArray(node.access), '[ and [[ must provide access as array');
|
|
97
98
|
}, node => {
|
|
98
99
|
// drop again :D
|
|
99
|
-
if (node.type ===
|
|
100
|
+
if (node.type === type_1.RType.Access) {
|
|
100
101
|
const ctx = parentRoleCache.get(node.info.id);
|
|
101
102
|
if (ctx?.acc) {
|
|
102
103
|
accessChain.pop();
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.postProcess =
|
|
6
|
+
exports.postProcess = postProcess;
|
|
7
7
|
const common_syntax_probability_1 = require("../../common-syntax-probability");
|
|
8
8
|
const post_processing_1 = require("../../post-processing");
|
|
9
9
|
const fs_1 = __importDefault(require("fs"));
|
|
@@ -102,5 +102,4 @@ function postProcess(featureRoot, info, outputPath, config) {
|
|
|
102
102
|
}
|
|
103
103
|
metaOut.close();
|
|
104
104
|
}
|
|
105
|
-
exports.postProcess = postProcess;
|
|
106
105
|
//# sourceMappingURL=post-process.js.map
|
|
@@ -5,8 +5,10 @@ const post_process_1 = require("./post-process");
|
|
|
5
5
|
const range_1 = require("../../../../util/range");
|
|
6
6
|
const assert_1 = require("../../../../util/assert");
|
|
7
7
|
const edge_1 = require("../../../../dataflow/graph/edge");
|
|
8
|
+
const type_1 = require("../../../../r-bridge/lang-4.x/ast/model/type");
|
|
8
9
|
const visitor_1 = require("../../../../r-bridge/lang-4.x/ast/model/processing/visitor");
|
|
9
10
|
const statistics_file_1 = require("../../../output/statistics-file");
|
|
11
|
+
const vertex_1 = require("../../../../dataflow/graph/vertex");
|
|
10
12
|
const initialFunctionDefinitionInfo = {
|
|
11
13
|
/** all, anonymous, assigned, non-assigned, ... */
|
|
12
14
|
total: 0,
|
|
@@ -24,7 +26,7 @@ function retrieveAllCallsites(input, node, recursiveCalls) {
|
|
|
24
26
|
const dfStart = input.dataflow.graph.outgoingEdges(node.info.id);
|
|
25
27
|
const callsites = [];
|
|
26
28
|
for (const [target, edge] of dfStart ?? []) {
|
|
27
|
-
if (!(0, edge_1.edgeIncludesType)(edge.types,
|
|
29
|
+
if (!(0, edge_1.edgeIncludesType)(edge.types, edge_1.EdgeType.Calls)) {
|
|
28
30
|
continue;
|
|
29
31
|
}
|
|
30
32
|
const loc = input.normalizedRAst.idMap.get(target)?.location;
|
|
@@ -44,7 +46,7 @@ function visitDefinitions(info, input) {
|
|
|
44
46
|
const definitionStack = [];
|
|
45
47
|
const allDefinitions = [];
|
|
46
48
|
(0, visitor_1.visitAst)(input.normalizedRAst.ast, node => {
|
|
47
|
-
if (node.type !==
|
|
49
|
+
if (node.type !== type_1.RType.FunctionDefinition) {
|
|
48
50
|
return;
|
|
49
51
|
}
|
|
50
52
|
const graph = input.dataflow.graph;
|
|
@@ -54,7 +56,7 @@ function visitDefinitions(info, input) {
|
|
|
54
56
|
return;
|
|
55
57
|
}
|
|
56
58
|
const [fnDefinition] = dfNode;
|
|
57
|
-
(0, assert_1.guard)(fnDefinition.tag ===
|
|
59
|
+
(0, assert_1.guard)(fnDefinition.tag === vertex_1.VertexType.FunctionDefinition, () => `Dataflow node is not a function definition (${JSON.stringify(fnDefinition)}))})`);
|
|
58
60
|
const returnTypes = fnDefinition.exitPoints.map(ep => graph.get(ep, true)).filter(assert_1.isNotUndefined)
|
|
59
61
|
.map(([vertex]) => {
|
|
60
62
|
const l = graph.idMap?.get(vertex.id)?.location;
|
|
@@ -81,7 +83,7 @@ function visitDefinitions(info, input) {
|
|
|
81
83
|
const edges = input.dataflow.graph.ingoingEdges(node.info.id);
|
|
82
84
|
if (edges !== undefined) {
|
|
83
85
|
for (const [targetId, edge] of edges) {
|
|
84
|
-
if ((0, edge_1.edgeIncludesType)(edge.types,
|
|
86
|
+
if ((0, edge_1.edgeIncludesType)(edge.types, edge_1.EdgeType.DefinedBy)) {
|
|
85
87
|
const target = input.normalizedRAst.idMap.get(targetId);
|
|
86
88
|
(0, assert_1.guard)(target !== undefined, 'Dataflow edge points to unknown node');
|
|
87
89
|
const name = target.info.fullLexeme ?? target.lexeme;
|
|
@@ -91,7 +93,7 @@ function visitDefinitions(info, input) {
|
|
|
91
93
|
info.assignedFunctions++;
|
|
92
94
|
(0, statistics_file_1.appendStatisticsFile)(exports.definedFunctions.name, 'assignedFunctions', [name ?? '<unknown>'], input.filepath);
|
|
93
95
|
}
|
|
94
|
-
if ((0, edge_1.edgeIncludesType)(edge.types,
|
|
96
|
+
if ((0, edge_1.edgeIncludesType)(edge.types, edge_1.EdgeType.Calls)) {
|
|
95
97
|
const target = input.normalizedRAst.idMap.get(targetId);
|
|
96
98
|
(0, assert_1.guard)(target !== undefined, 'Dataflow edge points to unknown node');
|
|
97
99
|
}
|
|
@@ -100,7 +102,7 @@ function visitDefinitions(info, input) {
|
|
|
100
102
|
// track all calls with the same name that do not already have a bound calls edge, superfluous if recursive tracking is explicit
|
|
101
103
|
const recursiveCalls = [];
|
|
102
104
|
(0, visitor_1.visitAst)(node.body, n => {
|
|
103
|
-
if (n.type ===
|
|
105
|
+
if (n.type === type_1.RType.FunctionCall && n.named && assigned.has(n.functionName.lexeme)) {
|
|
104
106
|
recursiveCalls.push(n);
|
|
105
107
|
}
|
|
106
108
|
});
|
|
@@ -122,7 +124,7 @@ function visitDefinitions(info, input) {
|
|
|
122
124
|
});
|
|
123
125
|
}, node => {
|
|
124
126
|
// drop again :D
|
|
125
|
-
if (node.type ===
|
|
127
|
+
if (node.type === type_1.RType.FunctionDefinition) {
|
|
126
128
|
definitionStack.pop();
|
|
127
129
|
}
|
|
128
130
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { FeatureStatisticsWithMeta } from '../../feature';
|
|
2
2
|
import type { StatisticsSummarizerConfiguration } from '../../../summarizer/summarizer';
|
|
3
3
|
/**
|
|
4
|
-
* Note: the summary does not contain a 0 for each function that is _not_ called by a file. Hence, the minimum can not be 0 (division for mean etc. will still be performed on total file count)
|
|
4
|
+
* Note: the summary does not contain a 0, for each function that `is _not_ called` by a file. Hence, the minimum can not be 0 (division for mean etc. will still be performed on total file count)
|
|
5
5
|
*/
|
|
6
6
|
export declare function postProcess(featureRoot: string, info: Map<string, FeatureStatisticsWithMeta>, outputPath: string, config: StatisticsSummarizerConfiguration): void;
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.postProcess =
|
|
6
|
+
exports.postProcess = postProcess;
|
|
7
7
|
const path_1 = __importDefault(require("path"));
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const defined_functions_1 = require("./defined-functions");
|
|
@@ -112,7 +112,7 @@ function retrieveAssignedFunctionNames(featureRoot, config, outputPath) {
|
|
|
112
112
|
varNamesOut.close();
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
115
|
-
* Note: the summary does not contain a 0 for each function that is _not_ called by a file. Hence, the minimum can not be 0 (division for mean etc. will still be performed on total file count)
|
|
115
|
+
* Note: the summary does not contain a 0, for each function that `is _not_ called` by a file. Hence, the minimum can not be 0 (division for mean etc. will still be performed on total file count)
|
|
116
116
|
*/
|
|
117
117
|
function postProcess(featureRoot, info, outputPath, config) {
|
|
118
118
|
// each number[][] contains a 'number[]' per file
|
|
@@ -121,7 +121,6 @@ function postProcess(featureRoot, info, outputPath, config) {
|
|
|
121
121
|
retrieveMetaInformation(info, config, outputPath);
|
|
122
122
|
retrieveAssignedFunctionNames(featureRoot, config, outputPath);
|
|
123
123
|
}
|
|
124
|
-
exports.postProcess = postProcess;
|
|
125
124
|
function emptyFunctionDefinitionSummary() {
|
|
126
125
|
return {
|
|
127
126
|
total: [],
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.postProcess =
|
|
6
|
+
exports.postProcess = postProcess;
|
|
7
7
|
const post_processing_1 = require("../../post-processing");
|
|
8
8
|
const fs_1 = __importDefault(require("fs"));
|
|
9
9
|
const path_1 = __importDefault(require("path"));
|
|
@@ -39,5 +39,4 @@ function postProcess(featureRoot, info, outputPath, config) {
|
|
|
39
39
|
}
|
|
40
40
|
variablesOutStream.close();
|
|
41
41
|
}
|
|
42
|
-
exports.postProcess = postProcess;
|
|
43
42
|
//# sourceMappingURL=post-process.js.map
|