@eagleoutice/flowr 2.9.14 → 2.10.2

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 (214) hide show
  1. package/README.md +52 -29
  2. package/abstract-interpretation/absint-visitor.d.ts +13 -8
  3. package/abstract-interpretation/absint-visitor.js +35 -26
  4. package/abstract-interpretation/data-frame/dataframe-domain.d.ts +1 -2
  5. package/abstract-interpretation/data-frame/dataframe-domain.js +14 -15
  6. package/abstract-interpretation/data-frame/mappers/access-mapper.js +2 -15
  7. package/abstract-interpretation/data-frame/mappers/arguments.d.ts +11 -17
  8. package/abstract-interpretation/data-frame/mappers/arguments.js +18 -18
  9. package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +41 -15
  10. package/abstract-interpretation/data-frame/mappers/function-mapper.js +74 -48
  11. package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -1
  12. package/abstract-interpretation/data-frame/semantics.d.ts +1 -1
  13. package/abstract-interpretation/data-frame/semantics.js +31 -35
  14. package/abstract-interpretation/data-frame/shape-inference.js +1 -1
  15. package/abstract-interpretation/domains/interval-domain.d.ts +1 -0
  16. package/abstract-interpretation/domains/interval-domain.js +3 -0
  17. package/abstract-interpretation/domains/product-domain.d.ts +9 -0
  18. package/abstract-interpretation/domains/product-domain.js +26 -6
  19. package/abstract-interpretation/domains/state-abstract-domain.d.ts +36 -22
  20. package/abstract-interpretation/domains/state-abstract-domain.js +169 -62
  21. package/abstract-interpretation/unsupported-functions.d.ts +10 -0
  22. package/abstract-interpretation/unsupported-functions.js +45 -0
  23. package/benchmark/slicer.js +10 -13
  24. package/benchmark/stats/stats.d.ts +2 -2
  25. package/cli/flowr.js +1 -1
  26. package/cli/repl/parser/slice-query-parser.d.ts +2 -2
  27. package/config.d.ts +4 -0
  28. package/config.js +5 -3
  29. package/control-flow/control-flow-graph.js +13 -9
  30. package/control-flow/semantic-cfg-guided-visitor.d.ts +6 -0
  31. package/control-flow/semantic-cfg-guided-visitor.js +6 -0
  32. package/dataflow/environments/built-in-proc-name.d.ts +6 -0
  33. package/dataflow/environments/built-in-proc-name.js +6 -0
  34. package/dataflow/environments/built-in.d.ts +7 -5
  35. package/dataflow/environments/built-in.js +2 -0
  36. package/dataflow/environments/default-builtin-config.d.ts +442 -6
  37. package/dataflow/environments/default-builtin-config.js +158 -3
  38. package/dataflow/environments/identifier.d.ts +4 -0
  39. package/dataflow/environments/identifier.js +17 -0
  40. package/dataflow/environments/overwrite.js +2 -5
  41. package/dataflow/graph/call-graph.d.ts +4 -7
  42. package/dataflow/graph/call-graph.js +0 -22
  43. package/dataflow/graph/df-helper.d.ts +23 -12
  44. package/dataflow/graph/df-helper.js +44 -7
  45. package/dataflow/graph/graph-helper.d.ts +9 -4
  46. package/dataflow/graph/graph-helper.js +26 -3
  47. package/dataflow/graph/graph.d.ts +23 -2
  48. package/dataflow/graph/graph.js +38 -4
  49. package/dataflow/graph/vertex.d.ts +2 -0
  50. package/dataflow/instrument/instrument-dataflow-count.d.ts +10 -0
  51. package/dataflow/instrument/instrument-dataflow-count.js +10 -0
  52. package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +4 -4
  53. package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +3 -3
  54. package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +2 -2
  55. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -0
  56. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -3
  57. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +1 -1
  58. package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +2 -2
  59. package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +2 -2
  60. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.d.ts +2 -2
  61. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +1 -1
  62. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -2
  63. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +8 -19
  64. package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +2 -2
  65. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +2 -2
  66. package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +2 -2
  67. package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +2 -2
  68. package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +2 -2
  69. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.d.ts +23 -3
  70. package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +80 -12
  71. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +41 -0
  72. package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +179 -0
  73. package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +7 -4
  74. package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +62 -1
  75. package/dataflow/internal/process/functions/call/built-in/built-in-recall.d.ts +7 -2
  76. package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +15 -1
  77. package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.d.ts +2 -2
  78. package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +2 -2
  79. package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -2
  80. package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -2
  81. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.d.ts +2 -2
  82. package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +2 -2
  83. package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +2 -2
  84. package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -2
  85. package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +2 -2
  86. package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.d.ts +2 -2
  87. package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +2 -2
  88. package/dataflow/internal/process/functions/call/built-in/built-in-vector.d.ts +2 -2
  89. package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +2 -2
  90. package/dataflow/internal/process/functions/call/common.d.ts +2 -2
  91. package/dataflow/internal/process/functions/call/common.js +6 -4
  92. package/dataflow/internal/process/functions/call/known-call-handling.d.ts +2 -2
  93. package/dataflow/internal/process/functions/call/named-call-handling.d.ts +2 -2
  94. package/dataflow/internal/process/functions/process-parameter.js +1 -1
  95. package/documentation/doc-readme.js +2 -1
  96. package/documentation/wiki-absint.js +6 -5
  97. package/documentation/wiki-analyzer.js +0 -2
  98. package/documentation/wiki-linter.js +6 -0
  99. package/documentation/wiki-normalized-ast.js +7 -7
  100. package/linter/linter-rules.d.ts +49 -1
  101. package/linter/linter-rules.js +5 -1
  102. package/linter/rules/dataframe-access-validation.d.ts +1 -1
  103. package/linter/rules/dataframe-access-validation.js +3 -4
  104. package/linter/rules/problematic-eval.d.ts +44 -0
  105. package/linter/rules/problematic-eval.js +83 -0
  106. package/linter/rules/roxygen-arguments.d.ts +35 -0
  107. package/linter/rules/roxygen-arguments.js +100 -0
  108. package/package.json +8 -9
  109. package/project/context/flowr-analyzer-context.d.ts +1 -8
  110. package/project/context/flowr-analyzer-context.js +1 -7
  111. package/project/context/flowr-analyzer-environment-context.d.ts +5 -0
  112. package/project/context/flowr-analyzer-environment-context.js +6 -0
  113. package/project/context/flowr-analyzer-files-context.d.ts +6 -0
  114. package/project/context/flowr-analyzer-files-context.js +4 -2
  115. package/project/flowr-analyzer-builder.js +1 -4
  116. package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
  117. package/queries/catalog/call-context-query/call-context-query-executor.js +10 -5
  118. package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
  119. package/queries/catalog/dependencies-query/function-info/library-functions.js +2 -0
  120. package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -1
  121. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +3 -3
  122. package/queries/catalog/df-shape-query/df-shape-query-format.js +7 -2
  123. package/queries/catalog/does-call-query/does-call-query-executor.js +1 -1
  124. package/queries/catalog/does-call-query/does-call-query-format.d.ts +2 -2
  125. package/queries/catalog/files-query/files-query-executor.js +0 -1
  126. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
  127. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +3 -3
  128. package/queries/catalog/input-sources-query/input-sources-query-executor.d.ts +6 -0
  129. package/queries/catalog/input-sources-query/input-sources-query-executor.js +66 -0
  130. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +36 -0
  131. package/queries/catalog/input-sources-query/input-sources-query-format.js +63 -0
  132. package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +92 -0
  133. package/queries/catalog/input-sources-query/simple-input-classifier.js +310 -0
  134. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +2 -2
  135. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
  136. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
  137. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -1
  138. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -2
  139. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -2
  140. package/queries/catalog/location-map-query/location-map-query-executor.js +1 -1
  141. package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -2
  142. package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
  143. package/queries/catalog/origin-query/origin-query-executor.js +1 -1
  144. package/queries/catalog/origin-query/origin-query-format.d.ts +3 -3
  145. package/queries/catalog/provenance-query/provenance-query-executor.d.ts +1 -4
  146. package/queries/catalog/provenance-query/provenance-query-executor.js +3 -6
  147. package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -2
  148. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +1 -1
  149. package/queries/query.d.ts +9 -1
  150. package/queries/query.js +2 -0
  151. package/r-bridge/data/data.d.ts +2 -2
  152. package/r-bridge/data/data.js +2 -2
  153. package/r-bridge/lang-4.x/ast/model/model.d.ts +3 -0
  154. package/r-bridge/lang-4.x/ast/model/model.js +3 -0
  155. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +16 -1
  156. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +2 -0
  157. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +29 -6
  158. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +16 -2
  159. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +16 -1
  160. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +2 -0
  161. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +15 -0
  162. package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +2 -0
  163. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +15 -0
  164. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +2 -0
  165. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +16 -1
  166. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +2 -0
  167. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +16 -1
  168. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +2 -0
  169. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +19 -4
  170. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +2 -0
  171. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +21 -0
  172. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +16 -0
  173. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +16 -1
  174. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +2 -0
  175. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +16 -1
  176. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +2 -0
  177. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +16 -1
  178. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +2 -0
  179. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +16 -1
  180. package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +2 -0
  181. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +16 -1
  182. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +2 -0
  183. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +16 -1
  184. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +2 -0
  185. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +25 -1
  186. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +15 -0
  187. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +16 -1
  188. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +2 -0
  189. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +16 -1
  190. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +2 -0
  191. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +16 -1
  192. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +2 -0
  193. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +16 -1
  194. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +2 -0
  195. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +16 -1
  196. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +2 -0
  197. package/r-bridge/lang-4.x/ast/model/versions.d.ts +2 -0
  198. package/r-bridge/lang-4.x/ast/model/versions.js +3 -1
  199. package/r-bridge/roxygen2/documentation-provider.js +15 -6
  200. package/r-bridge/roxygen2/roxygen-ast.d.ts +3 -1
  201. package/search/flowr-search-builder.js +3 -2
  202. package/search/search-executor/search-generators.js +1 -1
  203. package/slicing/criterion/parse.d.ts +11 -10
  204. package/slicing/criterion/parse.js +9 -8
  205. package/slicing/static/static-slicer.js +24 -1
  206. package/util/collections/arrays.d.ts +4 -0
  207. package/util/collections/arrays.js +7 -0
  208. package/util/mermaid/ast.js +2 -1
  209. package/util/mermaid/dfg.js +2 -1
  210. package/util/record.d.ts +23 -0
  211. package/util/record.js +33 -0
  212. package/util/version.js +1 -1
  213. package/abstract-interpretation/domains/mapped-abstract-domain.d.ts +0 -41
  214. package/abstract-interpretation/domains/mapped-abstract-domain.js +0 -213
