@eagleoutice/flowr 2.3.0 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (101) hide show
  1. package/README.md +41 -29
  2. package/abstract-interpretation/data-frame/absint-visitor.d.ts +2 -3
  3. package/abstract-interpretation/data-frame/absint-visitor.js +14 -16
  4. package/abstract-interpretation/data-frame/mappers/function-mapper.js +3 -3
  5. package/abstract-interpretation/data-frame/semantics.d.ts +1 -1
  6. package/abstract-interpretation/data-frame/semantics.js +7 -10
  7. package/abstract-interpretation/data-frame/shape-inference.js +2 -8
  8. package/benchmark/slicer.js +7 -5
  9. package/benchmark/summarizer/second-phase/graph.js +1 -1
  10. package/benchmark/summarizer/second-phase/process.js +1 -1
  11. package/cli/benchmark-app.d.ts +1 -0
  12. package/cli/benchmark-app.js +1 -0
  13. package/cli/benchmark-helper-app.d.ts +1 -0
  14. package/cli/benchmark-helper-app.js +4 -3
  15. package/cli/common/options.js +2 -0
  16. package/cli/repl/commands/repl-query.js +1 -1
  17. package/cli/repl/server/connection.js +14 -5
  18. package/control-flow/basic-cfg-guided-visitor.d.ts +1 -2
  19. package/control-flow/basic-cfg-guided-visitor.js +0 -6
  20. package/control-flow/cfg-simplification.d.ts +6 -0
  21. package/control-flow/cfg-simplification.js +18 -9
  22. package/control-flow/control-flow-graph.d.ts +2 -8
  23. package/control-flow/control-flow-graph.js +1 -6
  24. package/control-flow/extract-cfg.d.ts +2 -2
  25. package/control-flow/extract-cfg.js +52 -63
  26. package/core/steps/all/static-slicing/00-slice.d.ts +7 -1
  27. package/core/steps/all/static-slicing/00-slice.js +9 -3
  28. package/core/steps/pipeline/default-pipelines.d.ts +74 -74
  29. package/dataflow/environments/built-in.d.ts +2 -2
  30. package/dataflow/environments/built-in.js +13 -12
  31. package/dataflow/graph/dataflowgraph-builder.js +2 -2
  32. package/dataflow/graph/graph.js +1 -1
  33. package/dataflow/graph/invert-dfg.d.ts +2 -0
  34. package/dataflow/graph/invert-dfg.js +17 -0
  35. package/documentation/doc-util/doc-query.js +1 -1
  36. package/documentation/doc-util/doc-search.js +2 -2
  37. package/documentation/print-cfg-wiki.js +3 -4
  38. package/documentation/print-core-wiki.js +2 -2
  39. package/documentation/print-dataflow-graph-wiki.js +7 -0
  40. package/documentation/print-faq-wiki.js +4 -0
  41. package/documentation/print-linter-wiki.js +32 -4
  42. package/documentation/print-linting-and-testing-wiki.js +13 -1
  43. package/documentation/print-onboarding-wiki.js +4 -0
  44. package/documentation/print-query-wiki.js +12 -3
  45. package/linter/linter-executor.js +1 -2
  46. package/linter/linter-format.d.ts +26 -4
  47. package/linter/linter-format.js +25 -6
  48. package/linter/linter-rules.d.ts +40 -12
  49. package/linter/linter-rules.js +3 -1
  50. package/linter/rules/absolute-path.d.ts +4 -7
  51. package/linter/rules/absolute-path.js +9 -6
  52. package/linter/rules/dataframe-access-validation.d.ts +3 -1
  53. package/linter/rules/dataframe-access-validation.js +3 -1
  54. package/linter/rules/dead-code.d.ts +43 -0
  55. package/linter/rules/dead-code.js +50 -0
  56. package/linter/rules/deprecated-functions.d.ts +3 -2
  57. package/linter/rules/deprecated-functions.js +3 -1
  58. package/linter/rules/file-path-validity.d.ts +4 -4
  59. package/linter/rules/file-path-validity.js +8 -6
  60. package/linter/rules/naming-convention.d.ts +4 -3
  61. package/linter/rules/naming-convention.js +3 -1
  62. package/linter/rules/seeded-randomness.d.ts +4 -3
  63. package/linter/rules/seeded-randomness.js +3 -1
  64. package/linter/rules/unused-definition.d.ts +2 -0
  65. package/linter/rules/unused-definition.js +3 -1
  66. package/package.json +1 -1
  67. package/queries/catalog/dependencies-query/dependencies-query-executor.js +6 -1
  68. package/queries/catalog/dependencies-query/function-info/read-functions.js +1 -0
  69. package/queries/catalog/dependencies-query/function-info/write-functions.js +1 -0
  70. package/queries/catalog/linter-query/linter-query-format.js +1 -1
  71. package/queries/catalog/location-map-query/location-map-query-executor.js +7 -5
  72. package/queries/catalog/location-map-query/location-map-query-format.d.ts +3 -0
  73. package/queries/catalog/location-map-query/location-map-query-format.js +1 -0
  74. package/queries/catalog/search-query/search-query-executor.js +1 -1
  75. package/queries/catalog/static-slice-query/static-slice-query-executor.js +2 -1
  76. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +3 -0
  77. package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -1
  78. package/queries/query-print.d.ts +1 -1
  79. package/queries/query-print.js +0 -1
  80. package/queries/query.d.ts +16 -5
  81. package/queries/query.js +24 -11
  82. package/search/flowr-search-builder.d.ts +6 -6
  83. package/search/flowr-search-executor.d.ts +2 -2
  84. package/search/flowr-search-executor.js +1 -1
  85. package/search/flowr-search.d.ts +13 -8
  86. package/search/flowr-search.js +21 -0
  87. package/search/search-executor/search-enrichers.d.ts +87 -20
  88. package/search/search-executor/search-enrichers.js +44 -5
  89. package/search/search-executor/search-generators.d.ts +4 -4
  90. package/search/search-executor/search-generators.js +12 -7
  91. package/search/search-executor/search-mappers.js +3 -2
  92. package/search/search-executor/search-transformer.d.ts +3 -3
  93. package/search/search-executor/search-transformer.js +2 -2
  94. package/slicing/static/static-slicer.d.ts +4 -2
  95. package/slicing/static/static-slicer.js +10 -4
  96. package/util/collections/arrays.d.ts +2 -0
  97. package/util/collections/arrays.js +9 -0
  98. package/util/mermaid/dfg.js +4 -2
  99. package/util/range.d.ts +1 -0
  100. package/util/range.js +5 -1
  101. package/util/version.js +1 -1
