@eagleoutice/flowr 2.13.15 → 2.14.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.
Files changed (225) hide show
  1. package/README.md +31 -37
  2. package/abstract-interpretation/absint-visitor.js +1 -1
  3. package/abstract-interpretation/data-frame/mappers/access-mapper.js +4 -4
  4. package/abstract-interpretation/data-frame/mappers/arguments.js +7 -4
  5. package/abstract-interpretation/data-frame/mappers/function-mapper.js +18 -17
  6. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +6 -6
  7. package/abstract-interpretation/data-frame/resolve-args.d.ts +9 -4
  8. package/abstract-interpretation/data-frame/resolve-args.js +10 -5
  9. package/abstract-interpretation/unsupported-functions.d.ts +1 -0
  10. package/abstract-interpretation/unsupported-functions.js +1 -0
  11. package/benchmark/calibration.d.ts +12 -5
  12. package/benchmark/calibration.js +42 -14
  13. package/benchmark/slicer.d.ts +1 -1
  14. package/benchmark/slicer.js +5 -4
  15. package/benchmark/stats/size-of.js +1 -1
  16. package/benchmark/summarizer/first-phase/process.d.ts +2 -0
  17. package/benchmark/summarizer/first-phase/process.js +2 -0
  18. package/cli/common/options.d.ts +0 -31
  19. package/cli/common/options.js +1 -8
  20. package/cli/common/scripts-info.d.ts +0 -38
  21. package/cli/common/scripts-info.js +0 -8
  22. package/cli/repl/commands/repl-query.js +37 -2
  23. package/cli/repl/core.js +6 -3
  24. package/cli/repl/parser/slice-query-parser.js +1 -1
  25. package/cli/repl/print-version.js +2 -2
  26. package/config.d.ts +16 -0
  27. package/config.js +79 -0
  28. package/control-flow/control-flow-graph.d.ts +2 -0
  29. package/control-flow/control-flow-graph.js +2 -0
  30. package/control-flow/extract-cfg.js +1 -1
  31. package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
  32. package/control-flow/semantic-cfg-guided-visitor.js +1 -1
  33. package/control-flow/useless-loop.js +1 -1
  34. package/core/print/slice-diff-ansi.js +1 -1
  35. package/core/steps/pipeline/create-pipeline.js +1 -1
  36. package/dataflow/cluster.js +2 -2
  37. package/dataflow/environments/built-in-props.d.ts +8 -1
  38. package/dataflow/environments/built-in-props.js +18 -0
  39. package/dataflow/environments/built-in.d.ts +7 -1
  40. package/dataflow/environments/built-in.js +42 -3
  41. package/dataflow/environments/default-builtin-config.d.ts +442 -10
  42. package/dataflow/environments/default-builtin-config.js +188 -18
  43. package/dataflow/environments/environment.d.ts +1 -1
  44. package/dataflow/environments/identifier.d.ts +7 -2
  45. package/dataflow/environments/identifier.js +6 -1
  46. package/dataflow/environments/query-fn-props.js +2 -2
  47. package/dataflow/environments/reference-to-maybe.js +5 -5
  48. package/dataflow/environments/resolve-by-name.d.ts +3 -0
  49. package/dataflow/environments/resolve-by-name.js +30 -5
  50. package/dataflow/environments/resolve-helper.d.ts +6 -0
  51. package/dataflow/environments/resolve-helper.js +6 -0
  52. package/dataflow/eval/resolve/alias-tracking.d.ts +5 -0
  53. package/dataflow/eval/resolve/alias-tracking.js +21 -14
  54. package/dataflow/eval/resolve/node-value.d.ts +6 -0
  55. package/dataflow/eval/resolve/node-value.js +15 -9
  56. package/dataflow/eval/resolve/resolve-argument.js +2 -2
  57. package/dataflow/eval/resolve/resolve-numbers.js +2 -2
  58. package/dataflow/eval/resolve/resolve-operators.js +4 -3
  59. package/dataflow/eval/resolve/resolve-strings.js +3 -3
  60. package/dataflow/eval/resolve/resolve-working-directory.js +2 -1
  61. package/dataflow/eval/resolve/resolve.d.ts +5 -5
  62. package/dataflow/eval/resolve/resolve.js +10 -11
  63. package/dataflow/eval/values/general.d.ts +4 -1
  64. package/dataflow/eval/values/general.js +4 -1
  65. package/dataflow/extractor.js +2 -1
  66. package/dataflow/fn/exceptions-of-function.js +5 -4
  67. package/dataflow/fn/higher-order-function.d.ts +1 -1
  68. package/dataflow/fn/higher-order-function.js +22 -2
  69. package/dataflow/graph/call-graph.d.ts +1 -1
  70. package/dataflow/graph/call-graph.js +15 -15
  71. package/dataflow/graph/df-helper.d.ts +17 -2
  72. package/dataflow/graph/df-helper.js +11 -5
  73. package/dataflow/graph/diff-dataflow-graph.js +6 -6
  74. package/dataflow/graph/edge.d.ts +27 -0
  75. package/dataflow/graph/edge.js +33 -0
  76. package/dataflow/graph/graph-helper.d.ts +4 -4
  77. package/dataflow/graph/graph-helper.js +5 -5
  78. package/dataflow/graph/graph.d.ts +11 -1
  79. package/dataflow/graph/graph.js +16 -5
  80. package/dataflow/graph/vertex.d.ts +47 -6
  81. package/dataflow/graph/vertex.js +47 -6
  82. package/dataflow/internal/linker.d.ts +1 -0
  83. package/dataflow/internal/linker.js +11 -9
  84. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -2
  85. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -1
  86. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +6 -5
  87. package/dataflow/internal/process/functions/call/built-in/built-in-class-generator.js +2 -2
  88. package/dataflow/internal/process/functions/call/built-in/built-in-envir-utils.js +6 -7
  89. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +7 -6
  90. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -0
  91. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +19 -18
  92. package/dataflow/internal/process/functions/call/built-in/built-in-library.js +6 -1
  93. package/dataflow/internal/process/functions/call/built-in/built-in-list.js +2 -2
  94. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +2 -2
  95. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +2 -2
  96. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +5 -5
  97. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +1 -1
  98. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.js +3 -3
  99. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
  100. package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +2 -2
  101. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +3 -3
  102. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +1 -1
  103. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +8 -2
  104. package/dataflow/internal/process/functions/call/built-in/built-in-string-template.js +1 -1
  105. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.js +3 -3
  106. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +3 -1
  107. package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +15 -12
  108. package/dataflow/internal/process/functions/call/common.d.ts +9 -1
  109. package/dataflow/internal/process/functions/call/common.js +17 -6
  110. package/dataflow/internal/process/functions/call/deferred.d.ts +7 -0
  111. package/dataflow/internal/process/functions/call/deferred.js +24 -1
  112. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +3 -1
  113. package/dataflow/internal/process/functions/call/known-call-handling.js +6 -3
  114. package/dataflow/internal/process/functions/call/named-call-handling.js +44 -12
  115. package/dataflow/internal/process/functions/call/nse.d.ts +34 -5
  116. package/dataflow/internal/process/functions/call/nse.js +114 -6
  117. package/dataflow/internal/process/functions/call/quoted.d.ts +6 -0
  118. package/dataflow/internal/process/functions/call/quoted.js +26 -11
  119. package/dataflow/origin/dfg-get-origin.d.ts +1 -0
  120. package/dataflow/origin/dfg-get-origin.js +9 -6
  121. package/documentation/data/faq/faqs.js +88 -88
  122. package/documentation/data/faq/recommended-configs.js +1 -1
  123. package/documentation/data/faq/wiki-faq-store.js +1 -1
  124. package/documentation/doc-capabilities.js +1 -1
  125. package/documentation/doc-readme.js +1 -1
  126. package/documentation/doc-util/doc-auto-gen.js +6 -2
  127. package/documentation/doc-util/doc-functions.js +1 -1
  128. package/documentation/wiki-cfg.js +2 -2
  129. package/documentation/wiki-create-linting-rules.js +45 -45
  130. package/documentation/wiki-dataflow-graph.js +25 -18
  131. package/documentation/wiki-linting-and-testing.js +93 -5
  132. package/documentation/wiki-mk/doc-maker.js +1 -1
  133. package/documentation/wiki-overview.js +12 -1
  134. package/documentation/wiki-signature-database.js +3 -0
  135. package/linter/linter-format.d.ts +1 -0
  136. package/linter/linter-format.js +1 -0
  137. package/linter/rules/file-path-validity.js +1 -1
  138. package/linter/rules/function-finder-util.js +1 -1
  139. package/linter/rules/naming-convention.js +1 -1
  140. package/linter/rules/no-leaked-credentials.js +2 -1
  141. package/linter/rules/stop-with-call-arg.js +4 -4
  142. package/linter/rules/undefined-symbol-util.d.ts +1 -1
  143. package/linter/rules/undefined-symbol-util.js +5 -4
  144. package/linter/rules/undefined-symbol.js +3 -3
  145. package/linter/rules/unused-definition.js +2 -1
  146. package/package.json +35 -45
  147. package/project/context/flowr-analyzer-environment-context.d.ts +23 -0
  148. package/project/context/flowr-analyzer-environment-context.js +25 -0
  149. package/project/dependency-version-space.js +1 -2
  150. package/project/flowr-analyzer.js +1 -1
  151. package/project/plugins/file-plugins/files/flowr-rda-file.js +3 -3
  152. package/project/plugins/file-plugins/files/flowr-rmarkdown-file.js +2 -2
  153. package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +3 -1
  154. package/project/sigdb/build.js +16 -16
  155. package/project/sigdb/codec.d.ts +1 -1
  156. package/project/sigdb/codec.js +13 -13
  157. package/project/sigdb/decompress.d.ts +1 -1
  158. package/project/sigdb/decompress.js +33 -33
  159. package/project/sigdb/index-format.js +2 -2
  160. package/project/sigdb/manifest.js +21 -21
  161. package/project/sigdb/memory-source.d.ts +64 -0
  162. package/project/sigdb/memory-source.js +133 -0
  163. package/project/sigdb/reader.js +13 -13
  164. package/queries/catalog/absint-query/absint-query-format.js +1 -1
  165. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
  166. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +2 -2
  167. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -2
  168. package/queries/catalog/dependencies-query/dependencies-query-format.js +1 -1
  169. package/queries/catalog/dependencies-query/link-devices.js +2 -2
  170. package/queries/catalog/does-call-query/does-call-query-executor.js +2 -1
  171. package/queries/catalog/does-call-query/does-call-query-format.js +2 -1
  172. package/queries/catalog/input-sources-query/input-sources-query-format.js +1 -1
  173. package/queries/catalog/input-sources-query/simple-input-classifier.js +4 -4
  174. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +1 -1
  175. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -1
  176. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +1 -1
  177. package/queries/catalog/location-map-query/location-map-query-format.js +2 -2
  178. package/queries/catalog/origin-query/origin-query-format.js +1 -1
  179. package/queries/catalog/provenance-query/provenance-query-format.js +1 -1
  180. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +2 -2
  181. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +1 -1
  182. package/queries/catalog/signature-query/signature-query-executor.d.ts +2 -0
  183. package/queries/catalog/signature-query/signature-query-executor.js +3 -2
  184. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +1 -0
  185. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +1 -0
  186. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +3 -3
  187. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-call.js +1 -1
  188. package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-definition.js +1 -1
  189. package/r-bridge/retriever.d.ts +2 -1
  190. package/r-bridge/retriever.js +3 -2
  191. package/r-bridge/roxygen2/documentation-provider.d.ts +1 -0
  192. package/r-bridge/roxygen2/documentation-provider.js +1 -0
  193. package/r-bridge/roxygen2/roxygen-parse.d.ts +1 -1
  194. package/r-bridge/roxygen2/roxygen-parse.js +1 -1
  195. package/search/flowr-search-filters.d.ts +1 -1
  196. package/search/flowr-search-filters.js +2 -2
  197. package/search/search-executor/search-enrichers.js +4 -4
  198. package/search/search-executor/search-generators.js +1 -1
  199. package/slicing/criterion/parse.d.ts +1 -0
  200. package/slicing/criterion/parse.js +4 -3
  201. package/slicing/static/slice-call.d.ts +1 -1
  202. package/slicing/static/slice-call.js +2 -2
  203. package/slicing/static/static-slicer.js +4 -3
  204. package/util/assert.js +1 -1
  205. package/util/log.d.ts +4 -1
  206. package/util/log.js +15 -2
  207. package/util/logic.js +2 -2
  208. package/util/mermaid/cfg.js +1 -1
  209. package/util/mermaid/dfg.js +6 -6
  210. package/util/mermaid/mermaid.js +3 -1
  211. package/util/quads.js +19 -6
  212. package/util/r-version.d.ts +2 -0
  213. package/util/r-version.js +2 -0
  214. package/util/record.d.ts +1 -0
  215. package/util/record.js +1 -0
  216. package/util/schema.js +2 -2
  217. package/util/text/ansi.d.ts +2 -0
  218. package/util/text/ansi.js +8 -0
  219. package/util/text/name-rank.d.ts +29 -0
  220. package/util/text/name-rank.js +39 -0
  221. package/util/text/url-encoding.d.ts +15 -0
  222. package/util/text/url-encoding.js +59 -0
  223. package/util/version.js +1 -1
  224. package/cli/export-quads-app.d.ts +0 -7
  225. package/cli/export-quads-app.js +0 -44
