@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,9 +1,9 @@
1
1
  import type { ResolveInfo } from '../../../dataflow/eval/resolve/alias-tracking';
2
- import type { DataflowGraph } from '../../../dataflow/graph/graph';
2
+ import { type DataflowGraph } from '../../../dataflow/graph/graph';
3
3
  import { RNode } from '../../../r-bridge/lang-4.x/ast/model/model';
4
- import type { RArgument } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-argument';
5
- import { type RFunctionArgument, type RFunctionCall, EmptyArgument } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
6
- import type { RSymbol } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
4
+ import { RArgument } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-argument';
5
+ import { type PotentiallyEmptyRArgument, type RFunctionCall, EmptyArgument } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
6
+ import { RSymbol } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol';
7
7
  import type { ParentInformation } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
8
8
  import { RNull } from '../../../r-bridge/lang-4.x/convert-values';
9
9
  import type { RParseRequest } from '../../../r-bridge/retriever';
@@ -44,14 +44,14 @@ export declare function filterValidNames(colnames: (string | undefined)[] | unde
44
44
  * @param info - Argument resolve information
45
45
  * @returns The resolved value of the argument or `undefined`
46
46
  */
47
- export declare function getArgumentValue<T>(args: readonly RFunctionArgument<ParentInformation>[], argument: FunctionParameterLocation<T> | string, info: ResolveInfo): string | number | boolean | (string | number | boolean)[] | T | undefined;
47
+ export declare function getArgumentValue<T>(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], argument: FunctionParameterLocation<T> | string, info: ResolveInfo): string | number | boolean | (string | number | boolean)[] | T | undefined;
48
48
  /**
49
49
  * Gets all effective argument from a list of arguments by removing all arguments whose names should be excluded.
50
50
  * @param args - The list of arguments to filter
51
51
  * @param excluded - The names of the arguments to exclude
52
52
  * @returns The filtered list of arguments
53
53
  */
54
- export declare function getEffectiveArgs(args: readonly RFunctionArgument<ParentInformation>[], excluded: string[]): readonly RFunctionArgument<ParentInformation>[];
54
+ export declare function getEffectiveArgs(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], excluded: readonly string[]): readonly PotentiallyEmptyRArgument<ParentInformation>[];
55
55
  /**
56
56
  * Gets an argument specified as {@link FunctionParameterLocation} from a list of arguments.
57
57
  * @param args - The arguments to get the requested argument from
@@ -59,14 +59,14 @@ export declare function getEffectiveArgs(args: readonly RFunctionArgument<Parent
59
59
  * @param info - Argument resolve information
60
60
  * @returns An argument matching the specified `argument` or `undefined`
61
61
  */
62
- export declare function getFunctionArgument(args: readonly RFunctionArgument<ParentInformation>[], argument: FunctionParameterLocation<unknown> | string, info: ResolveInfo): RFunctionArgument<ParentInformation> | undefined;
62
+ export declare function getFunctionArgument(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], argument: FunctionParameterLocation<unknown> | string, info: ResolveInfo): PotentiallyEmptyRArgument<ParentInformation> | undefined;
63
63
  /**
64
64
  * Get all function arguments of a function call node in the data flow graph.
65
65
  * @param node - The function call node to get the arguments for
66
66
  * @param dfg - The data flow graph for retrieving the arguments
67
67
  * @returns The arguments of the function call in the data flow graph
68
68
  */
69
- export declare function getFunctionArguments(node: RFunctionCall<ParentInformation>, dfg: DataflowGraph): readonly RFunctionArgument<ParentInformation>[];
69
+ export declare function getFunctionArguments(node: RFunctionCall<ParentInformation>, dfg: DataflowGraph): readonly PotentiallyEmptyRArgument<ParentInformation>[];
70
70
  /**
71
71
  * Gets all nested symbols in an expression that have no outgoing edges in the data flow graph.
72
72
  * @param expression - The expression to get the symbols from
@@ -81,7 +81,7 @@ export declare function getUnresolvedSymbolsInExpression(expression: RNode<Paren
81
81
  * @param info - Argument resolve information
82
82
  * @returns Whether the arguments contain any critical argument
83
83
  */