@@ -1,4 +1,5 @@
1
- import type { RAstNodeBase, Location, NoInfo, RNode } from '../model';
1
+ import type { RAstNodeBase, Location, NoInfo } from '../model';
2
+ import { RNode } from '../model';
2
3
  import { RType } from '../type';
3
4
  import type { RExpressionList } from './r-expression-list';
4
5
  /**
@@ -20,4 +21,18 @@ export declare const RWhileLoop: {
20
21
  * Type guard for {@link RWhileLoop} nodes.
21
22
  */
22
23
  readonly is: <Info = object>(this: void, node: RNode<Info> | undefined) => node is RWhileLoop<Info>;
24
+ readonly getLocation: (this: void, node: RNode) => import("../../../../../util/range").SourceLocation | undefined;
25
+ readonly getId: (this: void, node: RNode<import("../processing/decorate").ParentInformation>) => import("../processing/node-id").NodeId;
26
+ readonly getType: (this: void, node: RNode) => RType;
27
+ readonly visitAst: <OtherInfo = object>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo>>, onVisit?: import("../processing/visitor").OnEnter<OtherInfo>, onExit?: import("../processing/visitor").OnExit<OtherInfo>) => void;
28
+ readonly collectAllIds: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Set<import("../processing/node-id").NodeId>;
29
+ readonly directChildren: <OtherInfo>(this: void, node: RNode<OtherInfo>) => readonly (RNode<OtherInfo> | typeof import("./r-function-call").EmptyArgument)[];
30
+ readonly directParent: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined;
31
+ readonly iterateParents: <OtherInfo>(this: void, node: RNode<OtherInfo & import("../processing/decorate").ParentInformation> | undefined, idMap: Map<import("../processing/node-id").NodeId, RNode<OtherInfo & import("../processing/decorate").ParentInformation>>) => Generator<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>;
32
+ readonly depth: (this: void, node: RNode<import("../processing/decorate").ParentInformation>, idMap: Map<import("../processing/node-id").NodeId, RNode<import("../processing/decorate").ParentInformation>>) => number;
33
+ readonly collectAllIdsWithStop: <OtherInfo>(this: void, nodes: import("../../../../../abstract-interpretation/normalized-ast-fold").SingleOrArrayOrNothing<RNode<OtherInfo & import("../processing/decorate").ParentInformation>>, stop: (node: RNode<OtherInfo & import("../processing/decorate").ParentInformation>) => boolean) => Set<import("../processing/node-id").NodeId>;
34
+ readonly lexeme: <R extends RNode<import("../processing/decorate").ParentInformation>>(this: void, node: R | undefined) => R extends {
35
+ lexeme: string;
36
+ } ? string : string | undefined;
37
+ readonly documentation: typeof import("../../../../roxygen2/documentation-provider").getDocumentationOf;
23
38
  };