@@ -6,12 +6,14 @@ const info_1 = require("../../../../info");
6
6
  const known_call_handling_1 = require("./known-call-handling");
7
7
  const append_1 = require("../../../../environments/append");
8
8
  const node_id_1 = require("../../../../../r-bridge/lang-4.x/ast/model/processing/node-id");
9
- const resolve_by_name_1 = require("../../../../environments/resolve-by-name");
10
- const vertex_1 = require("../../../../graph/vertex");
11
9
  const identifier_1 = require("../../../../environments/identifier");
12
10
  const r_base_packages_1 = require("../../../../../util/r-base-packages");
11
+ const built_in_1 = require("../../../../environments/built-in");
13
12
  const edge_1 = require("../../../../graph/edge");
14
13
  const built_in_library_1 = require("./built-in/built-in-library");
14
+ const vertex_1 = require("../../../../graph/vertex");
15
+ const resolve_helper_1 = require("../../../../environments/resolve-helper");
16
+ const assert_1 = require("../../../../../util/assert");
15
17
  function mergeInformation(info, newInfo) {
16
18
  if (info === undefined) {
17
19
  return newInfo;
@@ -27,12 +29,28 @@ function mergeInformation(info, newInfo) {
27
29
  hooks: info.hooks.concat(newInfo.hooks)
28
30
  };
29
31
  }
32
+ /**
33
+ * The flowR definition of `pkg::fn` behind an export a signature database attached. Such an export binds the
34
+ * name in a layer below the global environment, which hides the built-in environment underneath, and with it
35
+ * how the call evaluates its arguments: without this lookup `library(dplyr); filter(df, id > 2)` loses the data
36
+ * mask of `dplyr::filter`. Only that is recovered here. What a definition merely states about a call (its
37
+ * properties, its signature) reaches every consumer through the export vertex already, so a definition saying
38
+ * nothing about evaluation is left to the default processor, which keeps the call to one target.
39
+ */
40
+ function builtInBehindExport(data, definition) {
41
+ if (definition.type !== identifier_1.ReferenceType.Function || definition.name === undefined || !node_id_1.NodeId.isBuiltIn(definition.nodeId)
42
+ || identifier_1.Identifier.getNamespace(definition.name) === undefined) {
43
+ return undefined;
44
+ }
45
+ const known = data.ctx.env.builtInFunctionOf(definition.name);
46
+ return (0, built_in_1.statesNonStandardEvaluation)(known) ? known : undefined;
47
+ }
30
48
  /**
31
49
  * Marks the given function call node as only calling built-in functions.
32
50
  */
33
51
  function markAsOnlyBuiltIn(graph, rootId, keepEnvironment = false) {
34
52
  const v = graph.getVertex(rootId);
35
- if (v?.tag === vertex_1.VertexType.FunctionCall) {
53
+ if (vertex_1.FunctionCallVertex.is(v)) {
36
54
  v.onlyBuiltin = true;
37
55
  if (!keepEnvironment) {
38
56
  v.environment = undefined;
@@ -44,7 +62,7 @@ function markAsOnlyBuiltIn(graph, rootId, keepEnvironment = false) {
44
62
  * For example, `myFunction(arg1, arg2)`, resolves against the environment.
45
63
  */
46
64
  function processNamedCall(name, args, rootId, data) {
47
- const resolved = (0, resolve_by_name_1.resolveByName)(name.content, data.environment, identifier_1.ReferenceType.Function) ?? [];
65
+ const resolved = resolve_helper_1.Resolve.byNameAndType(name.content, data.environment, identifier_1.ReferenceType.Function) ?? [];
48
66
  let defaultProcessor = resolved.length === 0;
49
67
  /* a call whose meaning a later pass looks up in its environment has to keep it */
50
68
  const keepEnvironment = resolved.some(r => r.type === identifier_1.ReferenceType.BuiltInFunction && r.config?.keepEnvironment === true);
@@ -56,14 +74,23 @@ function processNamedCall(name, args, rootId, data) {
56
74
  }
57
75
  let information = undefined;
58
76
  let builtIn = false;
77
+ /* a set, because an export and the built-in behind it are two ways to the same definition */
78
+ const toRun = new Set();
59
79
  for (const resolvedFunction of resolved) {
60
- if (resolvedFunction.type === identifier_1.ReferenceType.BuiltInFunction && typeof resolvedFunction.processor === 'function') {
61
- builtIn ||= resolvedFunction.config?.libFn !== true;
62
- information = mergeInformation(information, resolvedFunction.processor(name, args, rootId, data));
63
- }
64
- else {
80
+ const own = resolvedFunction.type === identifier_1.ReferenceType.BuiltInFunction && typeof resolvedFunction.processor === 'function'
81
+ ? resolvedFunction
82
+ /* the call goes through the attached export, so it is not built-in only, but flowR's own
83
+ definition of that export is what knows how to process it */
84
+ : builtInBehindExport(data, resolvedFunction);
85
+ if (own === undefined) {
65
86
  defaultProcessor = true;
87
+ continue;
66
88
  }
89
+ builtIn ||= own === resolvedFunction && own.config?.libFn !== true;
90
+ toRun.add(own);
91
+ }
92
+ for (const own of toRun) {
93
+ information = mergeInformation(information, own.processor(name, args, rootId, data));
67
94
  }
68
95
  if (defaultProcessor) {
69
96
  /* if we do not know where we land, we force! reuse `resolved`, data.environment did not change above */
@@ -95,9 +122,14 @@ function processNamedCall(name, args, rootId, data) {
95
122
  }
96
123
  }
97
124
  const ns = identifier_1.Identifier.getNamespace(name.content);
98
- // an explicit `pkg::fn` links to a database-unresolved `library(pkg)` recorded below the global env
99
- if (ns !== undefined) {
100
- for (const loadNode of (0, built_in_library_1.loadNodesForNamespace)(data.environment, ns)) {
125
+ // a call links to a database-unresolved `library(pkg)` recorded below the global env: `pkg::fn` names
126
+ // its package, a bare call takes it from what flowR resolved it to, which is what ties
127
+ // `filter(df, id > 2)` to the `library(dplyr)` that made it dplyr's
128
+ const owners = ns !== undefined ? [ns] : resolved
129
+ .map(r => r.type === identifier_1.ReferenceType.BuiltInFunction && r.name !== undefined ? identifier_1.Identifier.getNamespace(r.name) : undefined)
130
+ .filter(assert_1.isNotUndefined);
131
+ for (const owner of owners) {
132
+ for (const loadNode of (0, built_in_library_1.loadNodesForNamespace)(data.environment, String(owner))) {
101
133
  information.graph.addEdge(rootId, loadNode, edge_1.EdgeType.Reads);
102
134
  }
103
135
  }
@@ -2,7 +2,7 @@ import { RNode } from '../../../../../r-bridge/lang-4.x/ast/model/model';
2
2
  import type { NodeId } from '../../../../../r-bridge/lang-4.x/ast/model/processing/node-id';
3
3
  import type { ParentInformation } from '../../../../../r-bridge/lang-4.x/ast/model/processing/decorate';
4
4
  import { Identifier } from '../../../../environments/identifier';
5
- import type { DataflowGraph } from '../../../../graph/graph';
5
+ import { type DataflowGraph } from '../../../../graph/graph';
6
6
  import { type DataflowGraphVertexInfo } from '../../../../graph/vertex';
7
7
  /** The escape a quoting function offers, a property of the function: `quote(!!x)` negates, `expr(!!x)` splices. */
8
8
  export declare enum Unquote {
@@ -13,16 +13,45 @@ export declare enum Unquote {
13
13
  /** `bquote`'s `.(x)` evaluates its operand */
14
14
  Bquote = "bquote"
15
15
  }
16
+ /**
17
+ * A call that hands its arguments a data mask, with the names in that mask the caller binds itself.
18
+ * Those mean the column as much as the binding, so {@link Nse.linkMasksToData} links them to the data too.
19
+ */
20
+ export interface MaskingCall {
21
+ readonly id: NodeId;
22
+ readonly bound: readonly NodeId[];
23
+ }
16
24
  /** The parts of a call R does not evaluate the standard way. */
17
25
  export declare const Nse: {
26
+ readonly name: "Nse";
18
27
  /** The ids an {@link Unquote} escape hands back to standard evaluation, the markers themselves excluded. */
19
28
  readonly unquoted: <Info extends ParentInformation>(this: void, root: RNode<Info> | undefined, style: Unquote) => ReadonlySet<NodeId> | undefined;
20
29
  /** Whether everything below `node` is unquoted. */
21
30
  readonly isUnquote: <Info>(this: void, node: RNode<Info>, style: Unquote) => boolean;
22
- /** Drops the mask mark from names the caller binds: while `filter(d, k)` is processed `k` has no read yet. */
23
- readonly dropResolvedMask: (this: void, graph: DataflowGraph, id: NodeId, name: Identifier) => void;
24
- /** Drops the non-standard-evaluation mark from the outgoing edges of `id` that `which` accepts. */
25
- readonly unmark: (this: void, graph: DataflowGraph, id: NodeId, which?: (target: NodeId) => boolean) => void;
31
+ /**
32
+ * Drops the mask mark from names the caller binds to a value: while `filter(d, k)` is processed `k` has no
33
+ * read yet. A name bound to a function keeps its mark, as `filter(d, id > 2)` next to `id <- function(...)`
34
+ * still means the column. Hands back the masking call and the names it just unmarked, `undefined` when
35
+ * `name` does not mask at all, so {@link linkMasksToData} need not ask a second time.
36
+ */
37
+ readonly dropResolvedMask: (this: void, graph: DataflowGraph, id: NodeId, name: Identifier) => MaskingCall | undefined;
38
+ /** Drops the non-standard-evaluation mark from the outgoing edges of `id` that `which` accepts, and reports them. */
39
+ readonly unmark: (this: void, graph: DataflowGraph, id: NodeId, which?: (target: NodeId) => boolean) => NodeId[];
40
+ /** Whether the vertex is a name a data mask may supply, which is every name appearing in the mask. */
41
+ readonly maskCandidate: (this: void, vertex: DataflowGraphVertexInfo | undefined) => boolean;
26
42
  /** Whether `id` is a name the data mask supplies, i.e. a use the caller does not bind itself. */
27
43
  readonly suppliedByMask: (this: void, graph: DataflowGraph, id: NodeId, vertex?: DataflowGraphVertexInfo | undefined) => boolean;
44
+ /**
45
+ * Whether `id` is a name a data mask supplied, which the mark the masking call carries is what records.
46
+ * Unlike {@link suppliedByMask} this survives {@link linkMasksToData}, so ask this one after the dataflow
47
+ * is complete and that one while a call is still being processed.
48
+ */
49
+ readonly maskedName: (this: void, graph: DataflowGraph, id: NodeId) => boolean;
50
+ /**
51
+ * Links every name the data masks of `calls` supply to the data it comes from: `id` in `filter(df, id > 2)`
52
+ * is a column of `df`, so it reads `df`. Run once every mark has settled, as adding the read makes
53
+ * {@link suppliedByMask} false for the name; a call whose first argument is masked too has no data to link
54
+ * against.
55
+ */
56
+ readonly linkMasksToData: (this: void, graph: DataflowGraph, calls: readonly MaskingCall[]) => void;
28
57
  };
@@ -6,6 +6,7 @@ const r_unary_op_1 = require("../../../../../r-bridge/lang-4.x/ast/model/nodes/r
6
6
  const r_function_call_1 = require("../../../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
7
7
  const identifier_1 = require("../../../../environments/identifier");
8
8
  const data_masking_functions_1 = require("../../../../environments/data-masking-functions");
9
+ const graph_1 = require("../../../../graph/graph");
9
10
  const vertex_1 = require("../../../../graph/vertex");
10
11
  const edge_1 = require("../../../../graph/edge");
11
12
  /** The escape a quoting function offers, a property of the function: `quote(!!x)` negates, `expr(!!x)` splices. */
@@ -39,8 +40,48 @@ function unquotedOperandOf(node, style) {
39
40
  function isNegation(node) {
40
41
  return r_unary_op_1.RUnaryOp.is(node) && node.operator === '!';
41
42
  }
43
+ /**
44
+ * Whether the definition is a bare function: the vertex itself, or a variable bound straight to a function
45
+ * definition. A binding that anything was done to on the way (`structure(f, class = "cls")`, `class(f) <- `)
46
+ * is not one, and deliberately so: such a closure carries a class, `>` may dispatch on it, and flowR cannot
47
+ * tell that it does not. Only where nothing at all can be attached is a function ruled out as an operand.
48
+ */
49
+ function definesAFunction(graph, id) {
50
+ const vertex = graph.getVertex(id);
51
+ if (vertex_1.FunctionDefinitionVertex.is(vertex)) {
52
+ return true;
53
+ }
54
+ else if (!vertex_1.VariableDefinitionVertex.is(vertex)) {
55
+ return false;
56
+ }
57
+ for (const [target, edge] of graph.outgoingEdges(id) ?? graph_1.NoEdges) {
58
+ if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.DefinedBy) && vertex_1.FunctionDefinitionVertex.is(graph.getVertex(target))) {
59
+ return true;
60
+ }
61
+ }
62
+ return false;
63
+ }
64
+ /**
65
+ * Whether `id` reads something and everything it reads is a bare function. In a data mask such a name is a
66
+ * column after all: R asks the data first, and a plain closure is not what `id > 2` compares. A closure that
67
+ * was given a class is left alone, see {@link definesAFunction}.
68
+ */
69
+ function readsOnlyFunctions(graph, id) {
70
+ let reads = false;
71
+ for (const [target, edge] of graph.outgoingEdges(id) ?? graph_1.NoEdges) {
72
+ if (!edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads)) {
73
+ continue;
74
+ }
75
+ else if (!definesAFunction(graph, target)) {
76
+ return false;
77
+ }
78
+ reads = true;
79
+ }
80
+ return reads;
81
+ }
42
82
  /** The parts of a call R does not evaluate the standard way. */
43
83
  exports.Nse = {
84
+ name: 'Nse',
44
85
  /** The ids an {@link Unquote} escape hands back to standard evaluation, the markers themselves excluded. */
45
86
  unquoted(root, style) {
46
87
  if (root === undefined || style === Unquote.None) {
@@ -64,24 +105,91 @@ exports.Nse = {
64
105
  isUnquote(node, style) {
65
106
  return style !== Unquote.None && unquotedOperandOf(node, style) !== undefined;
66
107
  },
67
- /** Drops the mask mark from names the caller binds: while `filter(d, k)` is processed `k` has no read yet. */
108
+ /**
109
+ * Drops the mask mark from names the caller binds to a value: while `filter(d, k)` is processed `k` has no
110
+ * read yet. A name bound to a function keeps its mark, as `filter(d, id > 2)` next to `id <- function(...)`
111
+ * still means the column. Hands back the masking call and the names it just unmarked, `undefined` when
112
+ * `name` does not mask at all, so {@link linkMasksToData} need not ask a second time.
113
+ */
68
114
  dropResolvedMask(graph, id, name) {
69
- if (data_masking_functions_1.DataMaskingFunctionNames.has(identifier_1.Identifier.getName(name))) {
70
- exports.Nse.unmark(graph, id, target => !exports.Nse.suppliedByMask(graph, target));
115
+ if (!data_masking_functions_1.DataMaskingFunctionNames.has(identifier_1.Identifier.getName(name))) {
116
+ return undefined;
71
117
  }
118
+ return { id, bound: exports.Nse.unmark(graph, id, target => !exports.Nse.suppliedByMask(graph, target) && !readsOnlyFunctions(graph, target)) };
72
119
  },
73
- /** Drops the non-standard-evaluation mark from the outgoing edges of `id` that `which` accepts. */
120
+ /** Drops the non-standard-evaluation mark from the outgoing edges of `id` that `which` accepts, and reports them. */
74
121
  unmark(graph, id, which = () => true) {
75
- const edges = graph.outgoingEdges(id);
76
- for (const [target, edge] of [...edges ?? []]) {
122
+ const dropped = [];
123
+ for (const [target, edge] of graph.outgoingEdges(id) ?? graph_1.NoEdges) {
77
124
  if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.NonStandardEvaluation) && which(target)) {
78
125
  graph.removeEdgeType(id, target, edge_1.EdgeType.NonStandardEvaluation);
126
+ dropped.push(target);
79
127
  }
80
128
  }
129
+ return dropped;
130
+ },
131
+ /** Whether the vertex is a name a data mask may supply, which is every name appearing in the mask. */
132
+ maskCandidate(vertex) {
133
+ return vertex_1.UseVertex.is(vertex);
81
134
  },
82
135
  /** Whether `id` is a name the data mask supplies, i.e. a use the caller does not bind itself. */
83
136
  suppliedByMask(graph, id, vertex = graph.getVertex(id)) {
84
137
  return vertex_1.UseVertex.is(vertex) && !graph.outgoingEdges(id)?.values().some(e => edge_1.DfEdge.includesType(e, edge_1.EdgeType.Reads));
138
+ },
139
+ /**
140
+ * Whether `id` is a name a data mask supplied, which the mark the masking call carries is what records.
141
+ * Unlike {@link suppliedByMask} this survives {@link linkMasksToData}, so ask this one after the dataflow
142
+ * is complete and that one while a call is still being processed.
143
+ */
144
+ maskedName(graph, id) {
145
+ for (const [source, edge] of graph.ingoingEdges(id) ?? graph_1.NoEdges) {
146
+ const call = edge_1.DfEdge.includesType(edge, edge_1.EdgeType.NonStandardEvaluation) ? graph.getVertex(source) : undefined;
147
+ if (vertex_1.FunctionCallVertex.is(call) && call.name !== undefined && data_masking_functions_1.DataMaskingFunctionNames.has(identifier_1.Identifier.getName(call.name))) {
148
+ return true;
149
+ }
150
+ }
151
+ return false;
152
+ },
153
+ /**
154
+ * Links every name the data masks of `calls` supply to the data it comes from: `id` in `filter(df, id > 2)`
155
+ * is a column of `df`, so it reads `df`. Run once every mark has settled, as adding the read makes
156
+ * {@link suppliedByMask} false for the name; a call whose first argument is masked too has no data to link
157
+ * against.
158
+ */
159
+ linkMasksToData(graph, calls) {
160
+ const links = [];
161
+ for (const { id, bound } of calls) {
162
+ const call = graph.getVertex(id);
163
+ const data = vertex_1.FunctionCallVertex.is(call) ? call.args.find(a => a !== r_function_call_1.EmptyArgument) : undefined;
164
+ if (data === undefined) {
165
+ continue;
166
+ }
167
+ /* what is still marked are the names the data supplies, the unmarked ones mean the binding too */
168
+ const masked = new Set(bound);
169
+ for (const [target, edge] of graph.outgoingEdges(id) ?? graph_1.NoEdges) {
170
+ if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.NonStandardEvaluation)) {
171
+ masked.add(target);
172
+ }
173
+ }
174
+ /* a call masking its first argument too, like `aes(x, y)`, has no data to link against */
175
+ if (masked.has(data.nodeId)) {
176
+ continue;
177
+ }
178
+ for (const target of masked) {
179
+ /* a function of that name is not what the mask means, so the column takes its place */
180
+ if (readsOnlyFunctions(graph, target)) {
181
+ for (const [definition, edge] of graph.outgoingEdges(target) ?? graph_1.NoEdges) {
182
+ if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads)) {
183
+ graph.removeEdgeType(target, definition, edge_1.EdgeType.Reads);
184
+ }
185
+ }
186
+ }
187
+ links.push([target, data.nodeId]);
188
+ }
189
+ }
190
+ for (const [from, to] of links) {
191
+ graph.addEdge(from, to, edge_1.EdgeType.Reads);
192
+ }
85
193
  }
86
194
  };
87
195
  //# sourceMappingURL=nse.js.map
@@ -6,8 +6,14 @@ import { linkExpressionIn } from '../../../linker';
6
6
  /**
7
7
  * A language object reads nothing where it is written and everything where it reaches `eval`, with the bindings
8
8
  * in effect there. Working on the finished graph makes assignments, branches, loops, and calls one traversal.
9
+ * @example
10
+ * ```ts
11
+ * Quoted.capturedBy(graph, id); // the expression a `quote(...)` holds on to
12
+ * Quoted.sourcesOf(graph, id); // every expression the value at `id` may hold
13
+ * ```
9
14
  */
10
15
  export declare const Quoted: {
16
+ readonly name: "Quoted";
11
17
  /** The expression a capturing call holds on to. */
12
18
  readonly capturedBy: (this: void, graph: DataflowGraph, id: NodeId) => NodeId | undefined;
13
19
  /** Every expression the value at `id` may hold, with the call that captured it. Several is normal. */
@@ -12,6 +12,7 @@ const vertex_1 = require("../../../../graph/vertex");
12
12
  const linker_1 = require("../../../linker");
13
13
  const nse_1 = require("./nse");
14
14
  const deferred_1 = require("./deferred");
15
+ const vertex_2 = require("../../../../graph/vertex");
15
16
  /** Calls capturing a language object. */
16
17
  const CapturingProcessors = [built_in_proc_name_1.BuiltInProcName.Quote];
17
18
  /** Calls capturing an expression as a promise, forced at some later read of the variable they bind. */
@@ -26,8 +27,14 @@ function hasOrigin(vertex, of) {
26
27
  /**
27
28
  * A language object reads nothing where it is written and everything where it reaches `eval`, with the bindings
28
29
  * in effect there. Working on the finished graph makes assignments, branches, loops, and calls one traversal.
30
+ * @example
31
+ * ```ts
32
+ * Quoted.capturedBy(graph, id); // the expression a `quote(...)` holds on to
33
+ * Quoted.sourcesOf(graph, id); // every expression the value at `id` may hold
34
+ * ```
29
35
  */
30
36
  exports.Quoted = {
37
+ name: 'Quoted',
31
38
  /** The expression a capturing call holds on to. */
32
39
  capturedBy(graph, id) {
33
40
  const vertex = graph.getVertex(id);
@@ -45,7 +52,7 @@ exports.Quoted = {
45
52
  found.push({ expr: captured, at: current });
46
53
  continue;
47
54
  }
48
- for (const [target, edge] of graph.outgoingEdges(current) ?? []) {
55
+ for (const [target, edge] of graph.outgoingEdges(current) ?? graph_1.NoEdges) {
49
56
  if (edge_1.DfEdge.includesType(edge, ValueFlow) && !seen.has(target)) {
50
57
  seen.add(target);
51
58
  pending.push(target);
@@ -65,8 +72,12 @@ exports.Quoted = {
65
72
  let names = undefined;
66
73
  let cfg = null;
67
74
  const cfgOnce = () => (cfg === null ? (cfg = controlFlow()) : cfg);
75
+ const masking = [];
68
76
  for (const [id, vertex] of graph.verticesOfType(vertex_1.VertexType.FunctionCall)) {
69
- nse_1.Nse.dropResolvedMask(graph, id, vertex.name);
77
+ const masks = nse_1.Nse.dropResolvedMask(graph, id, vertex.name);
78
+ if (masks !== undefined) {
79
+ masking.push(masks);
80
+ }
70
81
  if (DelayingCalls.has(identifier_1.Identifier.getName(vertex.name))) {
71
82
  const promise = capturedArgumentOf(graph, id);
72
83
  const binding = promise === undefined ? undefined : boundBy(graph, id);
@@ -78,7 +89,8 @@ exports.Quoted = {
78
89
  }
79
90
  }
80
91
  else if (vertex.environment !== undefined && hasOrigin(vertex, EvaluatingProcessors) && !evaluatesElsewhere(idMap.get(id))) {
81
- resolveEvaluation(graph, vertex, vertex.environment, idMap);
92
+ names ??= deferred_1.Deferred.indexOf(graph, idMap);
93
+ resolveEvaluation(graph, vertex, vertex.environment, idMap, names, cfgOnce());
82
94
  }
83
95
  else {
84
96
  for (const escaped of escapingArguments(graph, id)) {
@@ -87,11 +99,13 @@ exports.Quoted = {
87
99
  }
88
100
  }
89
101
  }
102
+ /* only once every mark has settled: the read a column gets makes it look bound from here on */
103
+ nse_1.Nse.linkMasksToData(graph, masking);
90
104
  }
91
105
  };
92
106
  /** The name a delaying call binds, which is the definition its reads have to go through. */
93
107
  function boundBy(graph, id) {
94
- for (const [target, edge] of graph.ingoingEdges(id) ?? []) {
108
+ for (const [target, edge] of graph.ingoingEdges(id) ?? graph_1.NoEdges) {
95
109
  if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.DefinedBy) && vertex_1.VariableDefinitionVertex.is(graph.getVertex(target))) {
96
110
  return target;
97
111
  }
@@ -100,7 +114,7 @@ function boundBy(graph, id) {
100
114
  }
101
115
  /** The argument a call takes but does not evaluate, which is the one it captured. */
102
116
  function capturedArgumentOf(graph, id) {
103
- for (const [target, edge] of graph.outgoingEdges(id) ?? []) {
117
+ for (const [target, edge] of graph.outgoingEdges(id) ?? graph_1.NoEdges) {
104
118
  if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Argument) && edge_1.DfEdge.includesType(edge, edge_1.EdgeType.NonStandardEvaluation)) {
105
119
  return target;
106
120
  }
@@ -108,7 +122,7 @@ function capturedArgumentOf(graph, id) {
108
122
  return undefined;
109
123
  }
110
124
  /** Links a capture handed to an evaluating call, in that call's scope. */
111
- function resolveEvaluation(graph, call, environment, idMap) {
125
+ function resolveEvaluation(graph, call, environment, idMap, names, cfg) {
112
126
  const id = call.id;
113
127
  const argument = call.args.find(a => !graph_1.FunctionArgument.isEmpty(a));
114
128
  const reference = argument === undefined ? undefined : unwrapArgument(graph_1.FunctionArgument.getReference(argument), idMap);
@@ -121,6 +135,7 @@ function resolveEvaluation(graph, call, environment, idMap) {
121
135
  (0, linker_1.linkInputs)(open, enclosing, [], graph, false);
122
136
  }
123
137
  graph.addEdge(id, expr, edge_1.EdgeType.Returns);
138
+ deferred_1.Deferred.publish(graph, expr, names, idMap, id, cfg);
124
139
  /* the capture said "not evaluated here", and being handed to `eval` settles that it is */
125
140
  nse_1.Nse.unmark(graph, at);
126
141
  }
@@ -134,23 +149,23 @@ function resolveEvaluation(graph, call, environment, idMap) {
134
149
  * body itself (what `force` is for) is settled during the call and stays where it is.
135
150
  */
136
151
  function* escapingArguments(graph, id) {
137
- for (const [target, edge] of graph.outgoingEdges(id) ?? []) {
152
+ for (const [target, edge] of graph.outgoingEdges(id) ?? graph_1.NoEdges) {
138
153
  if (!edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Calls)) {
139
154
  continue;
140
155
  }
141
156
  const callee = graph.getVertex(target);
142
- if (callee?.tag !== vertex_1.VertexType.FunctionDefinition) {
157
+ if (!vertex_2.FunctionDefinitionVertex.is(callee)) {
143
158
  continue;
144
159
  }
145
160
  for (const exit of callee.exitPoints) {
146
161
  const closure = graph.getVertex(exit.nodeId);
147
- if (closure?.tag !== vertex_1.VertexType.FunctionDefinition) {
162
+ if (!vertex_2.FunctionDefinitionVertex.is(closure)) {
148
163
  continue;
149
164
  }
150
165
  for (const key of Object.keys(callee.params)) {
151
166
  const parameter = node_id_1.NodeId.normalize(key);
152
167
  let escapes = true;
153
- for (const [reader, edge] of graph.ingoingEdges(parameter) ?? []) {
168
+ for (const [reader, edge] of graph.ingoingEdges(parameter) ?? graph_1.NoEdges) {
154
169
  if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.Reads) && !closure.subflow.graph.has(reader)) {
155
170
  escapes = false;
156
171
  break;
@@ -159,7 +174,7 @@ function* escapingArguments(graph, id) {
159
174
  if (!escapes) {
160
175
  continue;
161
176
  }
162
- for (const [argument, edge] of graph.outgoingEdges(parameter) ?? []) {
177
+ for (const [argument, edge] of graph.outgoingEdges(parameter) ?? graph_1.NoEdges) {
163
178
  if (edge_1.DfEdge.includesType(edge, edge_1.EdgeType.DefinedByOnCall)) {
164
179
  yield argument;
165
180
  }
@@ -75,6 +75,7 @@ export type Origin = SimpleOrigin | FunctionCallOrigin | BuiltInFunctionOrigin;
75
75
  * Similarly, requesting the origin of `print` returns a {@link BuiltInFunctionOrigin|`BuiltInFunctionOrigin`}.
76
76
  *
77
77
  * This returns undefined only if there is no dataflow correspondence (e.g. in case of unevaluated non-standard eval).
78
+ * @useInstead {@link Dataflow.origin}
78
79
  */
79
80
  export declare function getOriginInDfg(this: void, dfg: DataflowGraph, id: NodeId): Origin[] | undefined;
80
81
  export {};
@@ -6,6 +6,8 @@ const vertex_1 = require("../graph/vertex");
6
6
  const edge_1 = require("../graph/edge");
7
7
  const linker_1 = require("../internal/linker");
8
8
  const assert_1 = require("../../util/assert");
9
+ const vertex_2 = require("../graph/vertex");
10
+ const graph_1 = require("../graph/graph");
9
11
  /**
10
12
  * Obtain the (dataflow) origin of a given node in the dfg.
11
13
  * @example consider the following code:
@@ -21,6 +23,7 @@ const assert_1 = require("../../util/assert");
21
23
  * Similarly, requesting the origin of `print` returns a {@link BuiltInFunctionOrigin|`BuiltInFunctionOrigin`}.
22
24
  *
23
25
  * This returns undefined only if there is no dataflow correspondence (e.g. in case of unevaluated non-standard eval).
26
+ * @useInstead {@link Dataflow.origin}
24
27
  */
25
28
  function getOriginInDfg(dfg, id) {
26
29
  const vtx = dfg.getVertex(id);
@@ -44,7 +47,7 @@ const UnwantedVariableTypes = edge_1.EdgeType.NonStandardEvaluation;
44
47
  function getVariableUseOrigin(dfg, use) {
45
48
  // to identify the origins we have to track read edges and definitions on function calls
46
49
  const origins = [];
47
- for (const [target, e] of dfg.outgoingEdges(use.id) ?? []) {
50
+ for (const [target, e] of dfg.outgoingEdges(use.id) ?? graph_1.NoEdges) {
48
51
  if (edge_1.DfEdge.doesNotIncludeType(e, WantedVariableTypes) || edge_1.DfEdge.includesType(e, UnwantedVariableTypes)) {
49
52
  continue;
50
53
  }
@@ -52,7 +55,7 @@ function getVariableUseOrigin(dfg, use) {
52
55
  if (!targetVtx) {
53
56
  continue;
54
57
  }
55
- if (targetVtx.tag === vertex_1.VertexType.VariableDefinition) {
58
+ if (vertex_2.VariableDefinitionVertex.is(targetVtx)) {
56
59
  origins.push({
57
60
  type: 0 /* OriginType.ReadVariableOrigin */,
58
61
  id: target
@@ -63,14 +66,14 @@ function getVariableUseOrigin(dfg, use) {
63
66
  }
64
67
  function getVariableDefinitionOrigin(dfg, vtx) {
65
68
  const pool = [{ type: 1 /* OriginType.WriteVariableOrigin */, id: vtx.id }];
66
- const outgoingReads = dfg.outgoingEdges(vtx.id) ?? [];
69
+ const outgoingReads = dfg.outgoingEdges(vtx.id) ?? graph_1.NoEdges;
67
70
  for (const [target, e] of outgoingReads) {
68
71
  if (edge_1.DfEdge.includesType(e, edge_1.EdgeType.Reads)) {
69
72
  const targetVtx = dfg.getVertex(target);
70
73
  if (!targetVtx) {
71
74
  continue;
72
75
  }
73
- if (targetVtx.tag === vertex_1.VertexType.VariableDefinition) {
76
+ if (vertex_2.VariableDefinitionVertex.is(targetVtx)) {
74
77
  pool.push({
75
78
  type: 0 /* OriginType.ReadVariableOrigin */,
76
79
  id: target
@@ -104,11 +107,11 @@ function getCallTarget(dfg, call) {
104
107
  };
105
108
  }
106
109
  const get = dfg.getVertex(target);
107
- if (get?.tag !== vertex_1.VertexType.FunctionDefinition && get?.tag !== vertex_1.VertexType.VariableDefinition) {
110
+ if (!vertex_2.FunctionDefinitionVertex.is(get) && !vertex_2.VariableDefinitionVertex.is(get)) {
108
111
  return undefined;
109
112
  }
110
113
  return {
111
- type: get.tag === vertex_1.VertexType.FunctionDefinition ? 2 /* OriginType.FunctionCallOrigin */ : 0 /* OriginType.ReadVariableOrigin */,
114
+ type: vertex_2.FunctionDefinitionVertex.is(get) ? 2 /* OriginType.FunctionCallOrigin */ : 0 /* OriginType.ReadVariableOrigin */,
112
115
  id: target
113
116
  };
114
117
  }).filter(assert_1.isNotUndefined));