@eagleoutice/flowr 2.2.1 → 2.2.3

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 (95) hide show
  1. package/cli/flowr.js +2 -1
  2. package/cli/repl/commands/repl-cfg.js +30 -7
  3. package/cli/repl/commands/repl-dataflow.js +29 -6
  4. package/cli/repl/commands/repl-normalize.js +22 -2
  5. package/cli/repl/commands/repl-parse.js +50 -3
  6. package/cli/repl/core.js +4 -0
  7. package/cli/repl/print-version.d.ts +1 -0
  8. package/cli/repl/print-version.js +7 -2
  9. package/cli/repl/server/connection.js +11 -9
  10. package/cli/script-core/statistics-helper-core.js +1 -1
  11. package/config.js +8 -1
  12. package/core/pipeline-executor.d.ts +6 -0
  13. package/core/pipeline-executor.js +8 -0
  14. package/core/print/dataflow-printer.js +3 -0
  15. package/core/steps/all/core/01-parse-tree-sitter.d.ts +7 -0
  16. package/core/steps/pipeline/default-pipelines.d.ts +57 -47
  17. package/core/steps/pipeline/default-pipelines.js +23 -2
  18. package/core/steps/pipeline/pipeline.d.ts +1 -1
  19. package/core/steps/pipeline/pipeline.js +1 -1
  20. package/core/steps/pipeline-step.d.ts +1 -3
  21. package/dataflow/environments/resolve-by-name.d.ts +3 -2
  22. package/dataflow/environments/resolve-by-name.js +4 -4
  23. package/dataflow/extractor.d.ts +10 -0
  24. package/dataflow/extractor.js +11 -1
  25. package/dataflow/graph/dataflowgraph-builder.d.ts +11 -10
  26. package/dataflow/graph/dataflowgraph-builder.js +11 -10
  27. package/dataflow/graph/edge.d.ts +1 -1
  28. package/dataflow/graph/edge.js +2 -2
  29. package/dataflow/graph/vertex.d.ts +6 -6
  30. package/dataflow/graph/vertex.js +5 -5
  31. package/dataflow/internal/process/functions/call/built-in/built-in-access.js +9 -5
  32. package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +1 -1
  33. package/dataflow/internal/process/functions/call/built-in/built-in-source.js +22 -6
  34. package/documentation/doc-util/doc-cfg.js +2 -2
  35. package/documentation/doc-util/doc-dfg.d.ts +5 -3
  36. package/documentation/doc-util/doc-dfg.js +10 -8
  37. package/documentation/doc-util/doc-files.d.ts +1 -1
  38. package/documentation/doc-util/doc-files.js +1 -1
  39. package/documentation/doc-util/doc-normalized-ast.d.ts +2 -1
  40. package/documentation/doc-util/doc-normalized-ast.js +4 -5
  41. package/documentation/doc-util/doc-repl.d.ts +6 -2
  42. package/documentation/doc-util/doc-repl.js +10 -6
  43. package/documentation/doc-util/doc-structure.d.ts +1 -1
  44. package/documentation/doc-util/doc-types.d.ts +7 -5
  45. package/documentation/doc-util/doc-types.js +17 -12
  46. package/documentation/index.d.ts +9 -0
  47. package/documentation/index.js +26 -0
  48. package/documentation/print-capabilities-markdown.js +105 -19
  49. package/documentation/print-core-wiki.d.ts +1 -0
  50. package/documentation/print-core-wiki.js +406 -0
  51. package/documentation/print-dataflow-graph-wiki.js +27 -27
  52. package/documentation/print-interface-wiki.js +1 -3
  53. package/documentation/print-linting-and-testing-wiki.js +26 -8
  54. package/documentation/print-normalized-ast-wiki.js +22 -17
  55. package/documentation/print-query-wiki.js +37 -7
  56. package/documentation/print-search-wiki.js +2 -1
  57. package/package.json +10 -7
  58. package/queries/catalog/call-context-query/call-context-query-executor.js +1 -1
  59. package/queries/catalog/happens-before-query/happens-before-query-executor.d.ts +1 -1
  60. package/queries/catalog/happens-before-query/happens-before-query-executor.js +2 -2
  61. package/queries/catalog/happens-before-query/happens-before-query-format.js +1 -1
  62. package/queries/catalog/resolve-value-query/resolve-value-query-executor.d.ts +4 -0
  63. package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +34 -0
  64. package/queries/catalog/resolve-value-query/resolve-value-query-format.d.ts +72 -0
  65. package/queries/catalog/resolve-value-query/resolve-value-query-format.js +49 -0
  66. package/queries/catalog/search-query/search-query-format.js +1 -1
  67. package/queries/query.d.ts +60 -1
  68. package/queries/query.js +3 -1
  69. package/r-bridge/data/data.d.ts +50 -9
  70. package/r-bridge/data/data.js +64 -10
  71. package/r-bridge/data/types.d.ts +7 -1
  72. package/r-bridge/lang-4.x/ast/model/processing/decorate.d.ts +2 -0
  73. package/r-bridge/lang-4.x/ast/model/processing/node-id.js +2 -5
  74. package/r-bridge/lang-4.x/ast/parser/json/format.d.ts +6 -0
  75. package/r-bridge/lang-4.x/ast/parser/json/format.js +6 -0
  76. package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +13 -2
  77. package/r-bridge/lang-4.x/ast/parser/json/parser.js +19 -3
  78. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.d.ts +3 -0
  79. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-root.js +3 -0
  80. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +51 -29
  81. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-types.d.ts +4 -1
  82. package/r-bridge/lang-4.x/tree-sitter/tree-sitter-types.js +3 -0
  83. package/r-bridge/parser.d.ts +10 -0
  84. package/r-bridge/parser.js +26 -2
  85. package/search/flowr-search-builder.d.ts +1 -2
  86. package/search/flowr-search-builder.js +1 -3
  87. package/util/cfg/cfg.d.ts +10 -1
  88. package/util/cfg/cfg.js +56 -2
  89. package/util/mermaid/dfg.d.ts +3 -0
  90. package/util/mermaid/dfg.js +24 -8
  91. package/util/range.d.ts +21 -0
  92. package/util/range.js +3 -0
  93. package/util/strings.d.ts +9 -0
  94. package/util/strings.js +14 -0
  95. package/util/version.js +1 -1