@@ -1,11 +1,13 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RWhileLoop = void 0;
4
+ const model_1 = require("../model");
4
5
  const type_1 = require("../type");
5
6
  /**
6
7
  * Helper for working with {@link RWhileLoop} AST nodes.
7
8
  */
8
9
  exports.RWhileLoop = {
10
+ ...model_1.RNode,
9
11
  name: 'RWhileLoop',
10
12
  /**
11
13
  * Type guard for {@link RWhileLoop} nodes.
@@ -4,5 +4,7 @@
4
4
  */
5
5
  export declare const MIN_VERSION_PIPE = "4.1.0";
6
6
  export declare const MIN_VERSION_LAMBDA = "4.1.0";
7
+ export declare const MIN_VERSION_PIPE_PLACEHOLDER = "4.2.0";
8
+ export declare const MIN_VERSION_PIPE_PLACEHOLDER_EXTRACT = "4.3.0";
7
9
  /** between 4.0.0 and (i think) 4.1.0 the parser handled them differently. We ignore that for now. */
8
10
  export declare const MIN_VERSION_RAW_STABLE = "4.1.0";
@@ -4,9 +4,11 @@
4
4
  * @module
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.MIN_VERSION_RAW_STABLE = exports.MIN_VERSION_LAMBDA = exports.MIN_VERSION_PIPE = void 0;
7
+ exports.MIN_VERSION_RAW_STABLE = exports.MIN_VERSION_PIPE_PLACEHOLDER_EXTRACT = exports.MIN_VERSION_PIPE_PLACEHOLDER = exports.MIN_VERSION_LAMBDA = exports.MIN_VERSION_PIPE = void 0;
8
8
  exports.MIN_VERSION_PIPE = '4.1.0';
9
9
  exports.MIN_VERSION_LAMBDA = '4.1.0';
10
+ exports.MIN_VERSION_PIPE_PLACEHOLDER = '4.2.0';
11
+ exports.MIN_VERSION_PIPE_PLACEHOLDER_EXTRACT = '4.3.0';
10
12
  /** between 4.0.0 and (i think) 4.1.0 the parser handled them differently. We ignore that for now. */
11
13
  exports.MIN_VERSION_RAW_STABLE = '4.1.0';
12
14
  //# sourceMappingURL=versions.js.map
@@ -85,30 +85,39 @@ function getDocumentationOfByName(name, idMap) {
85
85
  return getDocumentationOf(node.info.id, idMap);
86
86
  }
87
87
  }
