@eagleoutice/flowr 2.9.9 → 2.9.11

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 (198) hide show
  1. package/README.md +57 -54
  2. package/abstract-interpretation/absint-visitor.d.ts +16 -14
  3. package/abstract-interpretation/absint-visitor.js +93 -47
  4. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +1 -1
  5. package/abstract-interpretation/data-frame/mappers/arguments.js +2 -2
  6. package/abstract-interpretation/data-frame/shape-inference.d.ts +2 -5
  7. package/abstract-interpretation/data-frame/shape-inference.js +4 -5
  8. package/abstract-interpretation/domains/abstract-domain.d.ts +4 -4
  9. package/abstract-interpretation/domains/abstract-domain.js +8 -8
  10. package/abstract-interpretation/domains/mapped-abstract-domain.d.ts +12 -5
  11. package/abstract-interpretation/domains/mapped-abstract-domain.js +47 -23
  12. package/abstract-interpretation/domains/set-range-domain.js +1 -1
  13. package/abstract-interpretation/domains/state-abstract-domain.d.ts +30 -1
  14. package/abstract-interpretation/domains/state-abstract-domain.js +130 -4
  15. package/abstract-interpretation/normalized-ast-fold.d.ts +2 -2
  16. package/abstract-interpretation/normalized-ast-fold.js +4 -3
  17. package/benchmark/slicer.js +5 -5
  18. package/benchmark/summarizer/first-phase/process.js +4 -4
  19. package/cli/repl/commands/repl-normalize.js +2 -2
  20. package/cli/repl/core.js +2 -2
  21. package/config.js +1 -1
  22. package/control-flow/cfg-simplification.d.ts +1 -0
  23. package/control-flow/cfg-simplification.js +1 -0
  24. package/control-flow/control-flow-graph.d.ts +1 -1
  25. package/control-flow/control-flow-graph.js +1 -2
  26. package/control-flow/extract-cfg.js +34 -15
  27. package/control-flow/semantic-cfg-guided-visitor.js +1 -0
  28. package/dataflow/cluster.js +1 -1
  29. package/dataflow/environments/built-in.d.ts +6 -15
  30. package/dataflow/environments/built-in.js +25 -33
  31. package/dataflow/environments/default-builtin-config.d.ts +4 -8
  32. package/dataflow/environments/default-builtin-config.js +8 -5
  33. package/dataflow/environments/reference-to-maybe.d.ts +8 -0
  34. package/dataflow/environments/reference-to-maybe.js +46 -3
  35. package/dataflow/eval/resolve/alias-tracking.d.ts +2 -2
  36. package/dataflow/eval/resolve/alias-tracking.js +6 -6
  37. package/dataflow/eval/resolve/resolve.js +12 -10
  38. package/dataflow/fn/exceptions-of-function.d.ts +1 -1
  39. package/dataflow/fn/exceptions-of-function.js +2 -1
  40. package/dataflow/graph/call-graph.d.ts +1 -1
  41. package/dataflow/graph/call-graph.js +4 -3
  42. package/dataflow/graph/dataflowgraph-builder.d.ts +1 -1
  43. package/dataflow/graph/dataflowgraph-builder.js +21 -21
  44. package/dataflow/graph/graph.d.ts +5 -5
  45. package/dataflow/graph/graph.js +36 -32
  46. package/dataflow/graph/unknown-side-effect.js +3 -1
  47. package/dataflow/info.d.ts +4 -0
  48. package/dataflow/info.js +2 -2
  49. package/dataflow/internal/linker.d.ts +4 -4
  50. package/dataflow/internal/linker.js +59 -33
  51. package/dataflow/internal/process/functions/call/argument/make-argument.d.ts +2 -1
  52. package/dataflow/internal/process/functions/call/argument/make-argument.js +3 -1
  53. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +1 -1
  54. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +2 -1
  55. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +3 -5
  56. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +1 -1
  57. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +6 -5
  58. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +15 -6
  59. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +1 -1
  60. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +3 -2
  61. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +4 -4
  62. package/dataflow/internal/process/functions/call/built-in/built-in-local.js +3 -3
  63. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +2 -2
  64. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +1 -1
  65. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +2 -1
  66. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.js +7 -7
  67. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.js +3 -3
  68. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +22 -11
  69. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +22 -19
  70. package/dataflow/internal/process/functions/call/common.d.ts +1 -1
  71. package/dataflow/internal/process/functions/call/common.js +43 -35
  72. package/dataflow/internal/process/functions/call/known-call-handling.js +0 -2
  73. package/dataflow/internal/process/functions/process-argument.d.ts +1 -1
  74. package/dataflow/internal/process/functions/process-argument.js +3 -3
  75. package/dataflow/internal/process/functions/process-parameter.js +2 -2
  76. package/dataflow/origin/dfg-get-origin.d.ts +1 -1
  77. package/dataflow/origin/dfg-get-origin.js +2 -2
  78. package/documentation/doc-util/doc-types.js +1 -1
  79. package/documentation/wiki-absint.js +7 -8
  80. package/documentation/wiki-cfg.js +3 -3
  81. package/documentation/wiki-mk/doc-context.d.ts +8 -0
  82. package/documentation/wiki-mk/doc-context.js +4 -0
  83. package/documentation/wiki-normalized-ast.d.ts +1 -1
  84. package/documentation/wiki-normalized-ast.js +9 -6
  85. package/linter/linter-format.d.ts +10 -0
  86. package/linter/linter-format.js +15 -0
  87. package/linter/rules/absolute-path.js +3 -3
  88. package/linter/rules/dead-code.js +1 -1
  89. package/linter/rules/file-path-validity.js +1 -1
  90. package/linter/rules/seeded-randomness.js +1 -1
  91. package/linter/rules/unused-definition.js +1 -1
  92. package/package.json +7 -7
  93. package/project/plugins/file-plugins/files/flowr-description-file.d.ts +9 -0
  94. package/project/plugins/file-plugins/files/flowr-description-file.js +12 -0
  95. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
  96. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.d.ts +1 -1
  97. package/queries/catalog/call-context-query/identify-link-to-last-call-relation.js +4 -5
  98. package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -1
  99. package/queries/catalog/dependencies-query/dependencies-query-format.js +6 -5
  100. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +1 -1
  101. package/queries/catalog/df-shape-query/df-shape-query-format.js +3 -3
  102. package/queries/catalog/does-call-query/does-call-query-executor.js +3 -3
  103. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +1 -1
  104. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.js +2 -2
  105. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +1 -1
  106. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.js +1 -1
  107. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +1 -1
  108. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.js +1 -1
  109. package/queries/query-print.d.ts +1 -1
  110. package/queries/query-print.js +4 -3
  111. package/r-bridge/lang-4.x/ast/model/model.d.ts +151 -4
  112. package/r-bridge/lang-4.x/ast/model/model.js +249 -0
  113. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.d.ts +11 -1
  114. package/r-bridge/lang-4.x/ast/model/nodes/info/r-delimiter.js +13 -0
  115. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +19 -1
  116. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +26 -0
  117. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +36 -3
  118. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +48 -13
  119. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +16 -1
  120. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +21 -0
  121. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +11 -1
  122. package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +14 -0
  123. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +8 -2
  124. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +11 -5
  125. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +23 -1
  126. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +32 -0
  127. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +11 -1
  128. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +14 -0
  129. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +19 -1
  130. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +26 -1
  131. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +11 -1
  132. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +14 -0
  133. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +11 -1
  134. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +14 -0
  135. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +12 -2
  136. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +14 -0
  137. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +20 -2
  138. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +26 -0
  139. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +12 -2
  140. package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +14 -0
  141. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +8 -2
  142. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +11 -5
  143. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +17 -1
  144. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +22 -0
  145. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +16 -1
  146. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +22 -0
  147. package/r-bridge/lang-4.x/ast/model/nodes/r-project.d.ts +45 -8
  148. package/r-bridge/lang-4.x/ast/model/nodes/r-project.js +57 -16
  149. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +12 -2
  150. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +14 -0
  151. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +15 -3
  152. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +21 -6
  153. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +21 -6
  154. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +22 -5
  155. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +16 -1
  156. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +21 -0
  157. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +11 -1
  158. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +14 -0
  159. package/r-bridge/lang-4.x/ast/model/processing/decorate.js +23 -17
  160. package/r-bridge/lang-4.x/ast/model/processing/node-id.d.ts +39 -2
  161. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +52 -9
  162. package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +18 -17
  163. package/r-bridge/lang-4.x/ast/model/processing/visitor.d.ts +8 -7
  164. package/r-bridge/lang-4.x/ast/model/processing/visitor.js +6 -13
  165. package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +1 -1
  166. package/r-bridge/lang-4.x/ast/parser/json/parser.js +1 -1
  167. package/r-bridge/lang-4.x/ast/parser/main/internal/expression/normalize-expression.js +4 -2
  168. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-number.js +1 -1
  169. package/r-bridge/lang-4.x/ast/parser/main/internal/values/normalize-string.js +2 -2
  170. package/r-bridge/lang-4.x/convert-values.d.ts +14 -5
  171. package/r-bridge/lang-4.x/convert-values.js +76 -72
  172. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +33 -15
  173. package/r-bridge/roxygen2/roxygen-parse.js +1 -1
  174. package/r-bridge/shell-executor.js +1 -1
  175. package/reconstruct/auto-select/magic-comments.js +4 -4
  176. package/reconstruct/reconstruct.js +2 -1
  177. package/search/search-executor/search-generators.js +2 -2
  178. package/slicing/criterion/filters/all-variables.js +1 -1
  179. package/slicing/criterion/parse.d.ts +1 -1
  180. package/slicing/criterion/parse.js +5 -3
  181. package/slicing/static/slice-call.d.ts +1 -1
  182. package/slicing/static/slice-call.js +2 -2
  183. package/statistics/features/supported/assignments/assignments.js +2 -2
  184. package/statistics/features/supported/control-flow/control-flow.js +2 -2
  185. package/statistics/features/supported/data-access/data-access.js +6 -5
  186. package/statistics/features/supported/defined-functions/defined-functions.js +9 -8
  187. package/statistics/features/supported/expression-list/statistics-expression-list.js +2 -2
  188. package/statistics/features/supported/loops/loops.js +6 -5
  189. package/statistics/features/supported/used-functions/used-functions.js +2 -2
  190. package/statistics/features/supported/variables/variables.js +8 -8
  191. package/util/mermaid/ast.js +3 -3
  192. package/util/mermaid/cfg.js +3 -4
  193. package/util/mermaid/dfg.d.ts +1 -1
  194. package/util/mermaid/dfg.js +13 -12
  195. package/util/simple-df/dfg-ascii.js +1 -1
  196. package/util/version.js +1 -1
  197. package/r-bridge/lang-4.x/ast/model/collect.d.ts +0 -10
  198. package/r-bridge/lang-4.x/ast/model/collect.js +0 -25