package/util/range.d.ts CHANGED
@@ -1,9 +1,27 @@
1
+ /**
2
+ * A source position in a file.
3
+ *
4
+ * Please note that some packages like `xmlparsedata` use their own start and end only to break ties
5
+ * (e.g., `xmlparsedata` calculates them on a max col width approximation)
6
+ */
1
7
  export type SourcePosition = [
2
8
  /** starts with 1 */
3
9
  line: number,
4
10
  /** starts with 1 */
5
11
  column: number
6
12
  ];
13
+ /**
14
+ * Describe the start and end {@link SourcePosition|source position} of an element.
15
+ *
16
+ * @see {@link rangeFrom} - to create a range
17
+ * @see {@link mergeRanges} - to merge multiple ranges
18
+ * @see {@link getRangeStart} - to get the start of a range
19
+ * @see {@link getRangeEnd} - to get the end of a range
20
+ * @see {@link rangeStartsCompletelyBefore} - to check if one range starts before another
21
+ * @see {@link rangesOverlap} - to check if two ranges overlap
22
+ * @see {@link addRanges} - to add two ranges
23
+ * @see {@link rangeCompare} - to compare two ranges
24
+ */
7
25
  export type SourceRange = [
8
26
  /** inclusive start position */
9
27
  startLine: number,
@@ -36,6 +54,9 @@ export declare function rangeStartsCompletelyBefore([, , r1el, r1ec]: SourceRang
36
54
  * Checks if the two ranges overlap.
37
55
  */
38
56
  export declare function rangesOverlap([r1sl, r1sc, r1el, r1ec]: SourceRange, [r2sl, r2sc, r2el, r2ec]: SourceRange): boolean;
57
+ /**
58
+ * Calculate the component-wise sum of two ranges
59
+ */
39
60
  export declare function addRanges([r1sl, r1sc, r1el, r1ec]: SourceRange, [r2sl, r2sc, r2el, r2ec]: SourceRange): SourceRange;
40
61
  /**
41
62
  * Provides a comparator for {@link SourceRange}s that sorts them in ascending order.
package/util/range.js CHANGED
@@ -45,6 +45,9 @@ function rangeStartsCompletelyBefore([, , r1el, r1ec], [r2sl, r2sc, ,]) {
45
45
  function rangesOverlap([r1sl, r1sc, r1el, r1ec], [r2sl, r2sc, r2el, r2ec]) {
46
46
  return r1sl <= r2el && r2sl <= r1el && r1sc <= r2ec && r2sc <= r1ec;
47
47
  }
48
+ /**
49
+ * Calculate the component-wise sum of two ranges
50
+ */
48
51
  function addRanges([r1sl, r1sc, r1el, r1ec], [r2sl, r2sc, r2el, r2ec]) {
49
52
  return [r1sl + r2sl, r1sc + r2sc, r1el + r2el, r1ec + r2ec];
50
53
  }
package/util/strings.d.ts CHANGED
@@ -10,3 +10,12 @@ export declare function withoutWhitespace(output: string): string;
10
10
  * Find the longest common prefix in an array of strings
11
11
  */
12
12
  export declare function longestCommonPrefix(strings: string[]): string;
13
+ /**
14
+ * Join a list of strings, but with special handling for the last element/scenarios in which the array contains exactly two elements.
15
+ * The goal is to create (partial) sentences like `a, b, and c` or `a and b`.
16
+ */
17
+ export declare function joinWithLast(strs: readonly string[], { join, last, joinTwo }?: {
18
+ join?: string;
19
+ last?: string;
20
+ joinTwo?: string;
21
+ }): string;
package/util/strings.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.startAndEndsWith = startAndEndsWith;
4
4
  exports.withoutWhitespace = withoutWhitespace;
5
5
  exports.longestCommonPrefix = longestCommonPrefix;
6
+ exports.joinWithLast = joinWithLast;
6
7
  /**
7
8
  * Check if the given string starts and ends with the given letter
8
9
  */
@@ -37,4 +38,17 @@ function longestCommonPrefix(strings) {
37
38
  }
38
39
  return prefix;
39
40
  }
41
+ /**
42
+ * Join a list of strings, but with special handling for the last element/scenarios in which the array contains exactly two elements.
43
+ * The goal is to create (partial) sentences like `a, b, and c` or `a and b`.
44
+ */
45
+ function joinWithLast(strs, { join = ', ', last = ', and ', joinTwo = ' and ' } = {}) {
46
+ if (strs.length <= 1) {
47
+ return strs.join('');
48
+ }
49
+ else if (strs.length === 2) {
50
+ return strs.join(joinTwo);
51
+ }
52
+ return strs.slice(0, -1).join(join) + last + strs[strs.length - 1];
53
+ }
40
54
  //# sourceMappingURL=strings.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.2.1';
6
+ const version = '2.2.3';
7
7
  function flowrVersion() {
8
8
  return new semver_1.SemVer(version);
9
9
  }