88
- function filterDocumentationForParams(doc, filter) {
88
+ function filterDocumentationForParamsInherited(doc, filter) {
89
89
  if (!doc) {
90
90
  return doc;
91
91
  }
92
92
  if (Array.isArray(doc)) {
93
- return doc.filter(filter);
93
+ const ds = doc.filter(filter);
94
+ for (const d of ds) {
95
+ d.inherited = true;
96
+ }
97
+ return ds;
94
98
  }
95
99
  else {
96
- return filter(doc) ? doc : undefined;
100
+ const d = doc;
101
+ if (filter(d)) {
102
+ d.inherited = true;
103
+ return d;
104
+ }
105
+ return undefined;
97
106
  }
98
107
  }
99
108
  function expandInheritOfTag(tag, otherTags, idMap) {
100
109
  if (tag.type === roxygen_ast_1.KnownRoxygenTags.Inherit) {
101
110
  const inheritDoc = getDocumentationOfByName(tag.value.source, idMap);
102
- return filterDocumentationForParams(inheritDoc, t => tag.value.components.includes(t.type));
111
+ return filterDocumentationForParamsInherited(inheritDoc, t => tag.value.components.includes(t.type));
103
112
  }
104
113
  else if (tag.type === roxygen_ast_1.KnownRoxygenTags.InheritDotParams) {
105
114
  const inheritDoc = getDocumentationOfByName(tag.value.source, idMap);
106
- return filterDocumentationForParams(inheritDoc, t => t.type === roxygen_ast_1.KnownRoxygenTags.Param && t.value.name === '...');
115
+ return filterDocumentationForParamsInherited(inheritDoc, t => t.type === roxygen_ast_1.KnownRoxygenTags.Param && t.value.name === '...');
107
116
  }
108
117
  else if (tag.type === roxygen_ast_1.KnownRoxygenTags.InheritParams) {
109
118
  const inheritDoc = getDocumentationOfByName(tag.value, idMap);
110
119
  const alreadyExplainedParams = new Set(otherTags.filter(t => t.type === roxygen_ast_1.KnownRoxygenTags.Param).map(t => t.value.name));
111
- return filterDocumentationForParams(inheritDoc, t => t.type === roxygen_ast_1.KnownRoxygenTags.Param && !alreadyExplainedParams.has(t.value.name));
120
+ return filterDocumentationForParamsInherited(inheritDoc, t => t.type === roxygen_ast_1.KnownRoxygenTags.Param && !alreadyExplainedParams.has(t.value.name));
112
121
  }
113
122
  return tag;
114
123
  }
@@ -196,7 +196,9 @@ export type RoxygenOtherTag = RoxygenTagAuthor | RoxygenUnknownTag | RoxygenDocT
196
196
  /**
197
197
  * All known Roxygen tag types.
198
198
  */
199
- export type RoxygenTag = RoxygenCrossrefTag | RoxygenNamespaceTag | RoxygenFormattingTag | RoxygenDatasetDocumentationTag | RoxygenFunctionDocumentationTag | RoxygenReusingDocumentationTag | RoxygenOtherTag;
199
+ export type RoxygenTag = (RoxygenCrossrefTag | RoxygenNamespaceTag | RoxygenFormattingTag | RoxygenDatasetDocumentationTag | RoxygenFunctionDocumentationTag | RoxygenReusingDocumentationTag | RoxygenOtherTag) & {
200
+ inherited?: boolean;
201
+ };
200
202
  /**
201
203
  * A roxygen comment block, consisting of multiple {@link RoxygenTag|roxygen tags}.
202
204
  */
@@ -5,6 +5,7 @@ exports.getFlowrSearch = getFlowrSearch;
5
5
  const search_optimizer_1 = require("./search-optimizer/search-optimizer");
6
6
  const assert_1 = require("../util/assert");
7
7
  const search_mappers_1 = require("./search-executor/search-mappers");
8
+ const AllGeneratorObj = { type: 'generator', name: 'all', args: undefined };
8
9
  /**
9
10
  * This object holds all the methods to generate search queries.
10
11
  * For compatibility, please use the {@link Q} identifier object to access these methods.
@@ -37,7 +38,7 @@ exports.FlowrSearchGenerator = {
37
38
  * Returns all elements (nodes/dataflow vertices) from the given data.
38
39
  */
39
40
  all() {
40
- return new FlowrSearchBuilder({ type: 'generator', name: 'all', args: undefined });
41
+ return new FlowrSearchBuilder(AllGeneratorObj);
41
42
  },
42
43
  /**
43
44
  * Returns all elements that match the given {@link FlowrSearchGetFilters|filters}.
@@ -46,7 +47,7 @@ exports.FlowrSearchGenerator = {
46
47
  */
47
48
  get(filter) {
48
49
  (0, assert_1.guard)(!filter.nameIsRegex || filter.name, 'If nameIsRegex is set, a name should be provided');
49
- (0, assert_1.guard)(!filter.line || filter.line != 0, 'If line is set, it must be different from 0 as there is no 0 line');
50
+ (0, assert_1.guard)(!filter.line || filter.line !== 0, 'If line is set, it must be different from 0 as there is no 0 line');
50
51
  (0, assert_1.guard)(!filter.column || filter.column > 0, 'If column is set, it must be greater than 0, but was ' + filter.column);
51
52
  return new FlowrSearchBuilder({ type: 'generator', name: 'get', args: { filter } });
52
53
  },
@@ -133,7 +133,7 @@ async function generateSyntax(input, args) {
133
133
  }
134
134
  async function generateCriterion(input, args) {
135
135
  const idMap = (await input.normalize()).idMap;
136
- return new flowr_search_1.FlowrSearchElements(args.criterion.map(c => ({ node: idMap.get(parse_1.SingleSlicingCriterion.parse(c, idMap)) })));
136
+ return new flowr_search_1.FlowrSearchElements(args.criterion.map(c => ({ node: idMap.get(parse_1.SlicingCriterion.parse(c, idMap)) })));
137
137
  }
138
138
  /**
139
139
  * Gets the search generator function for the given name
@@ -1,33 +1,34 @@
1
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
  /** Either `line:column`, `line@variable-name`, or `$id` */
4
- export type SingleSlicingCriterion = `${number}:${number}` | `${number}@${string}` | `$${NodeId | number}`;
4
+ export type SlicingCriterion = `${number}:${number}` | `${number}@${string}` | `$${NodeId | number}`;
5
5
  /**
6
- * The helper object associated with {@link SingleSlicingCriterion} which makes it easy
6
+ * The helper object associated with {@link SlicingCriterion} which makes it easy
7
7
  * to parse, validate and resolve slicing criteria.
8
8
  */
9
- export declare const SingleSlicingCriterion: {
9
+ export declare const SlicingCriterion: {
10
+ readonly name: "SlicingCriterion";
10
11
  /**
11
12
  * Takes a criterion in the form of `line:column` or `line@variable-name` and returns the corresponding node id
12
- * @see {@link SingleSlicingCriterion.tryParse} for a version that does not throw an error
13
+ * @see {@link SlicingCriterion.tryParse} for a version that does not throw an error
13
14
  */
14
- readonly parse: (this: void, criterion: SingleSlicingCriterion, idMap: AstIdMap) => NodeId;
15
+ readonly parse: (this: void, criterion: SlicingCriterion, idMap: AstIdMap) => NodeId;
15
16
  /**
16
17
  * Tries to resolve a slicing criterion to an id, but does not throw an error if it fails.
17
- * @see {@link SingleSlicingCriterion.parse} for the version that throws an error
18
+ * @see {@link SlicingCriterion.parse} for the version that throws an error
18
19
  */
19
- readonly tryParse: (this: void, criterion: SingleSlicingCriterion | NodeId, idMap: AstIdMap) => NodeId | undefined;
20
+ readonly tryParse: (this: void, criterion: SlicingCriterion | NodeId, idMap: AstIdMap) => NodeId | undefined;
20
21
  /**
21
22
  * Converts a node id to a slicing criterion in the form of `$id`
22
23
  */
23
- readonly fromId: (this: void, id: NodeId) => SingleSlicingCriterion;
24
+ readonly fromId: (this: void, id: NodeId) => SlicingCriterion;
24
25
  };
25
26
  /**
26
27
  * A slicing criterion is a list of single slicing criteria, which can be in the form of `line:column`, `line@variable-name`, or `$id`.
27
28
  */
28
- export type SlicingCriteria = SingleSlicingCriterion[];
29
+ export type SlicingCriteria = SlicingCriterion[];
29
30
  export interface DecodedCriterion {
30
- criterion: SingleSlicingCriterion;
31
+ criterion: SlicingCriterion;
31
32
  id: NodeId;
32
33
  }
33
34
  export type DecodedCriteria = ReadonlyArray<DecodedCriterion>;
@@ -1,21 +1,22 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CriteriaParseError = exports.SlicingCriteria = exports.SingleSlicingCriterion = void 0;
3
+ exports.CriteriaParseError = exports.SlicingCriteria = exports.SlicingCriterion = void 0;
4
4
  const log_1 = require("../../util/log");
5
5
  const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
6
6
  const static_slicer_1 = require("../static/static-slicer");
7
7
  const type_1 = require("../../r-bridge/lang-4.x/ast/model/type");
8
8
  /**
9
- * The helper object associated with {@link SingleSlicingCriterion} which makes it easy
9
+ * The helper object associated with {@link SlicingCriterion} which makes it easy
10
10
  * to parse, validate and resolve slicing criteria.
11
11
  */
12
- exports.SingleSlicingCriterion = {
12
+ exports.SlicingCriterion = {
13
+ name: 'SlicingCriterion',
13
14
  /**
14
15
  * Takes a criterion in the form of `line:column` or `line@variable-name` and returns the corresponding node id
15
- * @see {@link SingleSlicingCriterion.tryParse} for a version that does not throw an error
16
+ * @see {@link SlicingCriterion.tryParse} for a version that does not throw an error
16
17
  */
17
18
  parse(criterion, idMap) {
18
- const resolved = exports.SingleSlicingCriterion.tryParse(criterion, idMap);
19
+ const resolved = exports.SlicingCriterion.tryParse(criterion, idMap);
19
20
  if (resolved === undefined) {
20
21
  throw new CriteriaParseError(`invalid slicing criterion ${criterion}`);
21
22
  }
@@ -23,7 +24,7 @@ exports.SingleSlicingCriterion = {
23
24
  },
24
25
  /**
25
26
  * Tries to resolve a slicing criterion to an id, but does not throw an error if it fails.
26
- * @see {@link SingleSlicingCriterion.parse} for the version that throws an error
27
+ * @see {@link SlicingCriterion.parse} for the version that throws an error
27
28
  */
28
29
  tryParse(criterion, idMap) {
29
30
  criterion = criterion.toString(); // in case it's a number
@@ -58,14 +59,14 @@ exports.SlicingCriteria = {
58
59
  * @see {@link SlicingCriteria.convertAll}
59
60
  */
60
61
  decodeAll(criteria, decorated) {
61
- return criteria.map(l => ({ criterion: l, id: exports.SingleSlicingCriterion.parse(l, decorated) }));
62
+ return criteria.map(l => ({ criterion: l, id: exports.SlicingCriterion.parse(l, decorated) }));
62
63
  },
63
64
  /**
64
65
  * Converts all criteria to their id in the AST if possible, this keeps the original criterion if it can not be resolved.
65
66
  * @see {@link SlicingCriteria.decodeAll}
66
67
  */
67
68
  convertAll(criteria, decorated) {
68
- return criteria.map(l => exports.SingleSlicingCriterion.tryParse(l, decorated) ?? l);
69
+ return criteria.map(l => exports.SlicingCriterion.tryParse(l, decorated) ?? l);
69
70
  }
70
71
  };
71
72
  /**
@@ -11,6 +11,7 @@ const vertex_1 = require("../../dataflow/graph/vertex");
11
11
  const edge_1 = require("../../dataflow/graph/edge");
12
12
  const df_helper_1 = require("../../dataflow/graph/df-helper");
13
13
  const slice_direction_1 = require("../../util/slice-direction");
14
+ const model_1 = require("../../r-bridge/lang-4.x/ast/model/model");
14
15
  exports.slicerLogger = log_1.log.getSubLogger({ name: 'slicer' });
15
16
  /**
16
17
  * This returns the ids to include in the static slice of the given type, when slicing with the given seed id's (must be at least one).
@@ -99,7 +100,29 @@ function staticSlice(ctx, info, { idMap }, ids, direction, threshold = 75, cache
99
100
  }
100
101
  }
101
102
  }
102
- return { ...queue.status(), slicedFor: ids };
103
+ if (ctx.config.solver.slicer?.autoExtend) {
104
+ return { ...queue.status(), slicedFor: ids, result: extendSlices(queue.status().result, idMap) };
105
+ }
106
+ else {
107
+ return { ...queue.status(), slicedFor: ids };
108
+ }
109
+ }
110
+ function extendSlices(results, ast) {
111
+ const res = new Set();
112
+ for (const id of results) {
113
+ res.add(id);
114
+ let parent = ast.get(id);
115
+ while (parent && parent.info.role !== "root" /* RoleInParent.Root */ && parent.info.role !== "el-c" /* RoleInParent.ExpressionListChild */) {
116
+ parent = parent.info.parent ? ast.get(parent.info.parent) : undefined;
117
+ }
118
+ if (!parent) {
119
+ continue; // no parent, no need to extend
120
+ }
121
+ for (const id of model_1.RNode.collectAllIds(parent)) {
122
+ res.add(id);
123
+ }
124
+ }
125
+ return res;
103
126
  }
104
127
  /**
105
128
  * Updates the potential addition for the given target node in the visiting queue.
@@ -92,6 +92,10 @@ export declare function equidistantSampling<T>(list: readonly T[], sampleCount:
92
92
  export declare function cartesianProduct<T>(...arrays: T[][]): T[][];
93
93
  /** merge two arrays, removing duplicates */
94
94
  export declare function uniqueArrayMerge<T>(left: readonly T[], right: readonly T[]): T[];
95
+ /**
96
+ * Returns a duplicate-free array.
97
+ */
98
+ export declare function uniqueArray<T>(a: Iterable<T>): T[];
95
99
  /**
96
100
  * Groups the elements of the given array by the key returned by the given key function.
97
101
  */
@@ -11,6 +11,7 @@ exports.arrayEqual = arrayEqual;
11
11
  exports.equidistantSampling = equidistantSampling;
12
12
  exports.cartesianProduct = cartesianProduct;
13
13
  exports.uniqueArrayMerge = uniqueArrayMerge;
14
+ exports.uniqueArray = uniqueArray;
14
15
  exports.arraysGroupBy = arraysGroupBy;
15
16
  const assert_1 = require("../assert");
16
17
  /**
@@ -227,6 +228,12 @@ function uniqueArrayMerge(left, right) {
227
228
  }
228
229
  return Array.from(result);
229
230
  }
231
+ /**
232
+ * Returns a duplicate-free array.
233
+ */
234
+ function uniqueArray(a) {
235
+ return Array.from(new Set(a));
236
+ }
230
237
  /**
231
238
  * Groups the elements of the given array by the key returned by the given key function.
232
239
  */
@@ -57,7 +57,8 @@ function normalizedAstToMermaid(ast, { prefix = 'flowchart TD\n', markStyle = in
57
57
  // add a subgraph for each file
58
58
  if (ast.files.length !== 1 || (f.filePath && f.filePath !== flowr_file_1.FlowrFile.INLINE_PATH)) {
59
59
  const direction = identifyMermaidDirection(prefix);
60
- output += ` subgraph "File: ${mermaid_1.Mermaid.escape(f.filePath ?? flowr_file_1.FlowrFile.INLINE_PATH)}" direction ${direction}\n`;
60
+ output += ` subgraph "File: ${mermaid_1.Mermaid.escape(f.filePath ?? flowr_file_1.FlowrFile.INLINE_PATH)}"\n`;
61
+ output += ` direction ${direction}\n`;
61
62
  showAst(f.root);
62
63
  output += ' end\n';
63
64
  }
@@ -156,8 +156,9 @@ function vertexToMermaid(info, mermaid, id, idPrefix, mark, includeOnlyIds) {
156
156
  const escapedName = mermaid_1.Mermaid.escape(node ? `[${node.type}] ${lexeme}` : '??');
157
157
  const deps = info.cds ? ', :may:' + info.cds.map(c => c.id + (c.when ? '+' : '-')).join(',') : '';
158
158
  const lnks = info.link?.origin ? ', :links:' + info.link.origin.join(',') : '';
159
+ const sources = info.source ? ', sources: ' + JSON.stringify(info.source) : '';
159
160
  const n = node?.info.fullRange ?? node?.location ?? (node?.type === type_1.RType.ExpressionList ? node?.grouping?.[0].location : undefined);
160
- mermaid.nodeLines.push(` ${idPrefix}${id}${open}"\`${escapedName}${escapedName.length > 10 ? '\n ' : ' '}(${id}${deps}${lnks})\n *${range_1.SourceRange.format(n)}*${fCall ? displayFunctionArgMapping(info.args) : '' + (info.tag === vertex_1.VertexType.FunctionDefinition && info.mode && info.mode.length > 0 ? mermaid_1.Mermaid.escape(JSON.stringify(info.mode)) : '')}\`"${close}`);
161
+ mermaid.nodeLines.push(` ${idPrefix}${id}${open}"\`${escapedName}${escapedName.length > 10 ? '\n ' : ' '}(${id}${deps}${lnks}${sources})\n *${range_1.SourceRange.format(n)}*${fCall ? displayFunctionArgMapping(info.args) : '' + (info.tag === vertex_1.VertexType.FunctionDefinition && info.mode && info.mode.length > 0 ? mermaid_1.Mermaid.escape(JSON.stringify(info.mode)) : '')}\`"${close}`);
161
162
  }
162
163
  if (mark?.has(id)) {
163
164
  mermaid.nodeLines.push(` style ${idPrefix}${id} ${mermaid.markStyle.vertex} `);
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Helper for transforming records.
3
+ */
4
+ export declare const Record: {
5
+ /**
6
+ * Transforms a record by applying a callback function to each key-value pair in the record.
7
+ * @param object - The record that should be transformed.
8
+ * @param callbackfn - The callback function that transforms each key-value pair of the record.
9
+ */
10
+ map<K1 extends string, K2 extends string, V1, V2>(this: void, object: Record<K1, V1>, callbackfn: (entry: [K1, V1], index: number, entries: [K1, V1][]) => [K2, V2]): Record<K2, V2>;
11
+ /**
12
+ * Transforms a record by applying a callback function to each key in the record.
13
+ * @param object - The record that should be transformed.
14
+ * @param callbackfn - The callback function that transforms each key of the record.
15
+ */
16
+ mapKeys<K1 extends string, K2 extends string, V>(this: void, object: Record<K1, V>, callbackfn: (key: K1, index: number, entries: [K1, V][]) => K2): Record<K2, V>;
17
+ /**
18
+ * Transforms a record by applying a callback function to each property value in the record.
19
+ * @param object - The record that should be transformed.
20
+ * @param callbackfn - The callback function that transforms each property value of the record.
21
+ */
22
+ mapProperties<K extends string, V1, V2>(this: void, object: Record<K, V1>, callbackfn: (value: V1, index: number, entries: [K, V1][]) => V2): Record<K, V2>;
23
+ };
package/util/record.js ADDED
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.Record = void 0;
4
+ /**
5
+ * Helper for transforming records.
6
+ */
7
+ exports.Record = {
8
+ /**
9
+ * Transforms a record by applying a callback function to each key-value pair in the record.
10
+ * @param object - The record that should be transformed.
11
+ * @param callbackfn - The callback function that transforms each key-value pair of the record.
12
+ */
13
+ map(object, callbackfn) {
14
+ return Object.fromEntries(Object.entries(object).map(callbackfn));
15
+ },
16
+ /**
17
+ * Transforms a record by applying a callback function to each key in the record.
18
+ * @param object - The record that should be transformed.
19
+ * @param callbackfn - The callback function that transforms each key of the record.
20
+ */
21
+ mapKeys(object, callbackfn) {
22
+ return exports.Record.map(object, ([key, value], index, entries) => [callbackfn(key, index, entries), value]);
23
+ },
24
+ /**
25
+ * Transforms a record by applying a callback function to each property value in the record.
26
+ * @param object - The record that should be transformed.
27
+ * @param callbackfn - The callback function that transforms each property value of the record.
28
+ */
29
+ mapProperties(object, callbackfn) {
30
+ return exports.Record.map(object, ([keys, value], index, entries) => [keys, callbackfn(value, index, entries)]);
31
+ }
32
+ };
33
+ //# sourceMappingURL=record.js.map
package/util/version.js CHANGED
@@ -6,7 +6,7 @@ exports.printVersionInformation = printVersionInformation;
6
6
  const semver_1 = require("semver");
7
7
  const assert_1 = require("./assert");
8
8
  // this is automatically replaced with the current version by release-it
9
- const version = '2.9.14';
9
+ const version = '2.10.2';
10
10
  /**
11
11
  * Retrieves the current flowR version as a new {@link SemVer} object.
12
12
  */
@@ -1,41 +0,0 @@
1
- import { AbstractDomain, type AnyAbstractDomain, type ConcreteDomain } from './abstract-domain';
2
- import { Top } from './lattice';
3
- /** The type of the concrete mapping of the concrete domain of a mapped abstract domain mapping keys to a concrete value in the concrete domain */
4
- export type ConcreteMap<Key, Domain extends AnyAbstractDomain> = ReadonlyMap<Key, ConcreteDomain<Domain>>;
5
- /**
6
- * A mapped abstract domain as mapping of keys to abstract values of an abstract domain.
7
- * The Bottom element is defined as empty mapping and the Top element is defined as mapping every existing key to Top.
8
- * @template Key - Type of the keys of the mapping to abstract values
9
- * @template Domain - Type of the abstract domain to map the keys to
10
- */
11
- export declare class MappedAbstractDomain<Key, Domain extends AnyAbstractDomain> extends AbstractDomain<ConcreteMap<Key, Domain>, ReadonlyMap<Key, Domain>, ReadonlyMap<Key, Domain>, ReadonlyMap<Key, Domain>> {
12
- constructor(value: ReadonlyMap<Key, Domain>);
13
- create(value: ReadonlyMap<Key, Domain>): this;
14
- get(key: Key): Domain | undefined;
15
- has(key: Key): boolean;
16
- protected set(key: Key, value: Domain): void;
17
- protected remove(key: Key): void;
18
- bottom(): this;
19
- top(): this;
20
- equals(other: this): boolean;
21
- leq(other: this): boolean;
22
- join(other: this): this;
23
- meet(other: this): this;
24
- widen(other: this): this;
25
- narrow(other: this): this;
26
- concretize(limit: number): ReadonlySet<ConcreteMap<Key, Domain>> | typeof Top;
27
- abstract(concrete: ReadonlySet<ConcreteMap<Key, Domain>> | typeof Top): this;
28
- toJson(): unknown;
29
- toString(): string;
30
- isTop(): this is this;
31
- isBottom(): this is this;
32
- isValue(): this is this;
33
- }
34
- /**
35
- * A mutable version of the {@link MappedAbstractDomain} with {@link MutableMappedAbstractDomain#set|`set`} and {@link MutableMappedAbstractDomain#remove|`remove`}.
36
- */
37
- export declare class MutableMappedAbstractDomain<Key, Domain extends AnyAbstractDomain> extends MappedAbstractDomain<Key, Domain> {
38
- create(value: ReadonlyMap<Key, Domain>): this;
39
- set(key: Key, value: Domain): void;
40
- remove(key: Key): void;
41
- }