@eagleoutice/flowr 2.1.1 → 2.1.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 (125) hide show
  1. package/README.md +2 -1
  2. package/cli/repl/commands/repl-parse.js +7 -16
  3. package/cli/repl/commands/repl-query.js +72 -3
  4. package/core/print/parse-printer.js +1 -22
  5. package/core/steps/pipeline/default-pipelines.d.ts +64 -0
  6. package/core/steps/pipeline/default-pipelines.js +2 -1
  7. package/dataflow/cluster.d.ts +20 -0
  8. package/dataflow/cluster.js +46 -0
  9. package/dataflow/graph/edge.d.ts +2 -3
  10. package/dataflow/graph/graph.d.ts +1 -1
  11. package/documentation/data/server/doc-data-server-messages.d.ts +1 -1
  12. package/documentation/data/server/doc-data-server-messages.js +10 -4
  13. package/documentation/doc-util/doc-code.d.ts +1 -0
  14. package/documentation/doc-util/doc-code.js +9 -0
  15. package/documentation/doc-util/doc-dfg.d.ts +1 -0
  16. package/documentation/doc-util/doc-dfg.js +5 -4
  17. package/documentation/doc-util/doc-normalized-ast.js +2 -2
  18. package/documentation/doc-util/doc-query.js +5 -7
  19. package/documentation/doc-util/doc-server-message.js +3 -5
  20. package/documentation/doc-util/doc-types.js +19 -11
  21. package/documentation/print-dataflow-graph-wiki.js +10 -1
  22. package/documentation/print-interface-wiki.js +1 -1
  23. package/documentation/print-normalized-ast-wiki.js +2 -2
  24. package/documentation/print-query-wiki.js +164 -37
  25. package/package.json +1 -1
  26. package/queries/{call-context-query → catalog/call-context-query}/call-context-query-executor.d.ts +4 -3
  27. package/queries/{call-context-query → catalog/call-context-query}/call-context-query-executor.js +22 -16
  28. package/queries/{call-context-query → catalog/call-context-query}/call-context-query-format.d.ts +6 -2
  29. package/queries/catalog/cluster-query/cluster-query-executor.d.ts +3 -0
  30. package/queries/catalog/cluster-query/cluster-query-executor.js +19 -0
  31. package/queries/catalog/cluster-query/cluster-query-format.d.ts +12 -0
  32. package/queries/catalog/cluster-query/cluster-query-format.js +3 -0
  33. package/queries/catalog/dataflow-query/dataflow-query-executor.d.ts +3 -0
  34. package/queries/catalog/dataflow-query/dataflow-query-executor.js +17 -0
  35. package/queries/catalog/dataflow-query/dataflow-query-format.d.ts +12 -0
  36. package/queries/catalog/dataflow-query/dataflow-query-format.js +3 -0
  37. package/queries/catalog/id-map-query/id-map-query-executor.d.ts +3 -0
  38. package/queries/catalog/id-map-query/id-map-query-executor.js +17 -0
  39. package/queries/catalog/id-map-query/id-map-query-format.d.ts +8 -0
  40. package/{r-bridge/lang-4.x/ast/parser/xml/normalizer-data.js → queries/catalog/id-map-query/id-map-query-format.js} +1 -1
  41. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.d.ts +3 -0
  42. package/queries/catalog/normalized-ast-query/normalized-ast-query-executor.js +17 -0
  43. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.d.ts +11 -0
  44. package/queries/catalog/normalized-ast-query/normalized-ast-query-format.js +3 -0
  45. package/queries/catalog/static-slice-query/static-slice-query-executor.d.ts +4 -0
  46. package/queries/catalog/static-slice-query/static-slice-query-executor.js +40 -0
  47. package/queries/catalog/static-slice-query/static-slice-query-format.d.ts +24 -0
  48. package/queries/catalog/static-slice-query/static-slice-query-format.js +3 -0
  49. package/queries/query-schema.d.ts +5 -0
  50. package/queries/query-schema.js +22 -3
  51. package/queries/query.d.ts +19 -4
  52. package/queries/query.js +12 -2
  53. package/r-bridge/lang-4.x/ast/parser/json/format.d.ts +37 -13
  54. package/r-bridge/lang-4.x/ast/parser/json/format.js +59 -6
  55. package/r-bridge/lang-4.x/ast/parser/json/parser.d.ts +0 -3
  56. package/r-bridge/lang-4.x/ast/parser/json/parser.js +2 -40
  57. package/r-bridge/lang-4.x/ast/parser/main/internal/control/normalize-if-then-else.d.ts +15 -0
  58. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/control/normalize-if-then-else.js +5 -8
  59. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/control/normalize-if-then.d.ts +7 -7
  60. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/control/normalize-if-then.js +11 -12
  61. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/expression/normalize-expression.d.ts +3 -3
  62. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/expression/normalize-expression.js +4 -7
  63. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/functions/normalize-argument.d.ts +2 -2
  64. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/functions/normalize-argument.js +3 -3
  65. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/functions/normalize-call.d.ts +3 -3
  66. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/functions/normalize-call.js +6 -9
  67. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/functions/normalize-definition.d.ts +3 -3
  68. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/functions/normalize-definition.js +1 -3
  69. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/functions/normalize-parameter.d.ts +2 -2
  70. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/functions/normalize-parameter.js +6 -5
  71. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/loops/normalize-break.d.ts +2 -2
  72. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/loops/normalize-for.d.ts +2 -2
  73. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/loops/normalize-for.js +5 -6
  74. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/loops/normalize-next.d.ts +2 -2
  75. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/loops/normalize-repeat.d.ts +2 -2
  76. package/r-bridge/lang-4.x/ast/parser/main/internal/loops/normalize-while.d.ts +4 -0
  77. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/loops/normalize-while.js +4 -4
  78. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/normalize-access.d.ts +3 -3
  79. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/normalize-access.js +1 -2
  80. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/operators/normalize-binary.d.ts +2 -2
  81. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/operators/normalize-binary.js +2 -2
  82. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/operators/normalize-unary.d.ts +2 -2
  83. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/other/normalize-comment.d.ts +3 -3
  84. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/other/normalize-comment.js +1 -1
  85. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/other/normalize-line-directive.d.ts +3 -3
  86. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/other/normalize-line-directive.js +1 -1
  87. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-delimiter.d.ts +3 -0
  88. package/r-bridge/lang-4.x/ast/parser/main/internal/structure/normalize-expressions.d.ts +10 -0
  89. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/structure/normalize-root.d.ts +2 -2
  90. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/structure/normalize-root.js +3 -4
  91. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/structure/normalize-single-node.d.ts +2 -2
  92. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/structure/normalize-single-node.js +2 -2
  93. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/values/normalize-number.d.ts +3 -3
  94. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/values/normalize-number.js +1 -1
  95. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/values/normalize-string.d.ts +3 -3
  96. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/values/normalize-string.js +1 -1
  97. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/values/normalize-symbol.d.ts +3 -3
  98. package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/values/normalize-symbol.js +1 -3
  99. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.d.ts +41 -0
  100. package/r-bridge/lang-4.x/ast/parser/main/normalize-meta.js +85 -0
  101. package/r-bridge/lang-4.x/ast/parser/{xml → main}/normalizer-data.d.ts +10 -4
  102. package/r-bridge/lang-4.x/ast/parser/main/normalizer-data.js +14 -0
  103. package/slicing/criterion/parse.d.ts +1 -1
  104. package/statistics/summarizer/post-process/clusterer.d.ts +1 -1
  105. package/util/ansi.js +9 -2
  106. package/util/time.d.ts +4 -0
  107. package/util/time.js +8 -0
  108. package/util/version.js +1 -1
  109. package/documentation/doc-util/doc-ms.d.ts +0 -1
  110. package/documentation/doc-util/doc-ms.js +0 -8
  111. package/r-bridge/lang-4.x/ast/parser/xml/input-format.d.ts +0 -39
  112. package/r-bridge/lang-4.x/ast/parser/xml/input-format.js +0 -38
  113. package/r-bridge/lang-4.x/ast/parser/xml/internal/control/normalize-if-then-else.d.ts +0 -15
  114. package/r-bridge/lang-4.x/ast/parser/xml/internal/loops/normalize-while.d.ts +0 -4
  115. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-delimiter.d.ts +0 -3
  116. package/r-bridge/lang-4.x/ast/parser/xml/internal/structure/normalize-expressions.d.ts +0 -10
  117. package/r-bridge/lang-4.x/ast/parser/xml/normalize-meta.d.ts +0 -47
  118. package/r-bridge/lang-4.x/ast/parser/xml/normalize-meta.js +0 -110
  119. /package/queries/{call-context-query → catalog/call-context-query}/call-context-query-format.js +0 -0
  120. /package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/loops/normalize-break.js +0 -0
  121. /package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/loops/normalize-next.js +0 -0
  122. /package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/loops/normalize-repeat.js +0 -0
  123. /package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/operators/normalize-unary.js +0 -0
  124. /package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/structure/normalize-delimiter.js +0 -0
  125. /package/r-bridge/lang-4.x/ast/parser/{xml → main}/internal/structure/normalize-expressions.js +0 -0
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeIdMapQuery = executeIdMapQuery;
4
+ const log_1 = require("../../../util/log");
5
+ function executeIdMapQuery({ ast }, queries) {
6
+ if (queries.length !== 1) {
7
+ log_1.log.warn('Id-Map query expects only up to one query, but got', queries.length);
8
+ }
9
+ return {
10
+ '.meta': {
11
+ /* there is no sense in measuring a get */
12
+ timing: 0
13
+ },
14
+ idMap: ast.idMap
15
+ };
16
+ }
17
+ //# sourceMappingURL=id-map-query-executor.js.map
@@ -0,0 +1,8 @@
1
+ import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
2
+ import type { AstIdMap } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
3
+ export interface IdMapQuery extends BaseQueryFormat {
4
+ readonly type: 'id-map';
5
+ }
6
+ export interface IdMapQueryResult extends BaseQueryResult {
7
+ readonly idMap: AstIdMap;
8
+ }
@@ -1,3 +1,3 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=normalizer-data.js.map
3
+ //# sourceMappingURL=id-map-query-format.js.map
@@ -0,0 +1,3 @@
1
+ import type { BasicQueryData } from '../../query';
2
+ import type { NormalizedAstQuery, NormalizedAstQueryResult } from './normalized-ast-query-format';
3
+ export declare function executeNormalizedAstQuery({ ast }: BasicQueryData, queries: readonly NormalizedAstQuery[]): NormalizedAstQueryResult;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeNormalizedAstQuery = executeNormalizedAstQuery;
4
+ const log_1 = require("../../../util/log");
5
+ function executeNormalizedAstQuery({ ast }, queries) {
6
+ if (queries.length !== 1) {
7
+ log_1.log.warn('Normalized-Ast query expects only up to one query, but got', queries.length);
8
+ }
9
+ return {
10
+ '.meta': {
11
+ /* there is no sense in measuring a get */
12
+ timing: 0
13
+ },
14
+ normalized: ast
15
+ };
16
+ }
17
+ //# sourceMappingURL=normalized-ast-query-executor.js.map
@@ -0,0 +1,11 @@
1
+ import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
2
+ import type { NormalizedAst } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
3
+ /**
4
+ * Simple re-returns the normalized AST of the analysis.
5
+ */
6
+ export interface NormalizedAstQuery extends BaseQueryFormat {
7
+ readonly type: 'normalized-ast';
8
+ }
9
+ export interface NormalizedAstQueryResult extends BaseQueryResult {
10
+ readonly normalized: NormalizedAst;
11
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=normalized-ast-query-format.js.map
@@ -0,0 +1,4 @@
1
+ import type { BasicQueryData } from '../../query';
2
+ import type { StaticSliceQuery, StaticSliceQueryResult } from './static-slice-query-format';
3
+ export declare function fingerPrintOfQuery(query: StaticSliceQuery): string;
4
+ export declare function executeStaticSliceClusterQuery({ graph, ast }: BasicQueryData, queries: readonly StaticSliceQuery[]): StaticSliceQueryResult;
@@ -0,0 +1,40 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.fingerPrintOfQuery = fingerPrintOfQuery;
4
+ exports.executeStaticSliceClusterQuery = executeStaticSliceClusterQuery;
5
+ const static_slicer_1 = require("../../../slicing/static/static-slicer");
6
+ const reconstruct_1 = require("../../../reconstruct/reconstruct");
7
+ const auto_select_defaults_1 = require("../../../reconstruct/auto-select/auto-select-defaults");
8
+ const magic_comments_1 = require("../../../reconstruct/auto-select/magic-comments");
9
+ const log_1 = require("../../../util/log");
10
+ function fingerPrintOfQuery(query) {
11
+ return JSON.stringify(query);
12
+ }
13
+ function executeStaticSliceClusterQuery({ graph, ast }, queries) {
14
+ const start = Date.now();
15
+ const results = {};
16
+ for (const query of queries) {
17
+ const key = fingerPrintOfQuery(query);
18
+ if (results[key]) {
19
+ log_1.log.warn(`Duplicate Key for slicing-query: ${key}, skipping...`);
20
+ }
21
+ const { criteria, noReconstruction, noMagicComments } = query;
22
+ const slice = (0, static_slicer_1.staticSlicing)(graph, ast, criteria);
23
+ if (noReconstruction) {
24
+ results[key] = { slice };
25
+ }
26
+ else {
27
+ results[key] = {
28
+ slice,
29
+ reconstruct: (0, reconstruct_1.reconstructToCode)(ast, slice.result, noMagicComments ? auto_select_defaults_1.doNotAutoSelect : (0, magic_comments_1.makeMagicCommentHandler)(auto_select_defaults_1.doNotAutoSelect))
30
+ };
31
+ }
32
+ }
33
+ return {
34
+ '.meta': {
35
+ timing: Date.now() - start
36
+ },
37
+ results
38
+ };
39
+ }
40
+ //# sourceMappingURL=static-slice-query-executor.js.map
@@ -0,0 +1,24 @@
1
+ import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
2
+ import type { PipelineOutput } from '../../../core/steps/pipeline/pipeline';
3
+ import type { DEFAULT_DATAFLOW_PIPELINE, DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE, DEFAULT_SLICING_PIPELINE } from '../../../core/steps/pipeline/default-pipelines';
4
+ import type { SlicingCriteria } from '../../../slicing/criterion/parse';
5
+ /** Calculates and returns all clusters encountered in the dataflow graph. */
6
+ export interface StaticSliceQuery extends BaseQueryFormat {
7
+ readonly type: 'static-slice';
8
+ /** The slicing criteria to use */
9
+ readonly criteria: SlicingCriteria;
10
+ /** do not reconstruct the slice into readable code */
11
+ readonly noReconstruction?: boolean;
12
+ /** Should the magic comments (force-including lines within the slice) be ignored? */
13
+ readonly noMagicComments?: boolean;
14
+ }
15
+ export interface StaticSliceQueryResult extends BaseQueryResult {
16
+ /**
17
+ * only contains the results of the slice steps to not repeat ourselves, this does not contain the reconstruction
18
+ * if you set the {@link SliceQuery#noReconstruction|noReconstruction} flag.
19
+ *
20
+ * The keys are serialized versions of the used queries (i.e., the result of `JSON.stringify`).
21
+ * This implies that multiple slice queries with the same query configuration will _not_ be re-executed.
22
+ */
23
+ results: Record<string, Omit<PipelineOutput<typeof DEFAULT_SLICING_PIPELINE>, keyof PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>> | Omit<PipelineOutput<typeof DEFAULT_SLICE_WITHOUT_RECONSTRUCT_PIPELINE>, keyof PipelineOutput<typeof DEFAULT_DATAFLOW_PIPELINE>>>;
24
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=static-slice-query-format.js.map
@@ -1,5 +1,10 @@
1
1
  import Joi from 'joi';
2
2
  export declare const CallContextQuerySchema: Joi.ObjectSchema<any>;
3
+ export declare const DataflowQuerySchema: Joi.ObjectSchema<any>;
4
+ export declare const IdMapQuerySchema: Joi.ObjectSchema<any>;
5
+ export declare const NormalizedAstQuerySchema: Joi.ObjectSchema<any>;
6
+ export declare const DataflowClusterQuerySchema: Joi.ObjectSchema<any>;
7
+ export declare const StaticSliceQuerySchema: Joi.ObjectSchema<any>;
3
8
  export declare const SupportedQueriesSchema: Joi.AlternativesSchema<any>;
4
9
  export declare const CompoundQuerySchema: Joi.ObjectSchema<any>;
5
10
  export declare const VirtualQuerySchema: Joi.AlternativesSchema<any>;
@@ -3,12 +3,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
3
3
  return (mod && mod.__esModule) ? mod : { "default": mod };
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.QueriesSchema = exports.AnyQuerySchema = exports.VirtualQuerySchema = exports.CompoundQuerySchema = exports.SupportedQueriesSchema = exports.CallContextQuerySchema = void 0;
6
+ exports.QueriesSchema = exports.AnyQuerySchema = exports.VirtualQuerySchema = exports.CompoundQuerySchema = exports.SupportedQueriesSchema = exports.StaticSliceQuerySchema = exports.DataflowClusterQuerySchema = exports.NormalizedAstQuerySchema = exports.IdMapQuerySchema = exports.DataflowQuerySchema = exports.CallContextQuerySchema = void 0;
7
7
  const joi_1 = __importDefault(require("joi"));
8
- const call_context_query_format_1 = require("./call-context-query/call-context-query-format");
8
+ const call_context_query_format_1 = require("./catalog/call-context-query/call-context-query-format");
9
9
  exports.CallContextQuerySchema = joi_1.default.object({
10
10
  type: joi_1.default.string().valid('call-context').required().description('The type of the query.'),
11
11
  callName: joi_1.default.string().required().description('Regex regarding the function name!'),
12
+ callNameExact: joi_1.default.boolean().optional().description('Should we automatically add the `^` and `$` anchors to the regex to make it an exact match?'),
12
13
  kind: joi_1.default.string().optional().description('The kind of the call, this can be used to group calls together (e.g., linking `plot` to `visualize`). Defaults to `.`'),
13
14
  subkind: joi_1.default.string().optional().description('The subkind of the call, this can be used to uniquely identify the respective call type when grouping the output (e.g., the normalized name, linking `ggplot` to `plot`). Defaults to `.`'),
14
15
  callTargets: joi_1.default.string().valid(...Object.values(call_context_query_format_1.CallTargets)).optional().description('Call targets the function may have. This defaults to `any`. Request this specifically to gain all call targets we can resolve.'),
@@ -18,7 +19,25 @@ exports.CallContextQuerySchema = joi_1.default.object({
18
19
  callName: joi_1.default.string().required().description('Regex regarding the function name of the last call. Similar to `callName`, strings are interpreted as a regular expression.')
19
20
  }).optional().description('Links the current call to the last call of the given kind. This way, you can link a call like `points` to the latest graphics plot etc.')
20
21
  }).description('Call context query used to find calls in the dataflow graph');
21
- exports.SupportedQueriesSchema = joi_1.default.alternatives(exports.CallContextQuerySchema).description('Supported queries');
22
+ exports.DataflowQuerySchema = joi_1.default.object({
23
+ type: joi_1.default.string().valid('dataflow').required().description('The type of the query.'),
24
+ }).description('The dataflow query simply returns the dataflow graph, there is no need to pass it multiple times!');
25
+ exports.IdMapQuerySchema = joi_1.default.object({
26
+ type: joi_1.default.string().valid('id-map').required().description('The type of the query.'),
27
+ }).description('The id map query retrieves the id map from the normalized AST.');
28
+ exports.NormalizedAstQuerySchema = joi_1.default.object({
29
+ type: joi_1.default.string().valid('normalized-ast').required().description('The type of the query.'),
30
+ }).description('The normalized AST query simply returns the normalized AST, there is no need to pass it multiple times!');
31
+ exports.DataflowClusterQuerySchema = joi_1.default.object({
32
+ type: joi_1.default.string().valid('dataflow-cluster').required().description('The type of the query.'),
33
+ }).description('The cluster query calculates and returns all clusters in the dataflow graph.');
34
+ exports.StaticSliceQuerySchema = joi_1.default.object({
35
+ type: joi_1.default.string().valid('static-slice').required().description('The type of the query.'),
36
+ criteria: joi_1.default.array().items(joi_1.default.string()).min(0).required().description('The slicing criteria to use.'),
37
+ noReconstruction: joi_1.default.boolean().optional().description('Do not reconstruct the slice into readable code.'),
38
+ noMagicComments: joi_1.default.boolean().optional().description('Should the magic comments (force-including lines within the slice) be ignored?')
39
+ }).description('Slice query used to slice the dataflow graph');
40
+ exports.SupportedQueriesSchema = joi_1.default.alternatives(exports.CallContextQuerySchema, exports.DataflowQuerySchema, exports.IdMapQuerySchema, exports.NormalizedAstQuerySchema, exports.DataflowClusterQuerySchema, exports.StaticSliceQuerySchema).description('Supported queries');
22
41
  exports.CompoundQuerySchema = joi_1.default.object({
23
42
  type: joi_1.default.string().valid('compound').required().description('The type of the query.'),
24
43
  query: joi_1.default.string().required().description('The query to run on the file analysis information.'),
@@ -1,11 +1,21 @@
1
- import type { CallContextQuery } from './call-context-query/call-context-query-format';
1
+ import type { CallContextQuery } from './catalog/call-context-query/call-context-query-format';
2
2
  import type { DataflowGraph } from '../dataflow/graph/graph';
3
3
  import type { BaseQueryFormat, BaseQueryResult } from './base-query-format';
4
- import { executeCallContextQueries } from './call-context-query/call-context-query-executor';
4
+ import { executeCallContextQueries } from './catalog/call-context-query/call-context-query-executor';
5
5
  import type { VirtualQueryArgumentsWithType } from './virtual-query/virtual-queries';
6
6
  import type { VirtualCompoundConstraint } from './virtual-query/compound-query';
7
7
  import type { NormalizedAst } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
8
- export type Query = CallContextQuery;
8
+ import { executeDataflowQuery } from './catalog/dataflow-query/dataflow-query-executor';
9
+ import type { DataflowQuery } from './catalog/dataflow-query/dataflow-query-format';
10
+ import { executeIdMapQuery } from './catalog/id-map-query/id-map-query-executor';
11
+ import type { IdMapQuery } from './catalog/id-map-query/id-map-query-format';
12
+ import { executeNormalizedAstQuery } from './catalog/normalized-ast-query/normalized-ast-query-executor';
13
+ import type { NormalizedAstQuery } from './catalog/normalized-ast-query/normalized-ast-query-format';
14
+ import type { DataflowClusterQuery } from './catalog/cluster-query/cluster-query-format';
15
+ import { executeDataflowClusterQuery } from './catalog/cluster-query/cluster-query-executor';
16
+ import type { StaticSliceQuery } from './catalog/static-slice-query/static-slice-query-format';
17
+ import { executeStaticSliceClusterQuery } from './catalog/static-slice-query/static-slice-query-executor';
18
+ export type Query = CallContextQuery | DataflowQuery | NormalizedAstQuery | IdMapQuery | DataflowClusterQuery | StaticSliceQuery;
9
19
  export type QueryArgumentsWithType<QueryType extends BaseQueryFormat['type']> = Query & {
10
20
  type: QueryType;
11
21
  };
@@ -19,6 +29,11 @@ type SupportedQueries = {
19
29
  };
20
30
  export declare const SupportedQueries: {
21
31
  readonly 'call-context': typeof executeCallContextQueries;
32
+ readonly dataflow: typeof executeDataflowQuery;
33
+ readonly 'id-map': typeof executeIdMapQuery;
34
+ readonly 'normalized-ast': typeof executeNormalizedAstQuery;
35
+ readonly 'dataflow-cluster': typeof executeDataflowClusterQuery;
36
+ readonly 'static-slice': typeof executeStaticSliceClusterQuery;
22
37
  };
23
38
  export type SupportedQueryTypes = keyof typeof SupportedQueries;
24
39
  export type QueryResult<Type extends Query['type']> = ReturnType<typeof SupportedQueries[Type]>;
@@ -27,7 +42,7 @@ export type QueryResults<Base extends SupportedQueryTypes> = {
27
42
  readonly [QueryType in Base]: QueryResult<QueryType>;
28
43
  } & BaseQueryResult;
29
44
  type OmitFromValues<T, K extends string | number | symbol> = {
30
- [P in keyof T]: Omit<T[P], K>;
45
+ [P in keyof T]?: Omit<T[P], K>;
31
46
  };
32
47
  export type QueryResultsWithoutMeta<Queries extends Query> = OmitFromValues<Omit<QueryResults<Queries['type']>, '.meta'>, '.meta'>;
33
48
  export type Queries<Base extends SupportedQueryTypes, VirtualArguments extends VirtualCompoundConstraint<Base> = VirtualCompoundConstraint<Base>> = readonly (QueryArgumentsWithType<Base> | VirtualQueryArgumentsWithType<Base, VirtualArguments>)[];
package/queries/query.js CHANGED
@@ -3,11 +3,21 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SupportedQueries = void 0;
4
4
  exports.executeQueriesOfSameType = executeQueriesOfSameType;
5
5
  exports.executeQueries = executeQueries;
6
- const call_context_query_executor_1 = require("./call-context-query/call-context-query-executor");
6
+ const call_context_query_executor_1 = require("./catalog/call-context-query/call-context-query-executor");
7
7
  const assert_1 = require("../util/assert");
8
8
  const virtual_queries_1 = require("./virtual-query/virtual-queries");
9
+ const dataflow_query_executor_1 = require("./catalog/dataflow-query/dataflow-query-executor");
10
+ const id_map_query_executor_1 = require("./catalog/id-map-query/id-map-query-executor");
11
+ const normalized_ast_query_executor_1 = require("./catalog/normalized-ast-query/normalized-ast-query-executor");
12
+ const cluster_query_executor_1 = require("./catalog/cluster-query/cluster-query-executor");
13
+ const static_slice_query_executor_1 = require("./catalog/static-slice-query/static-slice-query-executor");
9
14
  exports.SupportedQueries = {
10
- 'call-context': call_context_query_executor_1.executeCallContextQueries
15
+ 'call-context': call_context_query_executor_1.executeCallContextQueries,
16
+ 'dataflow': dataflow_query_executor_1.executeDataflowQuery,
17
+ 'id-map': id_map_query_executor_1.executeIdMapQuery,
18
+ 'normalized-ast': normalized_ast_query_executor_1.executeNormalizedAstQuery,
19
+ 'dataflow-cluster': cluster_query_executor_1.executeDataflowClusterQuery,
20
+ 'static-slice': static_slice_query_executor_1.executeStaticSliceClusterQuery
11
21
  };
12
22
  function executeQueriesOfSameType(data, ...queries) {
13
23
  (0, assert_1.guard)(queries.length > 0, 'At least one query must be provided');
@@ -1,17 +1,41 @@
1
+ import { RawRType } from '../../model/type';
1
2
  export declare const RootId = 0;
2
- export interface Entry extends Record<string, unknown> {
3
- line1: number;
4
- col1: number;
5
- line2: number;
6
- col2: number;
7
- id: number;
8
- parent: number;
9
- token: string;
10
- terminal: boolean;
11
- text: string;
12
- children?: Entry[];
3
+ /**
4
+ * Entry type - shared between CSV and JSON entries.
5
+ * These include position, token, and text.
6
+ */
7
+ interface Entry extends Record<string, unknown> {
8
+ readonly line1: number;
9
+ readonly col1: number;
10
+ readonly line2: number;
11
+ readonly col2: number;
12
+ readonly token: string;
13
+ readonly text: string;
14
+ }
15
+ /**
16
+ * CsvEntry type - mapping of ParsedDataRow to a JS object structure.
17
+ * Contains construction information - whether we deal with a terminal, IDs, and children.
18
+ */
19
+ export interface CsvEntry extends Entry {
20
+ readonly id: number;
21
+ readonly parent: number;
22
+ readonly terminal: boolean;
23
+ children?: CsvEntry[];
13
24
  }
14
25
  /**
15
- * Parses the given data and sets child relationship, return the list of root entries (with a parent of {@link RootId}).
26
+ * Type-safe object structure that we work with during normalization.
27
+ * Has Children (empty list indicates no children).
16
28
  */
17
- export declare function prepareParsedData(data: string): Entry[];
29
+ export interface JsonEntry extends Entry {
30
+ readonly children: JsonEntry[];
31
+ }
32
+ /**
33
+ * Named JSON entries - these also have a RawRType assigned to them.
34
+ */
35
+ export interface NamedJsonEntry {
36
+ name: RawRType;
37
+ content: JsonEntry;
38
+ }
39
+ export declare function prepareParsedData(data: string): CsvEntry[];
40
+ export declare function convertPreparedParsedData(roots: readonly CsvEntry[]): JsonEntry;
41
+ export {};
@@ -2,12 +2,11 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RootId = void 0;
4
4
  exports.prepareParsedData = prepareParsedData;
5
+ exports.convertPreparedParsedData = convertPreparedParsedData;
5
6
  const retriever_1 = require("../../../../retriever");
6
7
  const assert_1 = require("../../../../../util/assert");
8
+ const type_1 = require("../../model/type");
7
9
  exports.RootId = 0;
8
- /**
9
- * Parses the given data and sets child relationship, return the list of root entries (with a parent of {@link RootId}).
10
- */
11
10
  function prepareParsedData(data) {
12
11
  let json;
13
12
  try {
@@ -26,9 +25,10 @@ function prepareParsedData(data) {
26
25
  if (entry.parent != exports.RootId) {
27
26
  /** it turns out that comments may return a negative id pair to their parent */
28
27
  const parent = ret.get(Math.abs(entry.parent));
29
- (0, assert_1.guard)(parent !== undefined, () => `Could not find parent ${entry.parent} for entry ${entry.id}`);
30
- parent.children ??= [];
31
- parent.children.push(entry);
28
+ if (parent) {
29
+ parent.children ??= [];
30
+ parent.children.push(entry);
31
+ }
32
32
  }
33
33
  else {
34
34
  roots.push(entry);
@@ -36,4 +36,57 @@ function prepareParsedData(data) {
36
36
  }
37
37
  return roots;
38
38
  }
39
+ function convertPreparedParsedData(roots) {
40
+ const partialEntry = {
41
+ token: type_1.RawRType.ExpressionList,
42
+ text: '',
43
+ id: exports.RootId,
44
+ parent: exports.RootId
45
+ };
46
+ // if we don't have children, this is simple
47
+ if (roots.length <= 0) {
48
+ return {
49
+ ...partialEntry,
50
+ line1: 1,
51
+ col1: 1,
52
+ line2: 1,
53
+ col2: 1,
54
+ children: []
55
+ };
56
+ }
57
+ // Locate start, end of a source file (order children in advance).
58
+ const rootEntries = [...roots].sort(orderOf);
59
+ const start = rootEntries[0];
60
+ const end = rootEntries[rootEntries.length - 1];
61
+ // Construct CsvEntry for the root, handling empty input.
62
+ const csvParent = {
63
+ ...partialEntry,
64
+ line1: start?.line1 ?? 1,
65
+ col1: start?.col1 ?? 1,
66
+ line2: end?.line2 ?? 1,
67
+ col2: end?.col2 ?? 1,
68
+ children: rootEntries,
69
+ terminal: false
70
+ };
71
+ // Return actual value.
72
+ return convertEntry(csvParent);
73
+ }
74
+ function convertEntry(csvEntry) {
75
+ return {
76
+ ...csvEntry,
77
+ // check and recursively iterate children
78
+ children: csvEntry.children?.sort(orderOf).map(convertEntry) ?? []
79
+ };
80
+ }
81
+ /**
82
+ * we sort children the same way xmlparsedata does (by line, by column, by inverse end line, by inverse end column, by terminal state, by combined "start" tiebreaker value)
83
+ * (https://github.com/r-lib/xmlparsedata/blob/v1.0.5/R/package.R#L120)
84
+ */
85
+ function orderOf(c1, c2) {
86
+ return c1.line1 - c2.line1 || c1.col1 - c2.col1 || c2.line2 - c1.line2 || c2.col2 - c1.col2 || Number(c1.terminal) - Number(c2.terminal) || sortTiebreak(c1) - sortTiebreak(c2);
87
+ }
88
+ function sortTiebreak({ line1, col1, col2 }) {
89
+ // see https://github.com/r-lib/xmlparsedata/blob/v1.0.5/R/package.R#L86
90
+ return line1 * (Math.max(col1, col2) + 1) + col1;
91
+ }
39
92
  //# sourceMappingURL=format.js.map
@@ -1,7 +1,4 @@
1
- import type { Entry } from './format';
2
1
  import type { IdGenerator, NormalizedAst } from '../../model/processing/decorate';
3
2
  import type { NoInfo } from '../../model/model';
4
- import type { XmlBasedJson } from '../xml/input-format';
5
3
  export declare const parseLog: import("tslog").Logger<import("tslog").ILogObj>;
6
4
  export declare function normalize(jsonString: string, getId?: IdGenerator<NoInfo>): NormalizedAst;
7
- export declare function convertPreparedParsedData(rootEntries: Entry[]): XmlBasedJson;
@@ -2,52 +2,14 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.parseLog = void 0;
4
4
  exports.normalize = normalize;
5
- exports.convertPreparedParsedData = convertPreparedParsedData;
6
5
  const format_1 = require("./format");
7
6
  const log_1 = require("../../../../../util/log");
8
7
  const decorate_1 = require("../../model/processing/decorate");
9
- const normalize_root_1 = require("../xml/internal/structure/normalize-root");
10
- const input_format_1 = require("../xml/input-format");
11
- const type_1 = require("../../model/type");
8
+ const normalize_root_1 = require("../main/internal/structure/normalize-root");
12
9
  exports.parseLog = log_1.log.getSubLogger({ name: 'ast-parser' });
13
10
  function normalize(jsonString, getId = (0, decorate_1.deterministicCountingIdGenerator)(0)) {
14
11
  const data = { currentRange: undefined, currentLexeme: undefined };
15
- const object = convertPreparedParsedData((0, format_1.prepareParsedData)(jsonString));
12
+ const object = (0, format_1.convertPreparedParsedData)((0, format_1.prepareParsedData)(jsonString));
16
13
  return (0, decorate_1.decorateAst)((0, normalize_root_1.normalizeRootObjToAst)(data, object), getId);
17
14
  }
18
- function convertPreparedParsedData(rootEntries) {
19
- return {
20
- [type_1.RawRType.ExpressionList]: {
21
- [input_format_1.nameKey]: type_1.RawRType.ExpressionList,
22
- [input_format_1.childrenKey]: rootEntries.map(convertEntry)
23
- }
24
- };
25
- }
26
- function convertEntry(csvEntry) {
27
- const xmlEntry = {
28
- [input_format_1.nameKey]: csvEntry.token,
29
- [input_format_1.attributesKey]: {
30
- 'line1': csvEntry.line1,
31
- 'col1': csvEntry.col1,
32
- 'line2': csvEntry.line2,
33
- 'col2': csvEntry.col2
34
- }
35
- };
36
- if (csvEntry.text) {
37
- xmlEntry[input_format_1.contentKey] = csvEntry.text;
38
- }
39
- // check and recursively iterate children
40
- if (csvEntry.children && csvEntry.children.length > 0) {
41
- xmlEntry[input_format_1.childrenKey] = csvEntry.children
42
- // we sort children the same way xmlparsedata does (by line, by column, by inverse end line, by inverse end column, by terminal state, by combined "start" tiebreaker value)
43
- // (https://github.com/r-lib/xmlparsedata/blob/main/R/package.R#L153C72-L153C78)
44
- .sort((c1, c2) => c1.line1 - c2.line1 || c1.col1 - c2.col1 || c2.line2 - c1.line2 || c2.col2 - c1.col2 || Number(c1.terminal) - Number(c2.terminal) || sortTiebreak(c1) - sortTiebreak(c2))
45
- .map(convertEntry);
46
- }
47
- return xmlEntry;
48
- }
49
- function sortTiebreak(entry) {
50
- // see https://github.com/r-lib/xmlparsedata/blob/main/R/package.R#L110C5-L110C11
51
- return entry.line1 * (Math.max(entry.col1, entry.col2) + 1) + entry.col1;
52
- }
53
15
  //# sourceMappingURL=parser.js.map
@@ -0,0 +1,15 @@
1
+ import type { NormalizerData } from '../../normalizer-data';
2
+ import type { RIfThenElse } from '../../../../model/nodes/r-if-then-else';
3
+ import type { NamedJsonEntry } from '../../../json/format';
4
+ /**
5
+ * Try to parse the construct as a {@link RIfThenElse}.
6
+ */
7
+ export declare function tryNormalizeIfThenElse(data: NormalizerData, [ifT, lpT, cT, rpT, tT, eT, ebT]: [
8
+ ifToken: NamedJsonEntry,
9
+ leftParen: NamedJsonEntry,
10
+ condition: NamedJsonEntry,
11
+ rightParen: NamedJsonEntry,
12
+ then: NamedJsonEntry,
13
+ elseToken: NamedJsonEntry,
14
+ elseBlock: NamedJsonEntry
15
+ ]): RIfThenElse | undefined;
@@ -1,7 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tryNormalizeIfThenElse = tryNormalizeIfThenElse;
4
- const parser_1 = require("../../../json/parser");
5
4
  const normalize_if_then_1 = require("./normalize-if-then");
6
5
  const assert_1 = require("../../../../../../../util/assert");
7
6
  const normalize_meta_1 = require("../../normalize-meta");
@@ -10,17 +9,15 @@ const type_1 = require("../../../../model/type");
10
9
  /**
11
10
  * Try to parse the construct as a {@link RIfThenElse}.
12
11
  */
13
- function tryNormalizeIfThenElse(data, tokens) {
12
+ function tryNormalizeIfThenElse(data, [ifT, lpT, cT, rpT, tT, eT, ebT]) {
14
13
  // we start by parsing a regular if-then structure
15
- parser_1.parseLog.trace('trying to parse if-then-else structure');
16
- const parsedIfThen = (0, normalize_if_then_1.tryNormalizeIfThen)(data, [tokens[0], tokens[1], tokens[2], tokens[3], tokens[4]]);
14
+ const parsedIfThen = (0, normalize_if_then_1.tryNormalizeIfThen)(data, [ifT, lpT, cT, rpT, tT]);
17
15
  if (parsedIfThen === undefined) {
18
16
  return undefined;
19
17
  }
20
- parser_1.parseLog.trace('if-then part successful, now parsing else part');
21
- (0, assert_1.guard)(tokens[5].name === type_1.RawRType.Else, () => `expected else token for if-then-else but found ${JSON.stringify(tokens[5])}`);
22
- const parsedElse = (0, normalize_single_node_1.normalizeSingleNode)(data, tokens[6]);
23
- (0, assert_1.guard)(parsedElse.type !== type_1.RType.Delimiter, () => `unexpected missing else-part of if-then-else, received ${JSON.stringify([parsedIfThen, parsedElse])} for ${JSON.stringify(tokens)}`);
18
+ (0, assert_1.guard)(eT.name === type_1.RawRType.Else, () => `expected else token for if-then-else but found ${JSON.stringify(eT)}`);
19
+ const parsedElse = (0, normalize_single_node_1.normalizeSingleNode)(data, ebT);
20
+ (0, assert_1.guard)(parsedElse.type !== type_1.RType.Delimiter, () => `unexpected missing else-part of if-then-else, received ${JSON.stringify([parsedIfThen, parsedElse])} for ${JSON.stringify([ifT, lpT, cT, rpT, tT, eT, ebT])}`);
24
21
  return {
25
22
  ...parsedIfThen,
26
23
  otherwise: (0, normalize_meta_1.ensureExpressionList)(parsedElse)
@@ -1,13 +1,13 @@
1
1
  import type { NormalizerData } from '../../normalizer-data';
2
- import type { NamedXmlBasedJson } from '../../input-format';
3
2
  import type { RIfThenElse } from '../../../../model/nodes/r-if-then-else';
3
+ import type { NamedJsonEntry } from '../../../json/format';
4
4
  /**
5
5
  * Try to parse the construct as a {@link RIfThenElse}.
6
6
  */
7
- export declare function tryNormalizeIfThen(data: NormalizerData, tokens: [
8
- ifToken: NamedXmlBasedJson,
9
- leftParen: NamedXmlBasedJson,
10
- condition: NamedXmlBasedJson,
11
- rightParen: NamedXmlBasedJson,
12
- then: NamedXmlBasedJson
7
+ export declare function tryNormalizeIfThen(data: NormalizerData, [ifT, lpT, cT, rpT, tT]: [
8
+ ifToken: NamedJsonEntry,
9
+ leftParen: NamedJsonEntry,
10
+ condition: NamedJsonEntry,
11
+ rightParen: NamedJsonEntry,
12
+ then: NamedJsonEntry
13
13
  ]): RIfThenElse | undefined;
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.tryNormalizeIfThen = tryNormalizeIfThen;
4
- const input_format_1 = require("../../input-format");
4
+ const normalizer_data_1 = require("../../normalizer-data");
5
5
  const parser_1 = require("../../../json/parser");
6
6
  const normalize_meta_1 = require("../../normalize-meta");
7
7
  const type_1 = require("../../../../model/type");
@@ -9,24 +9,23 @@ const normalize_single_node_1 = require("../structure/normalize-single-node");
9
9
  /**
10
10
  * Try to parse the construct as a {@link RIfThenElse}.
11
11
  */
12
- function tryNormalizeIfThen(data, tokens) {
13
- parser_1.parseLog.trace('trying to parse if-then structure');
14
- if (tokens[0].name !== type_1.RawRType.If) {
12
+ function tryNormalizeIfThen(data, [ifT, lpT, cT, rpT, tT]) {
13
+ if (ifT.name !== type_1.RawRType.If) {
15
14
  parser_1.parseLog.debug('encountered non-if token for supposed if-then structure');
16
15
  return undefined;
17
16
  }
18
- else if (tokens[1].name !== type_1.RawRType.ParenLeft) {
19
- throw new input_format_1.XmlParseError(`expected left-parenthesis for if but found ${JSON.stringify(tokens[1])}`);
17
+ else if (lpT.name !== type_1.RawRType.ParenLeft) {
18
+ throw new normalizer_data_1.ParseError(`expected left-parenthesis for if but found ${JSON.stringify(lpT)}`);
20
19
  }
21
- else if (tokens[3].name !== type_1.RawRType.ParenRight) {
22
- throw new input_format_1.XmlParseError(`expected right-parenthesis for if but found ${JSON.stringify(tokens[3])}`);
20
+ else if (rpT.name !== type_1.RawRType.ParenRight) {
21
+ throw new normalizer_data_1.ParseError(`expected right-parenthesis for if but found ${JSON.stringify(rpT)}`);
23
22
  }
24
- const parsedCondition = (0, normalize_single_node_1.normalizeSingleNode)(data, tokens[2]);
25
- const parsedThen = (0, normalize_single_node_1.normalizeSingleNode)(data, tokens[4]);
23
+ const parsedCondition = (0, normalize_single_node_1.normalizeSingleNode)(data, cT);
24
+ const parsedThen = (0, normalize_single_node_1.normalizeSingleNode)(data, tT);
26
25
  if (parsedCondition.type === type_1.RType.Delimiter || parsedThen.type === type_1.RType.Delimiter) {
27
- throw new input_format_1.XmlParseError(`unexpected missing parts of if, received ${JSON.stringify([parsedCondition, parsedThen])} for ${JSON.stringify(tokens)}`);
26
+ throw new normalizer_data_1.ParseError(`unexpected missing parts of if, received ${JSON.stringify([parsedCondition, parsedThen])} for ${JSON.stringify([ifT, lpT, cT, rpT, tT])}`);
28
27
  }
29
- const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(tokens[0].content);
28
+ const { location, content } = (0, normalize_meta_1.retrieveMetaStructure)(ifT.content);
30
29
  return {
31
30
  type: type_1.RType.IfThenElse,
32
31
  condition: parsedCondition,
@@ -1,10 +1,10 @@
1
1
  import type { NormalizerData } from '../../normalizer-data';
2
- import type { XmlBasedJson } from '../../input-format';
3
2
  import type { RNode } from '../../../../model/model';
3
+ import type { JsonEntry } from '../../../json/format';
4
4
  /**
5
5
  * Returns an expression list if there are multiple children, otherwise returns the single child directly with no expr wrapper
6
6
  *
7
7
  * @param data - The data used by the parser (see {@link NormalizerData})
8
- * @param obj - The json object to extract the meta-information from
8
+ * @param entry - The JSON object to extract the meta-information from
9
9
  */
10
- export declare function normalizeExpression(data: NormalizerData, obj: XmlBasedJson): RNode;
10
+ export declare function normalizeExpression(data: NormalizerData, entry: JsonEntry): RNode;