@eagleoutice/flowr 2.9.14 → 2.10.1

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 (110) hide show
  1. package/README.md +37 -25
  2. package/benchmark/stats/stats.d.ts +2 -2
  3. package/cli/repl/parser/slice-query-parser.d.ts +2 -2
  4. package/config.d.ts +4 -0
  5. package/config.js +5 -3
  6. package/dataflow/environments/identifier.d.ts +4 -0
  7. package/dataflow/environments/identifier.js +17 -0
  8. package/dataflow/graph/call-graph.d.ts +4 -7
  9. package/dataflow/graph/call-graph.js +0 -22
  10. package/dataflow/graph/df-helper.d.ts +9 -8
  11. package/dataflow/graph/df-helper.js +9 -2
  12. package/dataflow/graph/graph-helper.d.ts +9 -4
  13. package/dataflow/graph/graph-helper.js +26 -3
  14. package/dataflow/graph/graph.d.ts +13 -2
  15. package/dataflow/graph/graph.js +26 -4
  16. package/dataflow/graph/vertex.d.ts +2 -0
  17. package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +1 -0
  18. package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +1 -1
  19. package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +1 -1
  20. package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +2 -2
  21. package/dataflow/internal/process/functions/call/common.js +2 -1
  22. package/dataflow/internal/process/functions/process-parameter.js +1 -1
  23. package/documentation/doc-readme.js +2 -1
  24. package/documentation/wiki-linter.js +5 -0
  25. package/linter/linter-rules.d.ts +25 -0
  26. package/linter/linter-rules.js +2 -0
  27. package/linter/rules/problematic-eval.d.ts +44 -0
  28. package/linter/rules/problematic-eval.js +83 -0
  29. package/package.json +7 -7
  30. package/queries/catalog/df-shape-query/df-shape-query-executor.js +1 -1
  31. package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +3 -3
  32. package/queries/catalog/does-call-query/does-call-query-executor.js +1 -1
  33. package/queries/catalog/does-call-query/does-call-query-format.d.ts +2 -2
  34. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
  35. package/queries/catalog/happens-before-query/happens-before-query-format.d.ts +3 -3
  36. package/queries/catalog/input-sources-query/input-sources-query-executor.d.ts +6 -0
  37. package/queries/catalog/input-sources-query/input-sources-query-executor.js +66 -0
  38. package/queries/catalog/input-sources-query/input-sources-query-format.d.ts +36 -0
  39. package/queries/catalog/input-sources-query/input-sources-query-format.js +63 -0
  40. package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +90 -0
  41. package/queries/catalog/input-sources-query/simple-input-classifier.js +308 -0
  42. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.d.ts +2 -2
  43. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-executor.js +1 -1
  44. package/queries/catalog/inspect-exceptions-query/inspect-exception-query-format.d.ts +2 -2
  45. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-executor.js +1 -1
  46. package/queries/catalog/inspect-higher-order-query/inspect-higher-order-query-format.d.ts +2 -2
  47. package/queries/catalog/inspect-recursion-query/inspect-recursion-query-format.d.ts +2 -2
  48. package/queries/catalog/location-map-query/location-map-query-executor.js +1 -1
  49. package/queries/catalog/location-map-query/location-map-query-format.d.ts +2 -2
  50. package/queries/catalog/origin-query/origin-query-executor.d.ts +2 -2
  51. package/queries/catalog/origin-query/origin-query-executor.js +1 -1
  52. package/queries/catalog/origin-query/origin-query-format.d.ts +3 -3
  53. package/queries/catalog/provenance-query/provenance-query-executor.d.ts +1 -4
  54. package/queries/catalog/provenance-query/provenance-query-executor.js +3 -6
  55. package/queries/catalog/provenance-query/provenance-query-format.d.ts +2 -2
  56. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +1 -1
  57. package/queries/query.d.ts +9 -1
  58. package/queries/query.js +2 -0
  59. package/r-bridge/lang-4.x/ast/model/model.d.ts +3 -0
  60. package/r-bridge/lang-4.x/ast/model/model.js +3 -0
  61. package/r-bridge/lang-4.x/ast/model/nodes/r-access.d.ts +16 -1
  62. package/r-bridge/lang-4.x/ast/model/nodes/r-access.js +2 -0
  63. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +16 -1
  64. package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +2 -0
  65. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.d.ts +16 -1
  66. package/r-bridge/lang-4.x/ast/model/nodes/r-binary-op.js +2 -0
  67. package/r-bridge/lang-4.x/ast/model/nodes/r-break.d.ts +15 -0
  68. package/r-bridge/lang-4.x/ast/model/nodes/r-break.js +2 -0
  69. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.d.ts +15 -0
  70. package/r-bridge/lang-4.x/ast/model/nodes/r-comment.js +2 -0
  71. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.d.ts +16 -1
  72. package/r-bridge/lang-4.x/ast/model/nodes/r-expression-list.js +2 -0
  73. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.d.ts +16 -1
  74. package/r-bridge/lang-4.x/ast/model/nodes/r-for-loop.js +2 -0
  75. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +16 -1
  76. package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.js +2 -0
  77. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.d.ts +21 -0
  78. package/r-bridge/lang-4.x/ast/model/nodes/r-function-definition.js +16 -0
  79. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.d.ts +16 -1
  80. package/r-bridge/lang-4.x/ast/model/nodes/r-if-then-else.js +2 -0
  81. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.d.ts +16 -1
  82. package/r-bridge/lang-4.x/ast/model/nodes/r-line-directive.js +2 -0
  83. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.d.ts +16 -1
  84. package/r-bridge/lang-4.x/ast/model/nodes/r-logical.js +2 -0
  85. package/r-bridge/lang-4.x/ast/model/nodes/r-next.d.ts +16 -1
  86. package/r-bridge/lang-4.x/ast/model/nodes/r-next.js +2 -0
  87. package/r-bridge/lang-4.x/ast/model/nodes/r-number.d.ts +16 -1
  88. package/r-bridge/lang-4.x/ast/model/nodes/r-number.js +2 -0
  89. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.d.ts +16 -1
  90. package/r-bridge/lang-4.x/ast/model/nodes/r-parameter.js +2 -0
  91. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +16 -1
  92. package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +2 -0
  93. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.d.ts +16 -1
  94. package/r-bridge/lang-4.x/ast/model/nodes/r-repeat-loop.js +2 -0
  95. package/r-bridge/lang-4.x/ast/model/nodes/r-string.d.ts +16 -1
  96. package/r-bridge/lang-4.x/ast/model/nodes/r-string.js +2 -0
  97. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.d.ts +16 -1
  98. package/r-bridge/lang-4.x/ast/model/nodes/r-symbol.js +2 -0
  99. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.d.ts +16 -1
  100. package/r-bridge/lang-4.x/ast/model/nodes/r-unary-op.js +2 -0
  101. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.d.ts +16 -1
  102. package/r-bridge/lang-4.x/ast/model/nodes/r-while-loop.js +2 -0
  103. package/search/search-executor/search-generators.js +1 -1
  104. package/slicing/criterion/parse.d.ts +11 -10
  105. package/slicing/criterion/parse.js +9 -8
  106. package/slicing/static/static-slicer.js +24 -1
  107. package/util/collections/arrays.d.ts +4 -0
  108. package/util/collections/arrays.js +7 -0
  109. package/util/mermaid/dfg.js +2 -1
  110. package/util/version.js +1 -1
@@ -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
  */
@@ -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} `);
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.1';
10
10
  /**
11
11
  * Retrieves the current flowR version as a new {@link SemVer} object.
12
12
  */