@@ -10,6 +10,7 @@ exports.array2bag = array2bag;
10
10
  exports.arrayEqual = arrayEqual;
11
11
  exports.equidistantSampling = equidistantSampling;
12
12
  exports.cartesianProduct = cartesianProduct;
13
+ exports.uniqueArrayMerge = uniqueArrayMerge;
13
14
  const assert_1 = require("../assert");
14
15
  /**
15
16
  * Splits the array every time the given predicate fires.
@@ -215,4 +216,12 @@ function equidistantSampling(list, sampleCount, rounding = 'ceil') {
215
216
  function cartesianProduct(...arrays) {
216
217
  return arrays.reduce((a, b) => a.flatMap(x => b.map(y => x.concat(y))), [[]]);
217
218
  }
219
+ /** merge two arrays, removing duplicates */
220
+ function uniqueArrayMerge(left, right) {
221
+ const result = new Set(left);
222
+ for (const elem of right) {
223
+ result.add(elem);
224
+ }
225
+ return Array.from(result);
226
+ }
218
227
  //# sourceMappingURL=arrays.js.map
@@ -6,7 +6,6 @@ exports.graphToMermaid = graphToMermaid;
6
6
  exports.graphToMermaidUrl = graphToMermaidUrl;
7
7
  exports.diffGraphsToMermaid = diffGraphsToMermaid;
