@eagleoutice/flowr 2.16.5 → 2.16.7
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/README.md +21 -15
- package/abstract-interpretation/data-frame/dataframe-semantics.d.ts +2 -0
- package/abstract-interpretation/data-frame/dataframe-semantics.js +3 -1
- package/abstract-interpretation/data-frame/resolve-args.d.ts +1 -7
- package/abstract-interpretation/data-frame/resolve-args.js +2 -11
- package/cli/repl/commands/repl-cfg.js +5 -19
- package/cli/repl/commands/repl-code-command.d.ts +10 -0
- package/cli/repl/commands/repl-code-command.js +18 -0
- package/cli/repl/commands/repl-dataflow.js +34 -59
- package/cli/repl/commands/repl-normalize.js +24 -41
- package/cli/repl/commands/repl-query.js +10 -17
- package/config.js +3 -3
- package/control-flow/cfg-dead-code.js +15 -2
- package/control-flow/useless-loop.js +1 -2
- package/data/r-base-packages.generated.d.ts +1 -1
- package/data/r-base-packages.generated.js +3 -3
- package/dataflow/environments/ambient-state-name.d.ts +80 -0
- package/dataflow/environments/ambient-state-name.js +113 -0
- package/dataflow/environments/built-in-eval-name.d.ts +3 -1
- package/dataflow/environments/built-in-eval-name.js +2 -0
- package/dataflow/environments/built-in-props.d.ts +27 -7
- package/dataflow/environments/built-in-props.js +59 -44
- package/dataflow/environments/built-in.d.ts +5 -2
- package/dataflow/environments/built-in.js +22 -5
- package/dataflow/environments/default-builtin-config.d.ts +538 -14
- package/dataflow/environments/default-builtin-config.js +189 -123
- package/dataflow/environments/environment.d.ts +7 -1
- package/dataflow/environments/environment.js +19 -1
- package/dataflow/environments/identifier.d.ts +11 -0
- package/dataflow/eval/resolve/alias-tracking.d.ts +13 -3
- package/dataflow/eval/resolve/alias-tracking.js +66 -37
- package/dataflow/eval/resolve/resolve-argument.d.ts +4 -2
- package/dataflow/eval/resolve/resolve-argument.js +23 -11
- package/dataflow/eval/resolve/resolve.d.ts +5 -0
- package/dataflow/eval/resolve/resolve.js +25 -3
- package/dataflow/eval/values/r-value.d.ts +4 -2
- package/dataflow/eval/values/r-value.js +3 -1
- package/dataflow/eval/values/string/string-constants.d.ts +7 -1
- package/dataflow/eval/values/string/string-constants.js +38 -36
- package/dataflow/extractor.js +105 -2
- package/dataflow/fn/argument-roles.js +22 -8
- package/dataflow/fn/function-semantics.d.ts +3 -2
- package/dataflow/fn/strict-function.js +13 -2
- package/dataflow/graph/df-helper.d.ts +14 -1
- package/dataflow/graph/df-helper.js +37 -4
- package/dataflow/graph/graph.d.ts +6 -0
- package/dataflow/graph/graph.js +6 -0
- package/dataflow/internal/linker.d.ts +4 -1
- package/dataflow/internal/linker.js +11 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.d.ts +41 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-keys.js +88 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +19 -44
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +125 -158
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +35 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +10 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.d.ts +4 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-attach.js +6 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +21 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +8 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +3 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +5 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-local.js +5 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +11 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +6 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +7 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +42 -0
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +11 -0
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +29 -4
- package/dataflow/internal/process/functions/call/common.js +3 -4
- package/dataflow/internal/process/functions/call/deferred.d.ts +3 -2
- package/dataflow/internal/process/functions/call/deferred.js +17 -9
- package/dataflow/internal/process/functions/call/quoted.js +1 -1
- package/documentation/doc-capabilities.js +3 -2
- package/documentation/doc-readme.js +1 -2
- package/documentation/doc-util/doc-dfg.js +2 -2
- package/documentation/doc-util/doc-query.d.ts +3 -1
- package/documentation/doc-util/doc-query.js +4 -4
- package/documentation/wiki-create-linting-rules.js +1 -1
- package/documentation/wiki-linter.js +16 -206
- package/documentation/wiki-linting-and-testing.js +31 -64
- package/documentation/wiki-query.js +41 -0
- package/index.d.ts +1 -0
- package/index.js +5 -1
- package/linter/linter-format.d.ts +6 -0
- package/linter/linter-format.js +10 -0
- package/linter/linter-rules.d.ts +155 -103
- package/linter/linter-rules.js +2 -0
- package/linter/linter-util.d.ts +23 -0
- package/linter/linter-util.js +58 -0
- package/linter/rules/absolute-path.d.ts +2 -2
- package/linter/rules/absolute-path.js +1 -4
- package/linter/rules/cmd-check/bogus-return.d.ts +2 -2
- package/linter/rules/cmd-check/bogus-return.js +3 -7
- package/linter/rules/cmd-check/call-arguments.d.ts +2 -2
- package/linter/rules/cmd-check/class-string-comparison.d.ts +2 -2
- package/linter/rules/cmd-check/class-string-comparison.js +3 -7
- package/linter/rules/cmd-check/cmd-check-util.d.ts +8 -9
- package/linter/rules/cmd-check/cmd-check-util.js +14 -26
- package/linter/rules/cmd-check/compiled-code.d.ts +8 -3
- package/linter/rules/cmd-check/compiled-code.js +3 -13
- package/linter/rules/cmd-check/dependency-declaration.d.ts +2 -2
- package/linter/rules/cmd-check/dependency-declaration.js +6 -7
- package/linter/rules/cmd-check/description-metadata.d.ts +4 -4
- package/linter/rules/cmd-check/documentation-mismatch.d.ts +2 -2
- package/linter/rules/cmd-check/documentation-mismatch.js +4 -11
- package/linter/rules/cmd-check/file-checks.d.ts +19 -6
- package/linter/rules/cmd-check/file-checks.js +13 -5
- package/linter/rules/cmd-check/foreign-function-calls.d.ts +2 -2
- package/linter/rules/cmd-check/global-environment-modification.d.ts +2 -2
- package/linter/rules/cmd-check/global-environment-modification.js +3 -2
- package/linter/rules/cmd-check/namespace-tampering.d.ts +2 -2
- package/linter/rules/cmd-check/namespace-tampering.js +9 -9
- package/linter/rules/cmd-check/non-ascii-code.d.ts +2 -2
- package/linter/rules/cmd-check/package-data.d.ts +11 -5
- package/linter/rules/cmd-check/package-data.js +5 -12
- package/linter/rules/cmd-check/package-files.js +4 -10
- package/linter/rules/cmd-check/package-hooks.d.ts +2 -2
- package/linter/rules/cmd-check/package-hooks.js +10 -8
- package/linter/rules/cmd-check/package-metafiles.d.ts +8 -3
- package/linter/rules/cmd-check/package-metafiles.js +3 -12
- package/linter/rules/cmd-check/package-runtime.d.ts +18 -5
- package/linter/rules/cmd-check/package-runtime.js +64 -20
- package/linter/rules/cmd-check/package-structure.d.ts +11 -5
- package/linter/rules/cmd-check/package-structure.js +4 -12
- package/linter/rules/cmd-check/rd-files.d.ts +8 -3
- package/linter/rules/cmd-check/rd-files.js +4 -14
- package/linter/rules/cmd-check/s-three-method-consistency.d.ts +2 -2
- package/linter/rules/cmd-check/s-three-method-consistency.js +3 -4
- package/linter/rules/cmd-check/true-false-abbreviation.d.ts +2 -2
- package/linter/rules/dataframe-access-validation.d.ts +2 -2
- package/linter/rules/dataframe-access-validation.js +5 -8
- package/linter/rules/dead-code.d.ts +5 -4
- package/linter/rules/dead-code.js +25 -14
- package/linter/rules/deprecated-functions.d.ts +3 -3
- package/linter/rules/deprecated-functions.js +16 -23
- package/linter/rules/file-path-validity.d.ts +2 -2
- package/linter/rules/file-path-validity.js +3 -6
- package/linter/rules/function-finder-util.d.ts +3 -3
- package/linter/rules/function-finder-util.js +7 -14
- package/linter/rules/namespace-access.d.ts +2 -2
- package/linter/rules/namespace-access.js +6 -9
- package/linter/rules/naming-convention.d.ts +2 -2
- package/linter/rules/naming-convention.js +1 -4
- package/linter/rules/network-functions.d.ts +3 -3
- package/linter/rules/no-leaked-credentials.d.ts +2 -2
- package/linter/rules/no-leaked-credentials.js +1 -4
- package/linter/rules/overwritten-file.d.ts +38 -0
- package/linter/rules/overwritten-file.js +102 -0
- package/linter/rules/problematic-inputs.d.ts +16 -6
- package/linter/rules/problematic-inputs.js +78 -34
- package/linter/rules/roxygen-arguments.d.ts +2 -2
- package/linter/rules/roxygen-arguments.js +1 -4
- package/linter/rules/seeded-randomness.d.ts +3 -3
- package/linter/rules/seeded-randomness.js +6 -23
- package/linter/rules/software-has-license.d.ts +2 -2
- package/linter/rules/software-has-license.js +1 -4
- package/linter/rules/software-has-tests.d.ts +2 -2
- package/linter/rules/software-has-tests.js +1 -4
- package/linter/rules/stop-with-call-arg.d.ts +2 -2
- package/linter/rules/stop-with-call-arg.js +4 -11
- package/linter/rules/syntactically-valid.d.ts +4 -2
- package/linter/rules/syntactically-valid.js +29 -10
- package/linter/rules/unclosed-connection.d.ts +2 -2
- package/linter/rules/unclosed-connection.js +1 -4
- package/linter/rules/undefined-symbol.d.ts +2 -2
- package/linter/rules/undefined-symbol.js +25 -22
- package/linter/rules/unescaped-arguments.d.ts +2 -2
- package/linter/rules/unescaped-arguments.js +1 -4
- package/linter/rules/unused-definition.d.ts +2 -2
- package/linter/rules/unused-definition.js +37 -25
- package/linter/rules/unused-import.d.ts +2 -2
- package/linter/rules/unused-import.js +9 -14
- package/linter/rules/useless-loop.d.ts +7 -6
- package/linter/rules/useless-loop.js +4 -8
- package/package.json +5 -3
- package/project/cache/flowr-analyzer-cache.d.ts +2 -0
- package/project/cache/flowr-analyzer-cache.js +15 -11
- package/project/context/flowr-analyzer-files-context.d.ts +3 -0
- package/project/context/flowr-analyzer-files-context.js +6 -0
- package/project/plugins/file-plugins/files/flowr-jupyter-file.d.ts +6 -1
- package/project/plugins/file-plugins/files/flowr-jupyter-file.js +35 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +2 -1
- package/project/plugins/file-plugins/files/flowr-rsession-file.d.ts +26 -0
- package/project/plugins/file-plugins/files/flowr-rsession-file.js +44 -0
- package/project/plugins/file-plugins/files/r-session.d.ts +20 -0
- package/project/plugins/file-plugins/files/r-session.js +58 -0
- package/project/plugins/file-plugins/files/recorded-runs.d.ts +18 -0
- package/project/plugins/file-plugins/files/recorded-runs.js +8 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rsession-file-plugin.d.ts +20 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rsession-file-plugin.js +28 -0
- package/project/plugins/plugin-registry.d.ts +2 -1
- package/project/plugins/plugin-registry.js +2 -0
- package/project/sigdb/spec-query.d.ts +73 -0
- package/project/sigdb/spec-query.js +339 -0
- package/queries/base-query-format.d.ts +1 -1
- package/queries/base-query-format.js +2 -2
- package/queries/catalog/absint-query/absint-query-executor.js +3 -6
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -0
- package/queries/catalog/call-context-query/call-context-query-executor.js +113 -73
- package/queries/catalog/call-graph-query/call-graph-query-executor.js +2 -3
- package/queries/catalog/cluster-query/cluster-query-executor.js +2 -3
- package/queries/catalog/config-query/config-query-format.d.ts +0 -1
- package/queries/catalog/config-query/config-query-format.js +1 -2
- package/queries/catalog/control-flow-query/control-flow-query-executor.js +2 -3
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +2 -4
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.d.ts +0 -1
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-format.js +1 -2
- package/queries/catalog/dataflow-query/dataflow-query-executor.js +2 -3
- package/queries/catalog/dependencies-query/dependencies-query-executor.d.ts +7 -0
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +72 -42
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +24 -6
- package/queries/catalog/dependencies-query/dependencies-query-format.js +108 -3
- package/queries/catalog/dependencies-query/function-info/function-info.d.ts +6 -1
- package/queries/catalog/dependencies-query/function-info/read-functions.js +6 -6
- package/queries/catalog/dependencies-query/function-info/write-functions.js +13 -7
- package/queries/catalog/dependencies-query/implicit-echo.js +21 -7
- package/queries/catalog/dice-query/dice-query-executor.js +2 -3
- package/queries/catalog/does-call-query/does-call-query-executor.js +2 -3
- package/queries/catalog/files-query/files-query-executor.js +2 -3
- package/queries/catalog/function-info-query/function-info-query-executor.js +2 -1
- package/queries/catalog/function-info-query/function-info-query-format.d.ts +0 -2
- package/queries/catalog/function-info-query/function-info-query-format.js +1 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-executor.js +3 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.d.ts +0 -2
- package/queries/catalog/guess-dep-versions-query/guess-dep-versions-query-format.js +1 -2
- package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -3
- package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +0 -1
- package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -2
- package/queries/catalog/id-map-query/id-map-query-executor.js +2 -3
- package/queries/catalog/id-map-query/id-map-query-format.d.ts +0 -1
- package/queries/catalog/id-map-query/id-map-query-format.js +1 -2
- package/queries/catalog/input-sources-query/input-sources-query-executor.js +3 -4
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +2 -1
- package/queries/catalog/input-sources-query/simple-input-classifier.js +60 -13
- package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +2 -3
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-executor.js +2 -3
- package/queries/catalog/inspect-fn-props-query/inspect-fn-props-query-format.js +2 -1
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.d.ts +3 -2
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -7
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +6 -9
- package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +8 -33
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.d.ts +3 -2
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-executor.js +1 -7
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +6 -7
- package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +8 -31
- package/queries/catalog/linter-query/linter-query-executor.js +2 -3
- package/queries/catalog/location-map-query/location-map-query-executor.js +2 -3
- package/queries/catalog/location-map-query/location-map-query-format.d.ts +0 -1
- package/queries/catalog/location-map-query/location-map-query-format.js +1 -2
- package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +2 -3
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +0 -1
- package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +1 -2
- package/queries/catalog/origin-query/origin-query-executor.d.ts +0 -5
- package/queries/catalog/origin-query/origin-query-executor.js +3 -11
- package/queries/catalog/project-query/project-query-executor.js +23 -7
- package/queries/catalog/project-query/project-query-format.d.ts +5 -0
- package/queries/catalog/project-query/project-query-format.js +20 -2
- package/queries/catalog/provenance-query/provenance-query-executor.js +2 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -3
- package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +0 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -2
- package/queries/catalog/search-query/search-query-executor.js +2 -3
- package/queries/catalog/signature-query/signature-query-executor.js +39 -0
- package/queries/catalog/signature-query/signature-query-format.d.ts +7 -1
- package/queries/catalog/signature-query/signature-query-format.js +15 -1
- package/queries/catalog/signature-query/signature-query-render.js +2 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.js +2 -3
- package/queries/query-function-property.d.ts +28 -0
- package/queries/query-function-property.js +48 -0
- package/queries/query-meta.d.ts +3 -0
- package/queries/query-meta.js +8 -0
- package/queries/query.d.ts +13 -18
- package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +2 -2
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +4 -3
- package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +6 -0
- package/r-bridge/lang-4.x/ast/model/processing/node-id.js +9 -0
- package/r-bridge/lang-4.x/ast/model/syntax-version.d.ts +8 -0
- package/r-bridge/lang-4.x/ast/model/syntax-version.js +49 -0
- package/r-bridge/lang-4.x/ast/model/type.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/type.js +3 -0
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +4 -1
- package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-single-node.js +1 -0
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +1 -1
- package/reconstruct/reconstruct.js +35 -1
- package/search/search-executor/search-generators.js +1 -1
- package/slicing/static/fingerprint.js +7 -3
- package/slicing/static/removal-slice.js +4 -2
- package/slicing/static/static-slicer.js +6 -0
- package/util/assert.js +2 -2
- package/util/collections/arrays.d.ts +4 -0
- package/util/collections/arrays.js +11 -0
- package/util/collections/defaultmap.d.ts +5 -1
- package/util/collections/defaultmap.js +6 -1
- package/util/files.js +26 -5
- package/util/flowr-version.d.ts +10 -0
- package/util/flowr-version.js +20 -0
- package/util/glob.js +6 -4
- package/util/r-regex.d.ts +6 -0
- package/util/r-regex.js +17 -0
- package/util/text/args.d.ts +5 -0
- package/util/text/args.js +28 -22
- package/util/text/name-rank.d.ts +2 -0
- package/util/text/name-rank.js +3 -1
- package/util/text/regex.d.ts +10 -0
- package/util/text/regex.js +29 -0
- package/util/version.d.ts +1 -6
- package/util/version.js +6 -14
- package/documentation/doc-util/doc-functions.d.ts +0 -24
- package/documentation/doc-util/doc-functions.js +0 -65
|
@@ -10,7 +10,10 @@ export declare enum ArgProp {
|
|
|
10
10
|
Forced = 1,
|
|
11
11
|
/** declared without a default value, like `x` in `nchar(x, type)`; says nothing about whether a call must supply it */
|
|
12
12
|
NoDefault = 2,
|
|
13
|
-
/**
|
|
13
|
+
/**
|
|
14
|
+
* the result is this argument, handed back unchanged, like `x` in `identity(x)`; this is what draws the `Returns` edge.
|
|
15
|
+
* On `...` it is the last argument that is handed back, like in `{`.
|
|
16
|
+
*/
|
|
14
17
|
Alias = 4,
|
|
15
18
|
/** the result is computed from the argument's value, like `x` in `sum(x)` */
|
|
16
19
|
Value = 8,
|
|
@@ -46,7 +49,12 @@ export declare enum ArgProp {
|
|
|
46
49
|
* open to injection, so a call handing it unescaped data is a finding: system commands, R expressions,
|
|
47
50
|
* database queries, HTML, or JavaScript.
|
|
48
51
|
*/
|
|
49
|
-
Injectable = 32768
|
|
52
|
+
Injectable = 32768,
|
|
53
|
+
/**
|
|
54
|
+
* besides its value, the expression as written names a part of the result, like `a` in `data.frame(a)`,
|
|
55
|
+
* which becomes the column `a`; passing `identity(a)` instead changes the name
|
|
56
|
+
*/
|
|
57
|
+
Deparsed = 65536
|
|
50
58
|
}
|
|
51
59
|
/**
|
|
52
60
|
* The properties of the behavior of a call, as a bitmask.
|
|
@@ -161,7 +169,11 @@ export declare enum SemanticCallTag {
|
|
|
161
169
|
/** puts a package's exports on the search path, so their bare names resolve, like `library` or `attachNamespace` */
|
|
162
170
|
AttachesPackage = "attaches-package",
|
|
163
171
|
/** answers whether a package is available, like `require`, `requireNamespace`, or `find.package` */
|
|
164
|
-
ChecksPackage = "checks-package"
|
|
172
|
+
ChecksPackage = "checks-package",
|
|
173
|
+
/** registers a class, generic, method, or global name without computing anything else, like `setClass` or `utils::globalVariables` */
|
|
174
|
+
Declares = "declares",
|
|
175
|
+
/** reads which environment it runs in, like `environment()` or `parent.frame()`, so moving the call into another frame changes its result */
|
|
176
|
+
Frames = "reflects-frame"
|
|
165
177
|
}
|
|
166
178
|
/** a bitfield of {@link ArgProp} */
|
|
167
179
|
export type ArgProps = number;
|
|
@@ -229,6 +241,12 @@ export declare const PropagatedProps: PropMask;
|
|
|
229
241
|
declare function isCallProp(this: void, selector: PropSelector): selector is CallProp | CallProps;
|
|
230
242
|
/** Checks whether a {@link PropSelector} is a {@link SemanticCallTag} */
|
|
231
243
|
declare function isSemanticTag(this: void, selector: PropSelector): selector is SemanticCallTag;
|
|
244
|
+
/** How a property reads: the word for it, the short form a signature shows where there is one, and what it means. */
|
|
245
|
+
export interface PropWord {
|
|
246
|
+
readonly word: string;
|
|
247
|
+
readonly short?: string;
|
|
248
|
+
readonly about: string;
|
|
249
|
+
}
|
|
232
250
|
/**
|
|
233
251
|
* Helper functions to work with {@link CallProp}s and {@link SemanticCallTag}s of calls.
|
|
234
252
|
* All helpers use {@link PropSelector}s to identify call properties.
|
|
@@ -254,9 +272,11 @@ export declare const CallProps: {
|
|
|
254
272
|
readonly key: (this: void, selector: PropSelector) => string;
|
|
255
273
|
/** Gets the property names for a property selector. */
|
|
256
274
|
readonly names: (this: void, selector: PropSelector) => string[];
|
|
257
|
-
/**
|
|
275
|
+
/** the {@link CallProp} bits as words, in the order they are declared */
|
|
276
|
+
readonly vocabulary: Readonly<Record<CallProp, PropWord>>;
|
|
277
|
+
/** Gets the string labels for stated properties, see {@link CallPropWords}. */
|
|
258
278
|
readonly labels: (this: void, stated: StatedProps | undefined) => string[];
|
|
259
|
-
/** The {@link
|
|
279
|
+
/** The {@link CallPropWords} for a bare {@link CallProps} bitfield, as inferred functions carry one. */
|
|
260
280
|
readonly words: (this: void, props: CallProps | undefined) => string[];
|
|
261
281
|
/** The {@link PropMask} the given {@link CallProp}/{@link SemanticCallTag} member names stand for, unknown ones ignored. */
|
|
262
282
|
readonly mask: (this: void, names: readonly string[]) => PropMask;
|
|
@@ -294,8 +314,8 @@ export declare const FnSig: {
|
|
|
294
314
|
* Utility functions for {@link ArgProps|argument property bitfields}.
|
|
295
315
|
*/
|
|
296
316
|
export declare const ArgProps: {
|
|
297
|
-
/** the {@link ArgProp}
|
|
298
|
-
readonly
|
|
317
|
+
/** the {@link ArgProp} bits as words, in ascending bit order */
|
|
318
|
+
readonly vocabulary: Readonly<Record<ArgProp, PropWord>>;
|
|
299
319
|
/** What an argument is used for, as words; see {@link wordsOf}. */
|
|
300
320
|
readonly words: (props: ArgProps | undefined) => string[];
|
|
301
321
|
/** The mask the given {@link ArgProp} member names stand for; see {@link maskOfNames}. */
|
|
@@ -16,7 +16,10 @@ var ArgProp;
|
|
|
16
16
|
ArgProp[ArgProp["Forced"] = 1] = "Forced";
|
|
17
17
|
/** declared without a default value, like `x` in `nchar(x, type)`; says nothing about whether a call must supply it */
|
|
18
18
|
ArgProp[ArgProp["NoDefault"] = 2] = "NoDefault";
|
|
19
|
-
/**
|
|
19
|
+
/**
|
|
20
|
+
* the result is this argument, handed back unchanged, like `x` in `identity(x)`; this is what draws the `Returns` edge.
|
|
21
|
+
* On `...` it is the last argument that is handed back, like in `{`.
|
|
22
|
+
*/
|
|
20
23
|
ArgProp[ArgProp["Alias"] = 4] = "Alias";
|
|
21
24
|
/** the result is computed from the argument's value, like `x` in `sum(x)` */
|
|
22
25
|
ArgProp[ArgProp["Value"] = 8] = "Value";
|
|
@@ -53,6 +56,11 @@ var ArgProp;
|
|
|
53
56
|
* database queries, HTML, or JavaScript.
|
|
54
57
|
*/
|
|
55
58
|
ArgProp[ArgProp["Injectable"] = 32768] = "Injectable";
|
|
59
|
+
/**
|
|
60
|
+
* besides its value, the expression as written names a part of the result, like `a` in `data.frame(a)`,
|
|
61
|
+
* which becomes the column `a`; passing `identity(a)` instead changes the name
|
|
62
|
+
*/
|
|
63
|
+
ArgProp[ArgProp["Deparsed"] = 65536] = "Deparsed";
|
|
56
64
|
})(ArgProp || (exports.ArgProp = ArgProp = {}));
|
|
57
65
|
/**
|
|
58
66
|
* The properties of the behavior of a call, as a bitmask.
|
|
@@ -170,6 +178,10 @@ var SemanticCallTag;
|
|
|
170
178
|
SemanticCallTag["AttachesPackage"] = "attaches-package";
|
|
171
179
|
/** answers whether a package is available, like `require`, `requireNamespace`, or `find.package` */
|
|
172
180
|
SemanticCallTag["ChecksPackage"] = "checks-package";
|
|
181
|
+
/** registers a class, generic, method, or global name without computing anything else, like `setClass` or `utils::globalVariables` */
|
|
182
|
+
SemanticCallTag["Declares"] = "declares";
|
|
183
|
+
/** reads which environment it runs in, like `environment()` or `parent.frame()`, so moving the call into another frame changes its result */
|
|
184
|
+
SemanticCallTag["Frames"] = "reflects-frame";
|
|
173
185
|
})(SemanticCallTag || (exports.SemanticCallTag = SemanticCallTag = {}));
|
|
174
186
|
/**
|
|
175
187
|
* The properties that say where a definition comes from rather than what it does. A bare
|
|
@@ -262,6 +274,24 @@ function getPropMask(selector) {
|
|
|
262
274
|
}
|
|
263
275
|
return { props, tags };
|
|
264
276
|
}
|
|
277
|
+
/** the {@link CallProp} bits as words, in the order they are declared */
|
|
278
|
+
const CallPropWords = {
|
|
279
|
+
[CallProp.Pure]: { word: 'pure', about: 'computes a result, nothing else' },
|
|
280
|
+
[CallProp.MayPure]: { word: 'maybe pure', short: 'maypure', about: 'pure if what it calls is' },
|
|
281
|
+
[CallProp.Throws]: { word: 'can throw', short: 'throws', about: 'may raise an error' },
|
|
282
|
+
[CallProp.Invisible]: { word: 'invisible', short: 'invis', about: 'the result is not printed' },
|
|
283
|
+
[CallProp.Generic]: { word: 'generic', about: 'dispatches on its argument' },
|
|
284
|
+
[CallProp.Method]: { word: 's3 method', short: 's3', about: 'a method of a generic' },
|
|
285
|
+
[CallProp.Scope]: { word: 'changes scope', short: 'scope', about: 'defines or removes variables' },
|
|
286
|
+
[CallProp.NonDet]: { word: 'non deterministic', short: 'nondet', about: 'may differ between runs' },
|
|
287
|
+
[CallProp.Ambient]: { word: 'ambient state', short: 'ambient', about: 'reads state outside its arguments' },
|
|
288
|
+
[CallProp.Configures]: { word: 'sets ambient state', short: 'configures', about: 'changes options or devices' },
|
|
289
|
+
[CallProp.Ffi]: { word: 'calls native code', short: 'ffi', about: 'uses C, C++ or Fortran' },
|
|
290
|
+
[CallProp.Lang]: { word: 'produces language object', short: 'lang', about: 'returns code as data' },
|
|
291
|
+
[CallProp.Strict]: { word: 'strict', about: 'evaluates every argument' },
|
|
292
|
+
[CallProp.Concurrent]: { word: 'concurrent', short: 'async', about: 'runs in parallel' },
|
|
293
|
+
[CallProp.Primitive]: { word: 'primitive', about: 'implemented in the R core' }
|
|
294
|
+
};
|
|
265
295
|
/**
|
|
266
296
|
* Helper functions to work with {@link CallProp}s and {@link SemanticCallTag}s of calls.
|
|
267
297
|
* All helpers use {@link PropSelector}s to identify call properties.
|
|
@@ -316,11 +346,13 @@ exports.CallProps = {
|
|
|
316
346
|
...record_1.Record.entries(SemanticCallTag).filter(([, prop]) => mask.tags.has(prop)).map(([name]) => name)
|
|
317
347
|
];
|
|
318
348
|
},
|
|
319
|
-
/**
|
|
349
|
+
/** the {@link CallProp} bits as words, in the order they are declared */
|
|
350
|
+
vocabulary: CallPropWords,
|
|
351
|
+
/** Gets the string labels for stated properties, see {@link CallPropWords}. */
|
|
320
352
|
labels(stated) {
|
|
321
353
|
return [...exports.CallProps.words(stated?.props), ...stated?.tags ?? []];
|
|
322
354
|
},
|
|
323
|
-
/** The {@link
|
|
355
|
+
/** The {@link CallPropWords} for a bare {@link CallProps} bitfield, as inferred functions carry one. */
|
|
324
356
|
words(props) {
|
|
325
357
|
return wordsOf(CallPropEntries, props);
|
|
326
358
|
},
|
|
@@ -366,24 +398,25 @@ exports.FnSig = {
|
|
|
366
398
|
/** A signature saying only that the call evaluates one argument; see {@link forcingOnly}. */
|
|
367
399
|
only: forcingOnly
|
|
368
400
|
};
|
|
369
|
-
/** the {@link ArgProp}
|
|
370
|
-
const
|
|
371
|
-
[ArgProp.Forced]: 'forced',
|
|
372
|
-
[ArgProp.NoDefault]: 'no default',
|
|
373
|
-
[ArgProp.Alias]: 'alias',
|
|
374
|
-
[ArgProp.Value]: 'value',
|
|
375
|
-
[ArgProp.Shape]: 'shape',
|
|
376
|
-
[ArgProp.Flag]: 'flag',
|
|
377
|
-
[ArgProp.Resource]: 'resource',
|
|
378
|
-
[ArgProp.Written]: 'written',
|
|
379
|
-
[ArgProp.Nse]: 'nse',
|
|
380
|
-
[ArgProp.Callee]: 'callee',
|
|
381
|
-
[ArgProp.Presence]: 'presence',
|
|
382
|
-
[ArgProp.Bounds]: 'bounds',
|
|
383
|
-
[ArgProp.Atomic]: 'atomic',
|
|
384
|
-
[ArgProp.Handle]: 'handle',
|
|
385
|
-
[ArgProp.Lazy]: 'lazy',
|
|
386
|
-
[ArgProp.Injectable]: 'injectable'
|
|
401
|
+
/** the {@link ArgProp} bits as words; integer keys iterate in ascending bit order */
|
|
402
|
+
const ArgPropWords = {
|
|
403
|
+
[ArgProp.Forced]: { word: 'forced', short: 'F', about: 'always evaluated' },
|
|
404
|
+
[ArgProp.NoDefault]: { word: 'no default', short: 'R', about: 'declared without a default' },
|
|
405
|
+
[ArgProp.Alias]: { word: 'alias', about: 'handed back as the result' },
|
|
406
|
+
[ArgProp.Value]: { word: 'value', short: 'val', about: 'its value feeds the result' },
|
|
407
|
+
[ArgProp.Shape]: { word: 'shape', about: 'only length or attributes used' },
|
|
408
|
+
[ArgProp.Flag]: { word: 'flag', about: 'selects a behavior' },
|
|
409
|
+
[ArgProp.Resource]: { word: 'resource', short: 'res', about: 'names a file or connection' },
|
|
410
|
+
[ArgProp.Written]: { word: 'written', short: 'out', about: 'may be modified' },
|
|
411
|
+
[ArgProp.Nse]: { word: 'nse', about: 'quoted, not evaluated' },
|
|
412
|
+
[ArgProp.Callee]: { word: 'callee', short: 'fn', about: 'called as a function' },
|
|
413
|
+
[ArgProp.Presence]: { word: 'presence', short: 'seen', about: 'only whether it was given matters' },
|
|
414
|
+
[ArgProp.Bounds]: { word: 'bounds', about: 'the result is one of its values' },
|
|
415
|
+
[ArgProp.Atomic]: { word: 'atomic', about: 'plain data only' },
|
|
416
|
+
[ArgProp.Handle]: { word: 'handle', about: 'an open connection' },
|
|
417
|
+
[ArgProp.Lazy]: { word: 'lazy', short: 'L', about: 'never evaluated' },
|
|
418
|
+
[ArgProp.Injectable]: { word: 'injectable', about: 'open to injection' },
|
|
419
|
+
[ArgProp.Deparsed]: { word: 'deparsed', about: 'its expression names part of the result' }
|
|
387
420
|
};
|
|
388
421
|
/** The bitfield the given {@link ArgProp}/{@link CallProp} member names stand for, unknown ones ignored. */
|
|
389
422
|
function maskOfNames(of, names) {
|
|
@@ -394,40 +427,22 @@ function maskOfNames(of, names) {
|
|
|
394
427
|
}
|
|
395
428
|
return mask;
|
|
396
429
|
}
|
|
397
|
-
/** the properties as the words a reader wants, in the order they are declared */
|
|
398
|
-
const CallPropLabels = {
|
|
399
|
-
[CallProp.Pure]: 'pure',
|
|
400
|
-
[CallProp.MayPure]: 'maybe pure',
|
|
401
|
-
[CallProp.Throws]: 'can throw',
|
|
402
|
-
[CallProp.Invisible]: 'invisible',
|
|
403
|
-
[CallProp.Generic]: 'generic',
|
|
404
|
-
[CallProp.Method]: 's3 method',
|
|
405
|
-
[CallProp.Scope]: 'changes scope',
|
|
406
|
-
[CallProp.NonDet]: 'non deterministic',
|
|
407
|
-
[CallProp.Ambient]: 'ambient state',
|
|
408
|
-
[CallProp.Configures]: 'sets ambient state',
|
|
409
|
-
[CallProp.Ffi]: 'calls native code',
|
|
410
|
-
[CallProp.Lang]: 'produces language object',
|
|
411
|
-
[CallProp.Strict]: 'strict',
|
|
412
|
-
[CallProp.Concurrent]: 'concurrent',
|
|
413
|
-
[CallProp.Primitive]: 'primitive'
|
|
414
|
-
};
|
|
415
430
|
/** The words for whichever of `mask`'s bits appear in `entries`, shared by {@link ArgProps.words} and {@link CallProps.words}. */
|
|
416
431
|
function wordsOf(entries, mask) {
|
|
417
432
|
return mask === undefined ? [] : entries.filter(([bit]) => (mask & bit) !== 0).map(([, word]) => word);
|
|
418
433
|
}
|
|
419
434
|
/** A bit-keyed word table as `[bit, word]` pairs in ascending bit order, for {@link wordsOf}; shared by {@link ArgProps} and {@link CallProps}. */
|
|
420
435
|
function bitEntries(byBit) {
|
|
421
|
-
return Object.entries(byBit).map(([bit, word]) => [Number(bit), word]);
|
|
436
|
+
return Object.entries(byBit).map(([bit, { word }]) => [Number(bit), word]);
|
|
422
437
|
}
|
|
423
|
-
const ArgPropEntries = bitEntries(
|
|
424
|
-
const CallPropEntries = bitEntries(
|
|
438
|
+
const ArgPropEntries = bitEntries(ArgPropWords);
|
|
439
|
+
const CallPropEntries = bitEntries(CallPropWords);
|
|
425
440
|
/**
|
|
426
441
|
* Utility functions for {@link ArgProps|argument property bitfields}.
|
|
427
442
|
*/
|
|
428
443
|
exports.ArgProps = {
|
|
429
|
-
/** the {@link ArgProp}
|
|
430
|
-
|
|
444
|
+
/** the {@link ArgProp} bits as words, in ascending bit order */
|
|
445
|
+
vocabulary: ArgPropWords,
|
|
431
446
|
/** What an argument is used for, as words; see {@link wordsOf}. */
|
|
432
447
|
words: (props) => wordsOf(ArgPropEntries, props),
|
|
433
448
|
/** The mask the given {@link ArgProp} member names stand for; see {@link maskOfNames}. */
|
|
@@ -31,7 +31,7 @@ import { processEvalCall } from '../internal/process/functions/call/built-in/bui
|
|
|
31
31
|
import { type AmbientScope, type AmbientStateAccess } from '../internal/process/functions/call/built-in/built-in-ambient-state';
|
|
32
32
|
import type { Value } from '../eval/values/r-value';
|
|
33
33
|
import type { ResolveInfo } from '../eval/resolve/alias-tracking';
|
|
34
|
-
import { resolveAsSeq, resolveAsVector } from '../eval/resolve/resolve';
|
|
34
|
+
import { resolveAsElement, resolveAsSeq, resolveAsVector } from '../eval/resolve/resolve';
|
|
35
35
|
import { resolveAsComparison, resolveAsGroup, resolveAsLogical } from '../eval/resolve/resolve-operators';
|
|
36
36
|
import { resolveAsGet } from '../eval/resolve/resolve-get';
|
|
37
37
|
import type { VariableResolve } from '../../config';
|
|
@@ -88,6 +88,8 @@ export interface DefaultBuiltInProcessorConfiguration extends BuiltInFnInfo {
|
|
|
88
88
|
*/
|
|
89
89
|
readonly keepArgumentOut?: boolean;
|
|
90
90
|
readonly hasUnknownSideEffects?: boolean | LinkTo<RegExp | string>;
|
|
91
|
+
/** without arguments, the result is the frame the call runs in, like `environment()`, so within a function it reads every binding of the frame */
|
|
92
|
+
readonly readsFrame?: boolean;
|
|
91
93
|
/** how the call reads or writes global state like the graphics parameters or the options, see {@link AmbientStateAccess} */
|
|
92
94
|
readonly ambient?: AmbientStateAccess | readonly AmbientStateAccess[];
|
|
93
95
|
/** the call changes that state for a scope only, see {@link AmbientScope} */
|
|
@@ -113,7 +115,7 @@ export interface BuiltInEvalHandlerArgs extends ResolveInfo {
|
|
|
113
115
|
node: RNodeWithParent;
|
|
114
116
|
}
|
|
115
117
|
export type BuiltInEvalHandler = (args: BuiltInEvalHandlerArgs) => Value;
|
|
116
|
-
declare function defaultBuiltInProcessor<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, { useAsProcessor, readAllArguments, cfg, alternativeArgsFrom, hasUnknownSideEffects, ambient, scope, treatAsFnCall, markArgsAsNSE: nse, markArgsAsMasked: masked, keepArgumentOut, sig }: DefaultBuiltInProcessorConfiguration): DataflowInformation;
|
|
118
|
+
declare function defaultBuiltInProcessor<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, { useAsProcessor, readAllArguments, cfg, alternativeArgsFrom, hasUnknownSideEffects, ambient, scope, treatAsFnCall, markArgsAsNSE: nse, markArgsAsMasked: masked, keepArgumentOut, sig, readsFrame }: DefaultBuiltInProcessorConfiguration): DataflowInformation;
|
|
117
119
|
declare function defaultBuiltInProcessorReadallArgs<OtherInfo>(name: RSymbol<OtherInfo & ParentInformation>, args: readonly PotentiallyEmptyRArgument<OtherInfo & ParentInformation>[], rootId: NodeId, data: DataflowProcessorInformation<OtherInfo & ParentInformation>, { useAsProcessor, markArgsAsNSE: nse, markArgsAsMasked: masked, sig, ambient }: Pick<DefaultBuiltInProcessorConfiguration, 'useAsProcessor' | 'markArgsAsNSE' | 'markArgsAsMasked' | 'sig' | 'ambient'>): DataflowInformation;
|
|
118
120
|
export declare const BuiltInProcessorMapper: {
|
|
119
121
|
readonly "builtin:acc": typeof processAccess;
|
|
@@ -176,6 +178,7 @@ export declare const BuiltInEvalHandlerMapper: {
|
|
|
176
178
|
readonly "eval:string-fn": (this: void, args: BuiltInEvalHandlerArgs) => Value;
|
|
177
179
|
readonly "eval:group": typeof resolveAsGroup;
|
|
178
180
|
readonly "eval:get": typeof resolveAsGet;
|
|
181
|
+
readonly "eval:element": typeof resolveAsElement;
|
|
179
182
|
};
|
|
180
183
|
export type ConfigOfBuiltInMappingName<N extends keyof typeof BuiltInProcessorMapper> = Parameters<typeof BuiltInProcessorMapper[N]>[4];
|
|
181
184
|
export type BuiltInMemory = Map<BrandedIdentifier, IdentifierDefinition[]>;
|
|
@@ -92,7 +92,7 @@ function dataArgumentSymbols(args, sig) {
|
|
|
92
92
|
}
|
|
93
93
|
return symbols;
|
|
94
94
|
}
|
|
95
|
-
function defaultBuiltInProcessor(name, args, rootId, data, { useAsProcessor = built_in_proc_name_1.BuiltInProcName.Default, readAllArguments, cfg, alternativeArgsFrom, hasUnknownSideEffects, ambient, scope, treatAsFnCall, markArgsAsNSE: nse, markArgsAsMasked: masked, keepArgumentOut, sig }) {
|
|
95
|
+
function defaultBuiltInProcessor(name, args, rootId, data, { useAsProcessor = built_in_proc_name_1.BuiltInProcName.Default, readAllArguments, cfg, alternativeArgsFrom, hasUnknownSideEffects, ambient, scope, treatAsFnCall, markArgsAsNSE: nse, markArgsAsMasked: masked, keepArgumentOut, sig, readsFrame }) {
|
|
96
96
|
if (scope !== undefined) {
|
|
97
97
|
return (0, built_in_ambient_state_1.processAmbientScope)(name, args, rootId, data, scope);
|
|
98
98
|
}
|
|
@@ -106,7 +106,7 @@ function defaultBuiltInProcessor(name, args, rootId, data, { useAsProcessor = bu
|
|
|
106
106
|
let lastEnv = data.environment;
|
|
107
107
|
/* `evalq(expr)` runs `expr` right here, in the frame it is called from */
|
|
108
108
|
const inPlace = args.length === 1 && identifier_1.Identifier.getName(name.content) === 'evalq';
|
|
109
|
-
const { information:
|
|
109
|
+
const { information: processed, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({
|
|
110
110
|
name, args, rootId, data, sig, alternativeArgsFrom,
|
|
111
111
|
keepArgumentGraphs: nse !== undefined || masked !== undefined,
|
|
112
112
|
origin: useAsProcessor,
|
|
@@ -120,6 +120,7 @@ function defaultBuiltInProcessor(name, args, rootId, data, { useAsProcessor = bu
|
|
|
120
120
|
return { ...d, environment: lastEnv };
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
|
+
let res = processed;
|
|
123
124
|
if (nsePositions !== undefined) {
|
|
124
125
|
dropQuotedReferences(res, processedArguments, nsePositions, lastEnv);
|
|
125
126
|
}
|
|
@@ -128,7 +129,7 @@ function defaultBuiltInProcessor(name, args, rootId, data, { useAsProcessor = bu
|
|
|
128
129
|
if (keepArgumentOut) {
|
|
129
130
|
res.out = [...res.out, ...processedArguments.flatMap(arg => arg?.out ?? [])];
|
|
130
131
|
}
|
|
131
|
-
const alias = layout !== undefined && layout.alias >= 0 ? processedArguments[layout.alias] : undefined;
|
|
132
|
+
const alias = layout !== undefined && layout.alias >= 0 ? processedArguments[layout.alias === layout.rest ? processedArguments.length - 1 : layout.alias] : undefined;
|
|
132
133
|
if (alias !== undefined) {
|
|
133
134
|
res.graph.addEdge(rootId, alias.entryPoint, edge_1.EdgeType.Returns);
|
|
134
135
|
}
|
|
@@ -139,6 +140,21 @@ function defaultBuiltInProcessor(name, args, rootId, data, { useAsProcessor = bu
|
|
|
139
140
|
const valuePositions = function_semantics_1.FunctionSemantics.call.signature.posWith(layout, processedArguments.length, built_in_props_1.ArgProp.Value | built_in_props_1.ArgProp.Shape);
|
|
140
141
|
readArguments(res.graph, rootId, valuePositions.map(i => processedArguments[i]));
|
|
141
142
|
}
|
|
143
|
+
/* a function's frame handed out outlives the call, the global one stays reachable through the names anyway */
|
|
144
|
+
if (readsFrame && args.length === 0 && data.environment.level > 0) {
|
|
145
|
+
/* the parameters it holds are what {@link BuiltInFnInfo#frame} states, as reading one must not force it */
|
|
146
|
+
for (const definitions of data.environment.current.memory.values()) {
|
|
147
|
+
for (const definition of definitions) {
|
|
148
|
+
if (!node_id_1.NodeId.isBuiltIn(definition.nodeId) && definition.type !== identifier_1.ReferenceType.Parameter) {
|
|
149
|
+
res.graph.addEdge(rootId, definition.nodeId, edge_1.EdgeType.Reads);
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
/* before the unknown side effect, which forgets the values of the variables the ambient state is named by */
|
|
155
|
+
if (ambient !== undefined) {
|
|
156
|
+
res = (0, built_in_ambient_state_1.applyAmbientStateAccess)(res, args, rootId, data, ambient);
|
|
157
|
+
}
|
|
142
158
|
if (hasUnknownSideEffects) {
|
|
143
159
|
(0, unknown_side_effect_1.handleUnknownSideEffect)(res.graph, res.environment, rootId, hasUnknownSideEffects === true ? undefined : hasUnknownSideEffects);
|
|
144
160
|
}
|
|
@@ -163,7 +179,7 @@ function defaultBuiltInProcessor(name, args, rootId, data, { useAsProcessor = bu
|
|
|
163
179
|
const exitPoints = res.exitPoints.filter(e => e.type !== 0 /* ExitPointType.Default */ || e.nodeId !== rootId);
|
|
164
180
|
res.exitPoints = [...exitPoints, { type: cfg, nodeId: rootId, cds: data.cds }];
|
|
165
181
|
}
|
|
166
|
-
return
|
|
182
|
+
return res;
|
|
167
183
|
}
|
|
168
184
|
function readArguments(graph, rootId, args) {
|
|
169
185
|
for (const arg of args) {
|
|
@@ -274,7 +290,8 @@ exports.BuiltInEvalHandlerMapper = {
|
|
|
274
290
|
[built_in_eval_name_1.BuiltInEvalName.Logical]: resolve_operators_1.resolveAsLogical,
|
|
275
291
|
[built_in_eval_name_1.BuiltInEvalName.StringFn]: resolve_strings_1.StringFold.call,
|
|
276
292
|
[built_in_eval_name_1.BuiltInEvalName.Group]: resolve_operators_1.resolveAsGroup,
|
|
277
|
-
[built_in_eval_name_1.BuiltInEvalName.Get]: resolve_get_1.resolveAsGet
|
|
293
|
+
[built_in_eval_name_1.BuiltInEvalName.Get]: resolve_get_1.resolveAsGet,
|
|
294
|
+
[built_in_eval_name_1.BuiltInEvalName.Element]: resolve_1.resolveAsElement
|
|
278
295
|
};
|
|
279
296
|
/**
|
|
280
297
|
* Whether a definition registered under `namespace` belongs in the always-on built-in environment: only base
|