84
- export declare function hasCriticalArgument(args: readonly RFunctionArgument<ParentInformation>[], critical: (FunctionParameterLocation<unknown> | string)[] | undefined, info: ResolveInfo): boolean;
84
+ export declare function hasCriticalArgument(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], critical: (FunctionParameterLocation<unknown> | string)[] | undefined, info: ResolveInfo): boolean;
85
85
  /**
86
86
  * Checks if a given argument has an inferred data frame shape and therefore represents a data frame
87
87
  * @param arg - The argument to check
@@ -89,20 +89,14 @@ export declare function hasCriticalArgument(args: readonly RFunctionArgument<Par
89
89
  * @returns Whether the argument represents a data frame
90
90
  */
91
91
  export declare function isDataFrameArgument(arg: RNode<ParentInformation> | undefined, inference: DataFrameShapeInferenceVisitor): arg is RNode<ParentInformation>;
92
- export declare function isDataFrameArgument(arg: RFunctionArgument<ParentInformation> | undefined, inference: DataFrameShapeInferenceVisitor): arg is RArgument<ParentInformation> & {
92
+ export declare function isDataFrameArgument(arg: PotentiallyEmptyRArgument<ParentInformation> | undefined, inference: DataFrameShapeInferenceVisitor): arg is RArgument<ParentInformation> & {
93
93
  value: RNode<ParentInformation>;
94
94
  };
95
- /**
96
- * Checks whether a function argument is a names argument.
97
- */
98
- export declare function isNamedArgument(arg: RFunctionArgument<ParentInformation> | undefined): arg is RArgument<ParentInformation> & {
99
- name: RSymbol<ParentInformation>;
100
- };
101
95
  /**
102
96
  * Checks whether a node is `NULL` in R (represents a `NULL` symbol).
103
97
  */
104
98
  export declare function isRNull(node: RNode<ParentInformation> | undefined): node is RSymbol<ParentInformation, typeof RNull>;
105
- export declare function isRNull(node: RFunctionArgument<ParentInformation> | undefined): node is RArgument<ParentInformation> & {
99
+ export declare function isRNull(node: PotentiallyEmptyRArgument<ParentInformation> | undefined): node is RArgument<ParentInformation> & {
106
100
  value: RSymbol<ParentInformation, typeof RNull>;
107
101
  };
108
102
  /**
@@ -9,15 +9,16 @@ exports.getFunctionArguments = getFunctionArguments;
9
9
  exports.getUnresolvedSymbolsInExpression = getUnresolvedSymbolsInExpression;
10
10
  exports.hasCriticalArgument = hasCriticalArgument;
11
11
  exports.isDataFrameArgument = isDataFrameArgument;
12
- exports.isNamedArgument = isNamedArgument;
13
12
  exports.isRNull = isRNull;
14
13
  exports.isValidColName = isValidColName;
15
14
  exports.parseRequestContent = parseRequestContent;
15
+ const graph_1 = require("../../../dataflow/graph/graph");
16
16
  const vertex_1 = require("../../../dataflow/graph/vertex");
17
17
  const make_argument_1 = require("../../../dataflow/internal/process/functions/call/argument/make-argument");
18
18
  const model_1 = require("../../../r-bridge/lang-4.x/ast/model/model");
19
+ const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
19
20
  const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
20
- const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
21
+ const r_symbol_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-symbol");
21
22
  const convert_values_1 = require("../../../r-bridge/lang-4.x/convert-values");
22
23
  const assert_1 = require("../../../util/assert");
23
24
  const files_1 = require("../../../util/files");
@@ -84,7 +85,7 @@ function getArgumentValue(args, argument, info) {
84
85
  * @returns The filtered list of arguments
85
86
  */
86
87
  function getEffectiveArgs(args, excluded) {
87
- return args.filter(arg => arg === r_function_call_1.EmptyArgument || arg.name === undefined || !excluded.includes((0, resolve_args_1.unquoteArgument)(arg.name.content)));
88
+ return args.filter(arg => r_argument_1.RArgument.isEmpty(arg) || !r_argument_1.RArgument.isNamed(arg) || !excluded.includes((0, resolve_args_1.unquoteArgument)(arg.name.content)));
88
89
  }
89
90
  /**
90
91
  * Gets an argument specified as {@link FunctionParameterLocation} from a list of arguments.
@@ -114,11 +115,11 @@ function getFunctionArgument(args, argument, info) {
114
115
  */
115
116
  function getFunctionArguments(node, dfg) {
116
117
  const vertex = dfg.getVertex(node.info.id);
117
- if (vertex?.tag === vertex_1.VertexType.FunctionCall && dfg.idMap !== undefined) {
118
+ if ((0, vertex_1.isFunctionCallVertex)(vertex) && dfg.idMap !== undefined) {
118
119
  const idMap = dfg.idMap;
119
120
  return vertex.args
120
- .map(arg => arg === r_function_call_1.EmptyArgument ? arg : idMap.get(arg.nodeId))
121
- .map(arg => arg === r_function_call_1.EmptyArgument || arg?.type === type_1.RType.Argument ? arg : (0, make_argument_1.toUnnamedArgument)(arg, idMap));
121
+ .map(arg => graph_1.FunctionArgument.isEmpty(arg) ? arg : idMap.get(arg.nodeId))
122
+ .map(arg => r_argument_1.RArgument.isEmpty(arg) || r_argument_1.RArgument.is(arg) ? arg : (0, make_argument_1.toUnnamedArgument)(arg, idMap));
122
123
  }
123
124
  return node.arguments;
124
125
  }
@@ -134,10 +135,12 @@ function getUnresolvedSymbolsInExpression(expression, dfg) {
134
135
  }
135
136
  const unresolvedSymbols = [];
136
137
  model_1.RNode.visitAst(expression, node => {
137
- if (node.type === type_1.RType.Symbol) {
138
+ if (r_symbol_1.RSymbol.is(node)) {
138
139
  const vertex = dfg.get(node.info.id);
139
- if ((0, vertex_1.isUseVertex)(vertex?.[0]) && vertex[1].size === 0) {
140
- unresolvedSymbols.push(identifier_1.Identifier.mapName(node.content, resolve_args_1.unquoteArgument));
140
+ const symbolName = identifier_1.Identifier.mapName(node.content, resolve_args_1.unquoteArgument);
141
+ // ignore symbols named ".", as they are used as argument placeholder in magrittr pipe operations
142
+ if ((0, vertex_1.isUseVertex)(vertex?.[0]) && vertex[1].size === 0 && symbolName !== '.') {
143
+ unresolvedSymbols.push(symbolName);
141
144
  }
142
145
  }
143
146
  });
@@ -169,17 +172,14 @@ function hasCriticalArgument(args, critical, info) {
169
172
  function isDataFrameArgument(arg, inference) {
170
173
  return arg !== r_function_call_1.EmptyArgument && inference.getAbstractValue(arg) !== undefined;
171
174
  }
172
- /**
173
- * Checks whether a function argument is a names argument.
174
- */
175
- function isNamedArgument(arg) {
176
- return arg !== r_function_call_1.EmptyArgument && arg?.name !== undefined;
177
- }
178
175
  function isRNull(node) {
179
- if (node === r_function_call_1.EmptyArgument || node?.type === type_1.RType.Argument) {
180
- return node !== r_function_call_1.EmptyArgument && isRNull(node.value);
176
+ if (r_argument_1.RArgument.isEmpty(node)) {
177
+ return false;
178
+ }
179
+ else if (r_argument_1.RArgument.is(node)) {
180
+ return isRNull(node.value);
181
181
  }
182
- return node?.type === type_1.RType.Symbol && node.content === convert_values_1.RNull;
182
+ return r_symbol_1.RSymbol.is(node) && node.content === convert_values_1.RNull;
183
183
  }
184
184
  /**
185
185
  * Checks whether a string is a valid columns name according to the flag `check.names` in R.
@@ -2,7 +2,7 @@ import { type ResolveInfo } from '../../../dataflow/eval/resolve/alias-tracking'
2
2
  import type { DataflowGraph } from '../../../dataflow/graph/graph';
3
3
  import type { ReadOnlyFlowrAnalyzerContext } from '../../../project/context/flowr-analyzer-context';
4
4
  import type { RNode } from '../../../r-bridge/lang-4.x/ast/model/model';
5
- import { type RFunctionArgument } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
5
+ import { type PotentiallyEmptyRArgument } from '../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call';
6
6
  import type { ParentInformation } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
7
7
  import type { DataFrameOperations, DataFrameShapeInferenceVisitor } from '../shape-inference';
8
8
  import { type FunctionParameterLocation } from './arguments';
@@ -23,61 +23,73 @@ declare const DataFrameFunctionMapper: {
23
23
  readonly mapper: typeof mapDataFrameCreate;
24
24
  readonly library: "base";
25
25
  readonly returnType: DataFrameType.DataFrame;
26
+ readonly alwaysDataFrame: true;
26
27
  };
27
28
  readonly 'as.data.frame': {
28
29
  readonly mapper: typeof mapDataFrameConvert;
29
30
  readonly library: "base";
30
31
  readonly returnType: DataFrameType.DataFrame;
32
+ readonly alwaysDataFrame: true;
31
33
  };
32
34
  readonly 'read.table': {
33
35
  readonly mapper: typeof mapDataFrameRead;
34
36
  readonly library: "utils";
35
37
  readonly returnType: DataFrameType.DataFrame;
38
+ readonly alwaysDataFrame: true;
36
39
  };
37
40
  readonly 'read.csv': {
38
41
  readonly mapper: typeof mapDataFrameRead;
39
42
  readonly library: "utils";
40
43
  readonly returnType: DataFrameType.DataFrame;
44
+ readonly alwaysDataFrame: true;
41
45
  };
42
46
  readonly 'read.csv2': {
43
47
  readonly mapper: typeof mapDataFrameRead;
44
48
  readonly library: "utils";
45
49
  readonly returnType: DataFrameType.DataFrame;
50
+ readonly alwaysDataFrame: true;
46
51
  };
47
52
  readonly 'read.delim': {
48
53
  readonly mapper: typeof mapDataFrameRead;
49
54
  readonly library: "utils";
50
55
  readonly returnType: DataFrameType.DataFrame;
56
+ readonly alwaysDataFrame: true;
51
57
  };
52
58
  readonly 'read.delim2': {
53
59
  readonly mapper: typeof mapDataFrameRead;
54
60
  readonly library: "utils";
55
61
  readonly returnType: DataFrameType.DataFrame;
62
+ readonly alwaysDataFrame: true;
56
63
  };
57
64
  readonly read_table: {
58
65
  readonly mapper: typeof mapDataFrameRead;
59
66
  readonly library: "readr";
60
67
  readonly returnType: DataFrameType.Tibble;
68
+ readonly alwaysDataFrame: true;
61
69
  };
62
70
  readonly read_csv: {
63
71
  readonly mapper: typeof mapDataFrameRead;
64
72
  readonly library: "readr";
65
73
  readonly returnType: DataFrameType.Tibble;
74
+ readonly alwaysDataFrame: true;
66
75
  };
67
76
  readonly read_csv2: {
68
77
  readonly mapper: typeof mapDataFrameRead;
69
78
  readonly library: "readr";
70
79
  readonly returnType: DataFrameType.Tibble;
80
+ readonly alwaysDataFrame: true;
71
81
  };
72
82
  readonly read_tsv: {
73
83
  readonly mapper: typeof mapDataFrameRead;
74
84
  readonly library: "readr";
75
85
  readonly returnType: DataFrameType.Tibble;
86
+ readonly alwaysDataFrame: true;
76
87
  };
77
88
  readonly read_delim: {
78
89
  readonly mapper: typeof mapDataFrameRead;
79
90
  readonly library: "readr";
80
91
  readonly returnType: DataFrameType.Tibble;
92
+ readonly alwaysDataFrame: true;
81
93
  };
82
94
  readonly cbind: {
83
95
  readonly mapper: typeof mapDataFrameColBind;
@@ -108,71 +120,85 @@ declare const DataFrameFunctionMapper: {
108
120
  readonly mapper: typeof mapDataFrameFilter;
109
121
  readonly library: "dplyr";
110
122
  readonly returnType: DataFrameType.DataFrame;
123
+ readonly alwaysDataFrame: true;
111
124
  };
112
125
  readonly select: {
113
126
  readonly mapper: typeof mapDataFrameSelect;
114
127
  readonly library: "dplyr";
115
128
  readonly returnType: DataFrameType.DataFrame;
129
+ readonly alwaysDataFrame: true;
116
130
  };
117
131
  readonly mutate: {
118
132
  readonly mapper: typeof mapDataFrameMutate;
119
133
  readonly library: "dplyr";
120
134
  readonly returnType: DataFrameType.DataFrame;
135
+ readonly alwaysDataFrame: true;
121
136
  };
122
137
  readonly transform: {
123
138
  readonly mapper: typeof mapDataFrameMutate;
124
139
  readonly library: "base";
125
140
  readonly returnType: DataFrameType.DataFrame;
141
+ readonly alwaysDataFrame: true;
126
142
  };
127
143
  readonly group_by: {
128
144
  readonly mapper: typeof mapDataFrameGroupBy;
129
145
  readonly library: "dplyr";
130
146
  readonly returnType: DataFrameType.Tibble;
147
+ readonly alwaysDataFrame: true;
131
148
  };
132
149
  readonly summarise: {
133
150
  readonly mapper: typeof mapDataFrameSummarize;
134
151
  readonly library: "dplyr";
135
152
  readonly returnType: DataFrameType.DataFrame;
153
+ readonly alwaysDataFrame: true;
136
154
  };
137
155
  readonly summarize: {
138
156
  readonly mapper: typeof mapDataFrameSummarize;
139
157
  readonly library: "dplyr";
140
158
  readonly returnType: DataFrameType.DataFrame;
159
+ readonly alwaysDataFrame: true;
141
160
  };
142
161
  readonly inner_join: {
143
162
  readonly mapper: typeof mapDataFrameJoin;
144
163
  readonly library: "dplyr";
145
164
  readonly returnType: DataFrameType.DataFrame;
165
+ readonly alwaysDataFrame: true;
146
166
  };
147
167
  readonly left_join: {
148
168
  readonly mapper: typeof mapDataFrameJoin;
149
169
  readonly library: "dplyr";
150
170
  readonly returnType: DataFrameType.DataFrame;
171
+ readonly alwaysDataFrame: true;
151
172
  };
152
173
  readonly right_join: {
153
174
  readonly mapper: typeof mapDataFrameJoin;
154
175
  readonly library: "dplyr";
155
176
  readonly returnType: DataFrameType.DataFrame;
177
+ readonly alwaysDataFrame: true;
156
178
  };
157
179
  readonly full_join: {
158
180
  readonly mapper: typeof mapDataFrameJoin;
159
181
  readonly library: "dplyr";
160
182
  readonly returnType: DataFrameType.DataFrame;
183
+ readonly alwaysDataFrame: true;
161
184
  };
162
185
  readonly merge: {
163
186
  readonly mapper: typeof mapDataFrameJoin;
164
187
  readonly library: "base";
165
188
  readonly returnType: DataFrameType.DataFrame;
189
+ readonly alwaysDataFrame: true;
166
190
  };
167
191
  readonly relocate: {
168
192
  readonly mapper: typeof mapDataFrameIdentity;
169
193
  readonly library: "dplyr";
170
194
  readonly returnType: DataFrameType.DataFrame;
195
+ readonly alwaysDataFrame: true;
171
196
  };
172
197
  readonly arrange: {
173
198
  readonly mapper: typeof mapDataFrameIdentity;
174
199
  readonly library: "dplyr";
175
200
  readonly returnType: DataFrameType.DataFrame;
201
+ readonly alwaysDataFrame: true;
176
202
  };
177
203
  };
178
204
  /** All currently supported data frame functions */
@@ -186,15 +212,15 @@ type DataFrameFunction = keyof typeof DataFrameFunctionMapper;
186
212
  * @returns The mapped abstract data frame operations for the function call, or `undefined` if the node does not represent a data frame function call
187
213
  */
188
214
  export declare function mapDataFrameFunctionCall<Name extends DataFrameFunction>(node: RNode<ParentInformation>, inference: DataFrameShapeInferenceVisitor, dfg: DataflowGraph, ctx: ReadOnlyFlowrAnalyzerContext): DataFrameOperations;
189
- declare function mapDataFrameCreate(args: readonly RFunctionArgument<ParentInformation>[], params: {
215
+ declare function mapDataFrameCreate(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
190
216
  checkNames: FunctionParameterLocation<boolean>;
191
217
  noDupNames: FunctionParameterLocation<boolean>;
192
218
  special: string[];
193
219
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
194
- declare function mapDataFrameConvert(args: readonly RFunctionArgument<ParentInformation>[], params: {
220
+ declare function mapDataFrameConvert(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
195
221
  dataFrame: FunctionParameterLocation;
196
222
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
197
- declare function mapDataFrameRead(args: readonly RFunctionArgument<ParentInformation>[], params: {
223
+ declare function mapDataFrameRead(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
198
224
  fileName: FunctionParameterLocation;
199
225
  text?: FunctionParameterLocation;
200
226
  header: FunctionParameterLocation<boolean>;
@@ -206,46 +232,46 @@ declare function mapDataFrameRead(args: readonly RFunctionArgument<ParentInforma
206
232
  noDupNames: FunctionParameterLocation<boolean>;
207
233
  noEmptyNames?: boolean;
208
234
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
209
- declare function mapDataFrameColBind(args: readonly RFunctionArgument<ParentInformation>[], params: {
235
+ declare function mapDataFrameColBind(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
210
236
  special: string[];
211
237
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
212
- declare function mapDataFrameRowBind(args: readonly RFunctionArgument<ParentInformation>[], params: {
238
+ declare function mapDataFrameRowBind(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
213
239
  special: string[];
214
240
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
215
- declare function mapDataFrameHeadTail(args: readonly RFunctionArgument<ParentInformation>[], params: {
241
+ declare function mapDataFrameHeadTail(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
216
242
  dataFrame: FunctionParameterLocation;
217
243
  amount: FunctionParameterLocation<number>;
218
244
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
219
- declare function mapDataFrameSubset(args: readonly RFunctionArgument<ParentInformation>[], params: {
245
+ declare function mapDataFrameSubset(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
220
246
  dataFrame: FunctionParameterLocation;
221
247
  subset: FunctionParameterLocation;
222
248
  select: FunctionParameterLocation;
223
249
  drop: FunctionParameterLocation<boolean>;
224
250
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
225
- declare function mapDataFrameFilter(args: readonly RFunctionArgument<ParentInformation>[], params: {
251
+ declare function mapDataFrameFilter(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
226
252
  dataFrame: FunctionParameterLocation;
227
253
  special: string[];
228
254
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
229
- declare function mapDataFrameSelect(args: readonly RFunctionArgument<ParentInformation>[], params: {
255
+ declare function mapDataFrameSelect(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
230
256
  dataFrame: FunctionParameterLocation;
231
257
  special: string[];
232
258
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
233
- declare function mapDataFrameMutate(args: readonly RFunctionArgument<ParentInformation>[], params: {
259
+ declare function mapDataFrameMutate(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
234
260
  dataFrame: FunctionParameterLocation;
235
261
  special: string[];
236
262
  checkNames?: boolean;
237
263
  noDupNames?: boolean;
238
264
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
239
- declare function mapDataFrameGroupBy(args: readonly RFunctionArgument<ParentInformation>[], params: {
265
+ declare function mapDataFrameGroupBy(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
240
266
  dataFrame: FunctionParameterLocation;
241
267
  by: FunctionParameterLocation;
242
268
  special: string[];
243
269
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
244
- declare function mapDataFrameSummarize(args: readonly RFunctionArgument<ParentInformation>[], params: {
270
+ declare function mapDataFrameSummarize(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
245
271
  dataFrame: FunctionParameterLocation;
246
272
  special: string[];
247
273
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
248
- declare function mapDataFrameJoin(args: readonly RFunctionArgument<ParentInformation>[], params: {
274
+ declare function mapDataFrameJoin(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
249
275
  dataFrame: FunctionParameterLocation;
250
276
  otherDataFrame: FunctionParameterLocation;
251
277
  by: FunctionParameterLocation;
@@ -253,7 +279,7 @@ declare function mapDataFrameJoin(args: readonly RFunctionArgument<ParentInforma
253
279
  joinLeft: FunctionParameterLocation<boolean>;
254
280
  joinRight: FunctionParameterLocation<boolean>;
255
281
  }, inference: DataFrameShapeInferenceVisitor, info: ResolveInfo): DataFrameOperations;
256
- declare function mapDataFrameIdentity(args: readonly RFunctionArgument<ParentInformation>[], params: {
282
+ declare function mapDataFrameIdentity(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
257
283
  dataFrame: FunctionParameterLocation;
258
284
  special: string[];
259
285
  disallowNamedArgs?: boolean;