8
8
  exports.diffGraphsToMermaidUrl = diffGraphsToMermaidUrl;
9
- const assert_1 = require("../assert");
10
9
  const mermaid_1 = require("./mermaid");
11
10
  const graph_1 = require("../../dataflow/graph/graph");
12
11
  const node_id_1 = require("../../r-bridge/lang-4.x/ast/model/processing/node-id");
@@ -176,7 +175,10 @@ function vertexToMermaid(info, mermaid, id, idPrefix, mark) {
176
175
  mermaid.nodeLines.push(` style ${idPrefix}${id} stroke:red,stroke-width:5px; `);
177
176
  }
178
177
  const edges = mermaid.rootGraph.get((0, node_id_1.normalizeIdToNumberIfPossible)(id), true);
179
- (0, assert_1.guard)(edges !== undefined, `node ${id} must be found`);
178
+ if (edges === undefined) {
179
+ mermaid.nodeLines.push(' %% No edges found for ' + id);
180
+ return;
181
+ }
180
182
  const artificialCdEdges = (info.cds ?? []).map(x => [x.id, { types: new Set([x.when ? 'CD-True' : 'CD-False']) }]);
181
183
  // eslint-disable-next-line prefer-const
182
184
  for (let [target, edge] of [...edges[1], ...artificialCdEdges]) {
package/util/range.d.ts CHANGED
@@ -68,3 +68,4 @@ export declare function rangeCompare([r1sl, r1sc, ,]: SourceRange, [r2sl, r2sc,
68
68
  * Checks if the first range is a subset of the second range.
69
69
  */
70
70
  export declare function rangeIsSubsetOf([r1sl, r1sc, r1el, r1ec]: SourceRange, [r2sl, r2sc, r2el, r2ec]: SourceRange): boolean;
71
+ export declare function combineRanges(...ranges: SourceRange[]): SourceRange[];
package/util/range.js CHANGED
@@ -9,6 +9,7 @@ exports.rangesOverlap = rangesOverlap;
9
9
  exports.addRanges = addRanges;
10
10
  exports.rangeCompare = rangeCompare;
11
11
  exports.rangeIsSubsetOf = rangeIsSubsetOf;
12
+ exports.combineRanges = combineRanges;
12
13
  const assert_1 = require("./assert");
13
14
  function getRangeStart(p) {
14
15
  return p === undefined ? undefined : [p[0], p[1]];
@@ -70,6 +71,9 @@ function rangeCompare([r1sl, r1sc, ,], [r2sl, r2sc, ,]) {
70
71
  * Checks if the first range is a subset of the second range.
71
72
  */
72
73
  function rangeIsSubsetOf([r1sl, r1sc, r1el, r1ec], [r2sl, r2sc, r2el, r2ec]) {
73
- return r1sl >= r2sl && r1sc >= r2sc && r1el <= r2el && r1ec <= r2ec;
74
+ return (r1sl > r2sl || r1sl === r2sl && r1sc >= r2sc) && (r1el < r2el || r1sl === r2sl && r1ec <= r2ec);
75
+ }
76
+ function combineRanges(...ranges) {
77
+ return ranges.filter(range => !ranges.some(other => range !== other && rangeIsSubsetOf(range, other)));
74
78
  }
75
79
  //# sourceMappingURL=range.js.map
package/util/version.js CHANGED
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.flowrVersion = flowrVersion;
4
4
  const semver_1 = require("semver");
5
5
  // this is automatically replaced with the current version by release-it
6
- const version = '2.3.0';
6
+ const version = '2.4.0';
7
7
  function flowrVersion() {
8
8
  return new semver_1.SemVer(version);
9
9
  }