@@ -1,9 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.BuiltIns = exports.BuiltInEvalHandlerMapper = exports.BuiltInProcessorMapper = exports.BuiltInProcName = void 0;
4
- exports.builtInId = builtInId;
5
- exports.isBuiltIn = isBuiltIn;
6
- exports.dropBuiltInPrefix = dropBuiltInPrefix;
7
4
  const known_call_handling_1 = require("../internal/process/functions/call/known-call-handling");
8
5
  const built_in_access_1 = require("../internal/process/functions/call/built-in/built-in-access");
9
6
  const built_in_if_then_else_1 = require("../internal/process/functions/call/built-in/built-in-if-then-else");
@@ -21,6 +18,8 @@ const built_in_function_definition_1 = require("../internal/process/functions/ca
21
18
  const built_in_expression_list_1 = require("../internal/process/functions/call/built-in/built-in-expression-list");
22
19
  const built_in_get_1 = require("../internal/process/functions/call/built-in/built-in-get");
23
20
  const r_function_call_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
21
+ const r_symbol_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
22
+ const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
24
23
  const edge_1 = require("../graph/edge");
25
24
  const built_in_library_1 = require("../internal/process/functions/call/built-in/built-in-library");
26
25
  const built_in_source_1 = require("../internal/process/functions/call/built-in/built-in-source");
@@ -30,7 +29,6 @@ const built_in_vector_1 = require("../internal/process/functions/call/built-in/b
30
29
  const built_in_rm_1 = require("../internal/process/functions/call/built-in/built-in-rm");
31
30
  const built_in_eval_1 = require("../internal/process/functions/call/built-in/built-in-eval");
32
31
  const vertex_1 = require("../graph/vertex");
33
- const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
34
32
  const unknown_side_effect_1 = require("../graph/unknown-side-effect");
35
33
  const resolve_1 = require("../eval/resolve/resolve");
36
34
  const built_in_stop_if_not_1 = require("../internal/process/functions/call/built-in/built-in-stop-if-not");
@@ -41,30 +39,11 @@ const built_in_s_three_dispatch_1 = require("../internal/process/functions/call/
41
39
  const built_in_recall_1 = require("../internal/process/functions/call/built-in/built-in-recall");
42
40
  const built_in_s_seven_new_generic_1 = require("../internal/process/functions/call/built-in/built-in-s-seven-new-generic");
43
41
  const built_in_s_seven_dispatch_1 = require("../internal/process/functions/call/built-in/built-in-s-seven-dispatch");
44
- /**
45
- * Generate a built-in id for the given name
46
- */
47
- function builtInId(name) {
48
- return `built-in:${name}`;
49
- }
50
- /**
51
- * Checks whether the given name is a built-in identifier
52
- */
53
- function isBuiltIn(name) {
54
- return String(name).startsWith('built-in:');
55
- }
56
- const builtInPrefixLength = 'built-in:'.length;
57
- /**
58
- * Drops the `built-in:` prefix from the given built-in name
59
- */
60
- function dropBuiltInPrefix(name) {
61
- return name.slice(builtInPrefixLength);
62
- }
63
- function defaultBuiltInProcessor(name, args, rootId, data, { returnsNthArgument, useAsProcessor, forceArgs, readAllArguments, cfg, hasUnknownSideEffects, treatAsFnCall }) {
64
- const activeProcessor = useAsProcessor ?? BuiltInProcName.Default;
65
- const { information: res, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs, origin: activeProcessor });
42
+ const r_string_1 = require("../../r-bridge/lang-4.x/ast/model/nodes/r-string");
43
+ function defaultBuiltInProcessor(name, args, rootId, data, { returnsNthArgument, useAsProcessor = BuiltInProcName.Default, forceArgs, readAllArguments, cfg, hasUnknownSideEffects, treatAsFnCall }) {
44
+ const { information: res, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs, origin: useAsProcessor });
66
45
  if (returnsNthArgument !== undefined) {
67
- const arg = returnsNthArgument === 'last' ? processedArguments[args.length - 1] : processedArguments[returnsNthArgument];
46
+ const arg = returnsNthArgument === 'last' ? processedArguments.at(-1) : processedArguments[returnsNthArgument];
68
47
  if (arg !== undefined) {
69
48
  res.graph.addEdge(rootId, arg.entryPoint, edge_1.EdgeType.Returns);
70
49
  }
@@ -91,11 +70,11 @@ function defaultBuiltInProcessor(name, args, rootId, data, { returnsNthArgument,
91
70
  const rhs = arg.value;
92
71
  let fnName;
93
72
  let fnId;
94
- if (rhs.type === type_1.RType.String) {
73
+ if (r_string_1.RString.is(rhs)) {
95
74
  fnName = rhs.content.str;
96
75
  fnId = rhs.info.id;
97
76
  }
98
- else if (rhs.type === type_1.RType.Symbol) {
77
+ else if (r_symbol_1.RSymbol.is(rhs)) {
99
78
  fnName = rhs.content;
100
79
  fnId = rhs.info.id;
101
80
  }
@@ -110,7 +89,7 @@ function defaultBuiltInProcessor(name, args, rootId, data, { returnsNthArgument,
110
89
  environment: data.environment,
111
90
  onlyBuiltin: false,
112
91
  cds: data.cds,
113
- origin: [activeProcessor]
92
+ origin: [useAsProcessor]
114
93
  });
115
94
  }
116
95
  }
@@ -120,6 +99,16 @@ function defaultBuiltInProcessor(name, args, rootId, data, { returnsNthArgument,
120
99
  }
121
100
  return res;
122
101
  }
102
+ function defaultBuiltInProcessorReadallArgs(name, args, rootId, data, { useAsProcessor = BuiltInProcName.Default, forceArgs }) {
103
+ const { information, processedArguments } = (0, known_call_handling_1.processKnownFunctionCall)({ name, args, rootId, data, forceArgs, origin: useAsProcessor });
104
+ const g = information.graph;
105
+ for (const arg of processedArguments) {
106
+ if (arg) {
107
+ g.addEdge(rootId, arg.entryPoint, edge_1.EdgeType.Reads);
108
+ }
109
+ }
110
+ return information;
111
+ }
123
112
  /**
124
113
  * This contains all names of built-in function handlers and origins
125
114
  */
@@ -137,6 +126,8 @@ var BuiltInProcName;
137
126
  BuiltInProcName["Break"] = "builtin:break";
138
127
  /** the default built-in processor, see {@link defaultBuiltInProcessor} */
139
128
  BuiltInProcName["Default"] = "builtin:default";
129
+ /** Just a more performant variant of the default processor for built-ins that need to read all their arguments, see {@link defaultBuiltInProcessor}, this will still produce the origin `BuiltIn.Default` */
130
+ BuiltInProcName["DefaultReadAllArgs"] = "builtin:default-read-all-args";
140
131
  /** for `eval` calls, see {@link processEvalCall} */
141
132
  BuiltInProcName["Eval"] = "builtin:eval";
142
133
  /** for expression lists, see {@link processExpressionList} */
@@ -208,6 +199,7 @@ exports.BuiltInProcessorMapper = {
208
199
  [BuiltInProcName.Assignment]: built_in_assignment_1.processAssignment,
209
200
  [BuiltInProcName.AssignmentLike]: built_in_assignment_1.processAssignmentLike,
210
201
  [BuiltInProcName.Default]: defaultBuiltInProcessor,
202
+ [BuiltInProcName.DefaultReadAllArgs]: defaultBuiltInProcessorReadallArgs,
211
203
  [BuiltInProcName.Eval]: built_in_eval_1.processEvalCall,
212
204
  [BuiltInProcName.ExpressionList]: built_in_expression_list_1.processExpressionList,
213
205
  [BuiltInProcName.ForLoop]: built_in_for_loop_1.processForLoop,
@@ -247,7 +239,7 @@ class BuiltIns {
247
239
  registerBuiltInConstant({ names, value, assumePrimitive }) {
248
240
  for (const name of names) {
249
241
  const n = identifier_1.Identifier.getName(name);
250
- const id = builtInId(n);
242
+ const id = node_id_1.NodeId.toBuiltIn(n);
251
243
  const d = [{
252
244
  type: identifier_1.ReferenceType.BuiltInConstant,
253
245
  definedAt: id,
@@ -268,7 +260,7 @@ class BuiltIns {
268
260
  (0, assert_1.guard)(mappedProcessor !== undefined, () => `Processor for ${processor} is undefined! Please pass a valid builtin name ${JSON.stringify(Object.keys(exports.BuiltInProcessorMapper))}!`);
269
261
  for (const name of names) {
270
262
  const n = identifier_1.Identifier.getName(name);
271
- const id = builtInId(n);
263
+ const id = node_id_1.NodeId.toBuiltIn(n);
272
264
  const d = [{
273
265
  type: identifier_1.ReferenceType.BuiltInFunction,
274
266
  definedAt: id,
@@ -291,7 +283,7 @@ class BuiltIns {
291
283
  for (const assignment of names) {
292
284
  for (const suffix of suffixes) {
293
285
  const effectiveName = `${identifier_1.Identifier.getName(assignment)}${suffix}`;
294
- const id = builtInId(effectiveName);
286
+ const id = node_id_1.NodeId.toBuiltIn(effectiveName);
295
287
  const d = [{
296
288
  type: identifier_1.ReferenceType.BuiltInFunction,
297
289
  definedAt: id,
@@ -36,18 +36,14 @@ export declare const DefaultBuiltinConfig: [{
36
36
  }, {
37
37
  readonly type: "function";
38
38
  readonly names: ["~", "+", "-", "*", "/", "^", "!", "?", "**", "==", "!=", ">", "<", ">=", "<=", "%%", "%/%", "%*%", "%in%", ":", "rep", "seq", "seq_len", "seq_along", "seq.int", "gsub", "which", "class", "dimnames", "min", "max", "intersect", "subset", "match", "sqrt", "abs", "round", "floor", "ceiling", "signif", "trunc", "log", "log10", "log2", "sum", "mean", "unique", "paste", "paste0", "read.csv", "is.null", "numeric", "as.character", "as.integer", "as.logical", "as.numeric", "as.matrix", "rbind", "nrow", "ncol", "tryCatch", "expression", "factor", "missing", "as.data.frame", "data.frame", "na.omit", "rownames", "names", "order", "length", "any", "dim", "matrix", "cbind", "nchar", "pdf", "jpeg", "png", "windows", "postscript", "xfig", "bitmap", "pictex", "cairo_pdf", "svg", "bmp", "tiff", "X11", "quartz", "jitter"];
39
- readonly processor: BuiltInProcName.Default;
40
- readonly config: {
41
- readonly readAllArguments: true;
42
- };
39
+ readonly processor: BuiltInProcName.DefaultReadAllArgs;
40
+ readonly config: {};
43
41
  readonly assumePrimitive: true;
44
42
  }, {
45
43
  readonly type: "function";
46
44
  readonly names: ["t", "aperm"];
47
- readonly processor: BuiltInProcName.Default;
48
- readonly config: {
49
- readonly readAllArguments: true;
50
- };
45
+ readonly processor: BuiltInProcName.DefaultReadAllArgs;
46
+ readonly config: {};
51
47
  readonly assumePrimitive: false;
52
48
  }, {
53
49
  readonly type: "function";
@@ -112,8 +112,8 @@ exports.DefaultBuiltinConfig = [
112
112
  'pdf', 'jpeg', 'png', 'windows', 'postscript', 'xfig', 'bitmap', 'pictex', 'cairo_pdf', 'svg', 'bmp', 'tiff', 'X11', 'quartz',
113
113
  'jitter'
114
114
  ],
115
- processor: built_in_1.BuiltInProcName.Default,
116
- config: { readAllArguments: true },
115
+ processor: built_in_1.BuiltInProcName.DefaultReadAllArgs,
116
+ config: {},
117
117
  assumePrimitive: true
118
118
  },
119
119
  {
@@ -121,8 +121,8 @@ exports.DefaultBuiltinConfig = [
121
121
  names: [
122
122
  't', 'aperm' /* transpose function, permutation generation */
123
123
  ],
124
- processor: built_in_1.BuiltInProcName.Default,
125
- config: { readAllArguments: true },
124
+ processor: built_in_1.BuiltInProcName.DefaultReadAllArgs,
125
+ config: {},
126
126
  assumePrimitive: false
127
127
  },
128
128
  { type: 'function', names: ['rm'], processor: built_in_1.BuiltInProcName.Rm, config: {}, assumePrimitive: true },
@@ -371,6 +371,9 @@ function getDefaultProcessor(name) {
371
371
  }
372
372
  const fn = exports.DefaultBuiltinConfig.find(def => (def.names.includes(name) && def.type !== 'constant')
373
373
  || (def.type === 'replacement' && def.suffixes.flatMap(d => def.names.map(n => `${n}${d}`)).includes(name)));
374
- return fn?.type === 'replacement' ? built_in_1.BuiltInProcName.Replacement : fn?.processor;
374
+ if (fn?.type === 'replacement') {
375
+ return built_in_1.BuiltInProcName.Replacement;
376
+ }
377
+ return fn?.processor === built_in_1.BuiltInProcName.DefaultReadAllArgs ? built_in_1.BuiltInProcName.Default : fn?.processor;
375
378
  }
376
379
  //# sourceMappingURL=default-builtin-config.js.map
@@ -11,3 +11,11 @@ export declare function makeReferenceMaybe(ref: IdentifierReference, graph: Data
11
11
  * @see {@link makeReferenceMaybe}
12
12
  */
13
13
  export declare function makeAllMaybe(references: readonly IdentifierReference[] | undefined, graph: DataflowGraph, environments: REnvironmentInformation, includeDefs: boolean, applyCds?: ControlDependency[] | undefined): IdentifierReference[];
14
+ /**
15
+ * apply the given cds to all elements in the graph and also transform the given references similar to {@link makeAllMaybe}.
16
+ */
17
+ export declare function applyCdsToAllInGraphButConstants(graph: DataflowGraph, references: readonly IdentifierReference[], cds: readonly ControlDependency[]): void;
18
+ /**
19
+ * apply the given cds to all given references, but not to the graph. This is useful if we want to mark the references as maybe without marking all other nodes in the graph as maybe.
20
+ */
21
+ export declare function applyCdToReferences(references: readonly IdentifierReference[], cds: readonly ControlDependency[]): void;
@@ -2,16 +2,19 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.makeReferenceMaybe = makeReferenceMaybe;
4
4
  exports.makeAllMaybe = makeAllMaybe;
5
+ exports.applyCdsToAllInGraphButConstants = applyCdsToAllInGraphButConstants;
6
+ exports.applyCdToReferences = applyCdToReferences;
5
7
  const identifier_1 = require("./identifier");
6
8
  const resolve_by_name_1 = require("./resolve-by-name");
9
+ const vertex_1 = require("../graph/vertex");
7
10
  function appToCdsUnique(target, toAdd) {
8
11
  if (toAdd) {
9
- target.push(...toAdd.filter(c => !target.find(tc => tc.id === c.id && tc.when === c.when)));
12
+ target.push(...toAdd.filter(c => !target.some(tc => tc.id === c.id && tc.when === c.when)));
10
13
  }
11
14
  }
12
15
  function concatCdsUnique(target, toAdd) {
13
16
  if (toAdd) {
14
- return target.concat(toAdd.filter(c => !target.find(tc => tc.id === c.id && tc.when === c.when)));
17
+ return target.concat(toAdd.filter(c => !target.some(tc => tc.id === c.id && tc.when === c.when)));
15
18
  }
16
19
  else {
17
20
  return target;
@@ -58,6 +61,46 @@ function makeReferenceMaybe(ref, graph, environments, includeDefs, defaultCd = u
58
61
  * @see {@link makeReferenceMaybe}
59
62
  */
60
63
  function makeAllMaybe(references, graph, environments, includeDefs, applyCds = undefined) {
61
- return references?.map(ref => makeReferenceMaybe(ref, graph, environments, includeDefs, applyCds)) ?? [];
64
+ if (references === undefined || references.length === 0) {
65
+ return [];
66
+ }
67
+ return references.map(ref => makeReferenceMaybe(ref, graph, environments, includeDefs, applyCds));
68
+ }
69
+ /**
70
+ * apply the given cds to all elements in the graph and also transform the given references similar to {@link makeAllMaybe}.
71
+ */
72
+ function applyCdsToAllInGraphButConstants(graph, references, cds) {
73
+ for (const [, v] of graph.vertices(true)) {
74
+ if (v.tag === vertex_1.VertexType.Value) {
75
+ continue;
76
+ }
77
+ if (v.cds) {
78
+ appToCdsUnique(v.cds, cds);
79
+ }
80
+ else {
81
+ v.cds = Array.from(cds);
82
+ }
83
+ }
84
+ for (const ref of references) {
85
+ if (ref.cds) {
86
+ appToCdsUnique(ref.cds, cds);
87
+ }
88
+ else {
89
+ ref.cds = Array.from(cds);
90
+ }
91
+ }
92
+ }
93
+ /**
94
+ * apply the given cds to all given references, but not to the graph. This is useful if we want to mark the references as maybe without marking all other nodes in the graph as maybe.
95
+ */
96
+ function applyCdToReferences(references, cds) {
97
+ for (const ref of references) {
98
+ if (ref.cds) {
99
+ appToCdsUnique(ref.cds, cds);
100
+ }
101
+ else {
102
+ ref.cds = Array.from(cds);
103
+ }
104
+ }
62
105
  }
63
106
  //# sourceMappingURL=reference-to-maybe.js.map
@@ -1,6 +1,6 @@
1
1
  import { VariableResolve } from '../../../config';
2
2
  import type { AstIdMap, RNodeWithParent } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
3
- import { type NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
3
+ import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
4
4
  import { type REnvironmentInformation } from '../../environments/environment';
5
5
  import { Identifier } from '../../environments/identifier';
6
6
  import type { DataflowGraph } from '../../graph/graph';
@@ -58,7 +58,7 @@ export declare function getAliases(sourceIds: readonly NodeId[], dataflow: Dataf
58
58
  * @param ctx - Context used for clean environment
59
59
  * @param blocked - If set, the ids that should not be considered during resolution (=&gt;top)
60
60
  */
61
- export declare function resolveIdToValue(id: NodeId | RNodeWithParent | undefined, { environment, graph, idMap, full, resolve, ctx, blocked }: ResolveInfo): ResolveResult;
61
+ export declare function resolveIdToValue(id: NodeId | RNodeWithParent | undefined, { environment, graph, idMap, full, ctx, resolve, blocked }: ResolveInfo): ResolveResult;
62
62
  /**
63
63
  * Please use {@link resolveIdToValue}
64
64
  *
@@ -20,6 +20,7 @@ const general_1 = require("../values/general");
20
20
  const r_value_1 = require("../values/r-value");
21
21
  const set_constants_1 = require("../values/sets/set-constants");
22
22
  const resolve_1 = require("./resolve");
23
+ const model_1 = require("../../../r-bridge/lang-4.x/ast/model/model");
23
24
  const AliasHandler = {
24
25
  [vertex_1.VertexType.Value]: (sourceId) => [sourceId],
25
26
  [vertex_1.VertexType.Use]: getUseAlias,
@@ -119,8 +120,7 @@ function getAliases(sourceIds, dataflow, environment) {
119
120
  * @param ctx - Context used for clean environment
120
121
  * @param blocked - If set, the ids that should not be considered during resolution (=&gt;top)
121
122
  */
122
- function resolveIdToValue(id, { environment, graph, idMap, full = true, resolve, ctx, blocked }) {
123
- const variableResolve = resolve ?? ctx.config.solver.variables;
123
+ function resolveIdToValue(id, { environment, graph, idMap, full = true, ctx, resolve = ctx.config.solver.variables, blocked }) {
124
124
  blocked ??= new Set();
125
125
  if (id === undefined) {
126
126
  return r_value_1.Top;
@@ -134,13 +134,13 @@ function resolveIdToValue(id, { environment, graph, idMap, full = true, resolve,
134
134
  switch (node.type) {
135
135
  case type_1.RType.Argument:
136
136
  if (node.value) {
137
- return resolveIdToValue(node.value.info.id, { environment, graph, idMap, full, resolve: variableResolve, ctx, blocked });
137
+ return resolveIdToValue(node.value.info.id, { environment, graph, idMap, full, resolve, ctx, blocked });
138
138
  }
139
139
  // eslint-disable-next-line no-fallthrough
140
140
  case type_1.RType.Symbol:
141
141
  if (full) {
142
142
  if (environment) {
143
- return trackAliasInEnvironments(identifier_1.Identifier.toString(node.content), environment, { idMap, resolve: variableResolve, ctx, graph, blocked });
143
+ return trackAliasInEnvironments(identifier_1.Identifier.toString(node.content), environment, { idMap, resolve, ctx, graph, blocked });
144
144
  }
145
145
  else if (graph && resolve === config_1.VariableResolve.Alias) {
146
146
  return trackAliasesInGraph(node.info.id, graph, ctx, idMap);
@@ -153,7 +153,7 @@ function resolveIdToValue(id, { environment, graph, idMap, full = true, resolve,
153
153
  case type_1.RType.BinaryOp:
154
154
  case type_1.RType.UnaryOp:
155
155
  return (0, set_constants_1.setFrom)((0, resolve_1.resolveNode)({
156
- resolve: variableResolve, node, ctx, environment, graph, idMap, blocked
156
+ resolve, node, ctx, environment, graph, idMap, blocked
157
157
  }));
158
158
  case type_1.RType.String:
159
159
  case type_1.RType.Number:
@@ -293,7 +293,7 @@ function trackAliasesInGraph(id, graph, ctx, idMap) {
293
293
  if (target === undefined) {
294
294
  continue;
295
295
  }
296
- if (target.type === type_1.RType.WhileLoop || target.type === type_1.RType.RepeatLoop || target.type === type_1.RType.ForLoop) {
296
+ if (model_1.RLoopConstructs.is(target)) {
297
297
  forceTop = true;
298
298
  break;
299
299
  }
@@ -18,6 +18,7 @@ const vector_constants_1 = require("../values/vectors/vector-constants");
18
18
  const alias_tracking_1 = require("./alias-tracking");
19
19
  const scalar_constants_1 = require("../values/scalar/scalar-constants");
20
20
  const identifier_1 = require("../../environments/identifier");
21
+ const node_id_1 = require("../../../r-bridge/lang-4.x/ast/model/processing/node-id");
21
22
  /**
22
23
  * Helper function used by {@link resolveIdToValue}, please use that instead, if
23
24
  * you want to resolve the value of an identifier / node
@@ -27,32 +28,33 @@ const identifier_1 = require("../../environments/identifier");
27
28
  * @returns resolved value or top/bottom
28
29
  */
29
30
  function resolveNode({ resolve, node, ctx, blocked, environment, graph, idMap }) {
30
- if (node.type === type_1.RType.String) {
31
+ const nt = node.type;
32
+ if (nt === type_1.RType.String) {
31
33
  return (0, string_constants_1.stringFrom)(node.content.str);
32
34
  }
33
- else if (node.type === type_1.RType.Number) {
35
+ else if (nt === type_1.RType.Number) {
34
36
  return (0, interval_constants_1.intervalFrom)(node.content.num, node.content.num);
35
37
  }
36
- else if (node.type === type_1.RType.Logical) {
38
+ else if (nt === type_1.RType.Logical) {
37
39
  return node.content.valueOf() ? logical_constants_1.ValueLogicalTrue : logical_constants_1.ValueLogicalFalse;
38
40
  }
39
- else if (node.type === type_1.RType.FunctionDefinition) {
41
+ else if (nt === type_1.RType.FunctionDefinition) {
40
42
  return { type: 'function-definition' };
41
43
  }
42
- else if ((node.type === type_1.RType.FunctionCall || node.type === type_1.RType.BinaryOp || node.type === type_1.RType.UnaryOp) && graph) {
44
+ else if ((nt === type_1.RType.FunctionCall || nt === type_1.RType.BinaryOp || nt === type_1.RType.UnaryOp) && graph) {
43
45
  const origin = (0, dfg_get_origin_1.getOriginInDfg)(graph, node.info.id)?.[0];
44
46
  if (origin === undefined || origin.type !== 3 /* OriginType.BuiltInFunctionOrigin */) {
45
47
  return r_value_2.Top;
46
48
  }
47
49
  let builtInName;
48
- if ((0, built_in_1.isBuiltIn)(origin.proc)) {
50
+ if (node_id_1.NodeId.isBuiltIn(origin.proc)) {
49
51
  builtInName = origin.proc;
50
52
  }
51
- else if (node.type === type_1.RType.FunctionCall && node.named) {
52
- builtInName = (0, built_in_1.builtInId)(identifier_1.Identifier.getName(node.functionName.content));
53
+ else if (nt === type_1.RType.FunctionCall && node.named) {
54
+ builtInName = node_id_1.NodeId.toBuiltIn(identifier_1.Identifier.getName(node.functionName.content));
53
55
  }
54
- else if (node.type === type_1.RType.BinaryOp || node.type === type_1.RType.UnaryOp) {
55
- builtInName = (0, built_in_1.builtInId)(node.operator);
56
+ else if (nt === type_1.RType.BinaryOp || nt === type_1.RType.UnaryOp) {
57
+ builtInName = node_id_1.NodeId.toBuiltIn(node.operator);
56
58
  }
57
59
  else {
58
60
  return r_value_2.Top;
@@ -1,4 +1,4 @@
1
- import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
1
+ import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
2
2
  import type { CallGraph } from '../graph/call-graph';
3
3
  import type { ControlDependency } from '../info';
4
4
  export interface ExceptionPoint {
@@ -1,6 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.calculateExceptionsOfFunction = calculateExceptionsOfFunction;
4
+ const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
4
5
  const vertex_1 = require("../graph/vertex");
5
6
  const built_in_1 = require("../environments/built-in");
6
7
  const CatchHandlers = new Set([built_in_1.BuiltInProcName.Try]);
@@ -35,7 +36,7 @@ function calculateExceptionsOfFunction(id, graph, knownThrower = {}) {
35
36
  if (!vtx) {
36
37
  continue;
37
38
  }
38
- if ((0, built_in_1.isBuiltIn)(currentId)) {
39
+ if (node_id_1.NodeId.isBuiltIn(currentId)) {
39
40
  continue;
40
41
  }
41
42
  if (vtx.tag === vertex_1.VertexType.FunctionDefinition) {
@@ -1,6 +1,6 @@
1
1
  import { DataflowGraph } from './graph';
2
2
  import type { DataflowGraphVertexFunctionCall, DataflowGraphVertexFunctionDefinition } from './vertex';
3
- import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
3
+ import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
4
4
  import { DefaultMap } from '../../util/collections/defaultmap';
5
5
  /**
6
6
  * A call graph is a dataflow graph where all vertices are function calls.
@@ -6,6 +6,7 @@ exports.dropTransitiveEdges = dropTransitiveEdges;
6
6
  exports.computeCallGraph = computeCallGraph;
7
7
  const graph_1 = require("./graph");
8
8
  const vertex_1 = require("./vertex");
9
+ const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
9
10
  const linker_1 = require("../internal/linker");
10
11
  const edge_1 = require("./edge");
11
12
  const built_in_1 = require("../environments/built-in");
@@ -176,7 +177,7 @@ function processCall(vtx, from, graph, result, state) {
176
177
  let addedTarget = false;
177
178
  let addedBiTarget = false;
178
179
  for (const tar of tars) {
179
- if ((0, built_in_1.isBuiltIn)(tar)) {
180
+ if (node_id_1.NodeId.isBuiltIn(tar)) {
180
181
  result.addEdge(vid, tar, edge_1.EdgeType.Calls);
181
182
  addedTarget = true;
182
183
  addedBiTarget = true;
@@ -193,7 +194,7 @@ function processCall(vtx, from, graph, result, state) {
193
194
  for (const origs of vtx.origin) {
194
195
  if (origs.startsWith('builtin:')) {
195
196
  addedTarget = true;
196
- result.addEdge(vid, (0, built_in_1.builtInId)(origs.substring('builtin:'.length)), edge_1.EdgeType.Calls);
197
+ result.addEdge(vid, node_id_1.NodeId.toBuiltIn(origs.substring('builtin:'.length)), edge_1.EdgeType.Calls);
197
198
  }
198
199
  }
199
200
  }
@@ -237,7 +238,7 @@ function processUnknown(vtx, from, graph, result, state) {
237
238
  return;
238
239
  case vertex_1.VertexType.FunctionDefinition:
239
240
  if (from) {
240
- result.addEdge(from, (0, built_in_1.builtInId)('function'), edge_1.EdgeType.Calls);
241
+ result.addEdge(from, node_id_1.NodeId.toBuiltIn('function'), edge_1.EdgeType.Calls);
241
242
  }
242
243
  return;
243
244
  default:
@@ -1,4 +1,4 @@
1
- import { type NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
1
+ import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
2
2
  import type { AstIdMap } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
3
3
  import { type DataflowFunctionFlowInformation, DataflowGraph, FunctionArgument } from './graph';
4
4
  import { type IEnvironment, type REnvironmentInformation } from '../environments/environment';
@@ -48,21 +48,21 @@ class DataflowGraphBuilder extends graph_1.DataflowGraph {
48
48
  defineFunction(id, exitPoints, subflow, info, asRoot = true) {
49
49
  return this.addVertexWithDefaultEnv({
50
50
  tag: vertex_1.VertexType.FunctionDefinition,
51
- id: (0, node_id_1.normalizeIdToNumberIfPossible)(id),
51
+ id: node_id_1.NodeId.normalize(id),
52
52
  params: Object.fromEntries(info?.readParams ?? []),
53
53
  subflow: {
54
54
  ...subflow,
55
- entryPoint: (0, node_id_1.normalizeIdToNumberIfPossible)(subflow.entryPoint),
56
- graph: new Set([...subflow.graph].map(node_id_1.normalizeIdToNumberIfPossible)),
57
- out: subflow.out.map(o => ({ ...o, nodeId: (0, node_id_1.normalizeIdToNumberIfPossible)(o.nodeId), cds: o.cds?.map(c => ({ ...c, id: (0, node_id_1.normalizeIdToNumberIfPossible)(c.id) })) })),
58
- in: subflow.in.map(o => ({ ...o, nodeId: (0, node_id_1.normalizeIdToNumberIfPossible)(o.nodeId), cds: o.cds?.map(c => ({ ...c, id: (0, node_id_1.normalizeIdToNumberIfPossible)(c.id) })) })),
59
- unknownReferences: subflow.unknownReferences.map(o => ({ ...o, nodeId: (0, node_id_1.normalizeIdToNumberIfPossible)(o.nodeId), cds: o.cds?.map(c => ({ ...c, id: (0, node_id_1.normalizeIdToNumberIfPossible)(c.id) })) })),
55
+ entryPoint: node_id_1.NodeId.normalize(subflow.entryPoint),
56
+ graph: new Set([...subflow.graph].map(node_id_1.NodeId.normalize)),
57
+ out: subflow.out.map(o => ({ ...o, nodeId: node_id_1.NodeId.normalize(o.nodeId), cds: o.cds?.map(c => ({ ...c, id: node_id_1.NodeId.normalize(c.id) })) })),
58
+ in: subflow.in.map(o => ({ ...o, nodeId: node_id_1.NodeId.normalize(o.nodeId), cds: o.cds?.map(c => ({ ...c, id: node_id_1.NodeId.normalize(c.id) })) })),
59
+ unknownReferences: subflow.unknownReferences.map(o => ({ ...o, nodeId: node_id_1.NodeId.normalize(o.nodeId), cds: o.cds?.map(c => ({ ...c, id: node_id_1.NodeId.normalize(c.id) })) })),
60
60
  hooks: subflow.hooks ?? [],
61
61
  },
62
62
  mode: info?.mode,
63
- exitPoints: exitPoints.map(e => typeof e === 'object' ? ({ ...e, nodeId: (0, node_id_1.normalizeIdToNumberIfPossible)(e.nodeId), cds: e.cds?.map(c => ({ ...c, id: (0, node_id_1.normalizeIdToNumberIfPossible)(c.id) })) }) :
64
- ({ nodeId: (0, node_id_1.normalizeIdToNumberIfPossible)(e), type: 0 /* ExitPointType.Default */, cds: undefined })),
65
- cds: info?.cds?.map(c => ({ ...c, id: (0, node_id_1.normalizeIdToNumberIfPossible)(c.id) })),
63
+ exitPoints: exitPoints.map(e => typeof e === 'object' ? ({ ...e, nodeId: node_id_1.NodeId.normalize(e.nodeId), cds: e.cds?.map(c => ({ ...c, id: node_id_1.NodeId.normalize(c.id) })) }) :
64
+ ({ nodeId: node_id_1.NodeId.normalize(e), type: 0 /* ExitPointType.Default */, cds: undefined })),
65
+ cds: info?.cds?.map(c => ({ ...c, id: node_id_1.NodeId.normalize(c.id) })),
66
66
  environment: info?.environment,
67
67
  }, asRoot);
68
68
  }
@@ -76,14 +76,14 @@ class DataflowGraphBuilder extends graph_1.DataflowGraph {
76
76
  * (i.e., be a valid entry point), or is it nested (e.g., as part of a function definition)
77
77
  */
78
78
  call(id, name, args, info, asRoot = true) {
79
- const onlyBuiltInAuto = info?.reads?.length === 1 && (0, built_in_1.isBuiltIn)(info?.reads[0]);
79
+ const onlyBuiltInAuto = info?.reads?.length === 1 && node_id_1.NodeId.isBuiltIn(info?.reads[0]);
80
80
  this.addVertexWithDefaultEnv({
81
81
  tag: vertex_1.VertexType.FunctionCall,
82
- id: (0, node_id_1.normalizeIdToNumberIfPossible)(id),
82
+ id: node_id_1.NodeId.normalize(id),
83
83
  name,
84
- args: args.map(a => a === r_function_call_1.EmptyArgument ? r_function_call_1.EmptyArgument : { ...a, nodeId: (0, node_id_1.normalizeIdToNumberIfPossible)(a.nodeId), cds: undefined }),
84
+ args: args.map(a => a === r_function_call_1.EmptyArgument ? r_function_call_1.EmptyArgument : { ...a, nodeId: node_id_1.NodeId.normalize(a.nodeId), cds: undefined }),
85
85
  environment: (info?.onlyBuiltIn || onlyBuiltInAuto) ? undefined : info?.environment ?? this.defaultEnvironment,
86
- cds: info?.cds?.map(c => ({ ...c, id: (0, node_id_1.normalizeIdToNumberIfPossible)(c.id) })),
86
+ cds: info?.cds?.map(c => ({ ...c, id: node_id_1.NodeId.normalize(c.id) })),
87
87
  onlyBuiltin: info?.onlyBuiltIn ?? onlyBuiltInAuto ?? false,
88
88
  origin: info?.origin ?? [(0, default_builtin_config_1.getDefaultProcessor)(name) ?? built_in_1.BuiltInProcName.Function],
89
89
  link: info?.link
@@ -133,9 +133,9 @@ class DataflowGraphBuilder extends graph_1.DataflowGraph {
133
133
  defineVariable(id, name, info, asRoot = true) {
134
134
  this.addVertexWithDefaultEnv({
135
135
  tag: vertex_1.VertexType.VariableDefinition,
136
- id: (0, node_id_1.normalizeIdToNumberIfPossible)(id),
136
+ id: node_id_1.NodeId.normalize(id),
137
137
  name,
138
- cds: info?.cds?.map(c => ({ ...c, id: (0, node_id_1.normalizeIdToNumberIfPossible)(c.id) })),
138
+ cds: info?.cds?.map(c => ({ ...c, id: node_id_1.NodeId.normalize(c.id) })),
139
139
  }, asRoot);
140
140
  if (info?.definedBy) {
141
141
  for (const def of info.definedBy) {
@@ -155,13 +155,13 @@ class DataflowGraphBuilder extends graph_1.DataflowGraph {
155
155
  use(id, name, info, asRoot = true) {
156
156
  return this.addVertexWithDefaultEnv((0, objects_1.deepMergeObject)({
157
157
  tag: vertex_1.VertexType.Use,
158
- id: (0, node_id_1.normalizeIdToNumberIfPossible)(id),
158
+ id: node_id_1.NodeId.normalize(id),
159
159
  name,
160
160
  cds: undefined,
161
161
  environment: undefined
162
162
  }, {
163
163
  ...info,
164
- cds: info?.cds?.map(c => ({ ...c, id: (0, node_id_1.normalizeIdToNumberIfPossible)(c.id) }))
164
+ cds: info?.cds?.map(c => ({ ...c, id: node_id_1.NodeId.normalize(c.id) }))
165
165
  }), asRoot);
166
166
  }
167
167
  /**
@@ -174,8 +174,8 @@ class DataflowGraphBuilder extends graph_1.DataflowGraph {
174
174
  constant(id, options, asRoot = true) {
175
175
  return this.addVertexWithDefaultEnv({
176
176
  tag: vertex_1.VertexType.Value,
177
- id: (0, node_id_1.normalizeIdToNumberIfPossible)(id),
178
- cds: options?.cds?.map(c => ({ ...c, id: (0, node_id_1.normalizeIdToNumberIfPossible)(c.id) })),
177
+ id: node_id_1.NodeId.normalize(id),
178
+ cds: options?.cds?.map(c => ({ ...c, id: node_id_1.NodeId.normalize(c.id) })),
179
179
  environment: undefined
180
180
  }, asRoot);
181
181
  }
@@ -186,7 +186,7 @@ class DataflowGraphBuilder extends graph_1.DataflowGraph {
186
186
  }
187
187
  return this;
188
188
  }
189
- return this.addEdge((0, node_id_1.normalizeIdToNumberIfPossible)(from), (0, node_id_1.normalizeIdToNumberIfPossible)(to), type);
189
+ return this.addEdge(node_id_1.NodeId.normalize(from), node_id_1.NodeId.normalize(to), type);
190
190
  }
191
191
  async queryHelper(from, to, data, type) {
192
192
  let fromId;
@@ -344,7 +344,7 @@ class DataflowGraphBuilder extends graph_1.DataflowGraph {
344
344
  * this is just an easier variant in case you working with a lot of functions this saves you a lot of `false` flags.
345
345
  */
346
346
  overwriteRootIds(ids) {
347
- this.rootVertices = new Set(ids.map(node_id_1.normalizeIdToNumberIfPossible));
347
+ this.rootVertices = new Set(ids.map(node_id_1.NodeId.normalize));
348
348
  return this;
349
349
  }
350
350
  }
@@ -3,7 +3,7 @@ import type { DataflowInformation } from '../info';
3
3
  import { type DataflowGraphVertexArgument, type DataflowGraphVertexFunctionCall, type DataflowGraphVertexInfo } from './vertex';
4
4
  import { EmptyArgument } from '../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
5
5
  import type { BrandedIdentifier, IdentifierDefinition, IdentifierReference } from '../environments/identifier';
6
- import { type NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
6
+ import { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
7
7
  import { type REnvironmentInformation } from '../environments/environment';
8
8
  import type { AstIdMap } from '../../r-bridge/lang-4.x/ast/model/processing/decorate';
9
9
  import type { LinkTo } from '../../queries/catalog/call-context-query/call-context-query-format';
@@ -88,12 +88,12 @@ export declare const FunctionArgument: {
88
88
  * ```
89
89
  * @see {@link isNotEmpty}
90
90
  */
91
- readonly isEmpty: (this: void, arg: FunctionArgument) => arg is typeof EmptyArgument;
91
+ readonly isEmpty: (this: void, arg: unknown) => arg is typeof EmptyArgument;
92
92
  /**
93
93
  * Checks whether the given argument is not an empty argument.
94
- * @see {@link isEmpty}
94
+ * @see {@link FunctionArgument.isEmpty}
95
95
  */
96
- readonly isNotEmpty: (this: void, arg: FunctionArgument) => arg is NamedFunctionArgument | PositionalFunctionArgument;
96
+ readonly isNotEmpty: <T>(this: void, arg: T) => arg is Exclude<T, typeof EmptyArgument>;
97
97
  /**
98
98
  * Returns the reference of a non-empty argument.
99
99
  * @example
@@ -262,7 +262,7 @@ export declare class DataflowGraph<Vertex extends DataflowGraphVertexInfo = Data
262
262
  */
263
263
  updateToFunctionCall(info: DataflowGraphVertexFunctionCall): void;
264
264
  /** If you do not pass the `to` node, this will just mark the node as maybe */
265
- addControlDependency(from: NodeId, to?: NodeId, when?: boolean): this;
265
+ addControlDependency(from: NodeId, to: NodeId, when?: boolean): this;
266
266
  /** Marks the given node as having unknown side effects */
267
267
  markIdForUnknownSideEffects(id: NodeId, target?: LinkTo<RegExp | string>): this;
268
268
  /**