@eagleoutice/flowr 2.10.1 → 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.
- package/README.md +27 -16
- package/abstract-interpretation/absint-visitor.d.ts +13 -8
- package/abstract-interpretation/absint-visitor.js +35 -26
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +1 -2
- package/abstract-interpretation/data-frame/dataframe-domain.js +14 -15
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +2 -15
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +11 -17
- package/abstract-interpretation/data-frame/mappers/arguments.js +18 -18
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +41 -15
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +74 -48
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +2 -1
- package/abstract-interpretation/data-frame/semantics.d.ts +1 -1
- package/abstract-interpretation/data-frame/semantics.js +31 -35
- package/abstract-interpretation/data-frame/shape-inference.js +1 -1
- package/abstract-interpretation/domains/interval-domain.d.ts +1 -0
- package/abstract-interpretation/domains/interval-domain.js +3 -0
- package/abstract-interpretation/domains/product-domain.d.ts +9 -0
- package/abstract-interpretation/domains/product-domain.js +26 -6
- package/abstract-interpretation/domains/state-abstract-domain.d.ts +36 -22
- package/abstract-interpretation/domains/state-abstract-domain.js +169 -62
- package/abstract-interpretation/unsupported-functions.d.ts +10 -0
- package/abstract-interpretation/unsupported-functions.js +45 -0
- package/benchmark/slicer.js +10 -13
- package/cli/flowr.js +1 -1
- package/control-flow/control-flow-graph.js +13 -9
- package/control-flow/semantic-cfg-guided-visitor.d.ts +6 -0
- package/control-flow/semantic-cfg-guided-visitor.js +6 -0
- package/dataflow/environments/built-in-proc-name.d.ts +6 -0
- package/dataflow/environments/built-in-proc-name.js +6 -0
- package/dataflow/environments/built-in.d.ts +7 -5
- package/dataflow/environments/built-in.js +2 -0
- package/dataflow/environments/default-builtin-config.d.ts +442 -6
- package/dataflow/environments/default-builtin-config.js +158 -3
- package/dataflow/environments/overwrite.js +2 -5
- package/dataflow/graph/df-helper.d.ts +14 -4
- package/dataflow/graph/df-helper.js +36 -6
- package/dataflow/graph/graph.d.ts +10 -0
- package/dataflow/graph/graph.js +12 -0
- package/dataflow/instrument/instrument-dataflow-count.d.ts +10 -0
- package/dataflow/instrument/instrument-dataflow-count.js +10 -0
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +4 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-access.d.ts +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +6 -17
- package/dataflow/internal/process/functions/call/built-in/built-in-get.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-library.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-list.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-local.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.d.ts +23 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +80 -12
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.d.ts +41 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-purrr-formula.js +179 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.d.ts +7 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-quote.js +62 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.d.ts +7 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-recall.js +15 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-register-hook.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-dispatch.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-seven-new-generic.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-s-three-dispatch.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-special-bin-op.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-stop-if-not.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-try-catch.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-vector.d.ts +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.d.ts +2 -2
- package/dataflow/internal/process/functions/call/common.d.ts +2 -2
- package/dataflow/internal/process/functions/call/common.js +4 -3
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +2 -2
- package/dataflow/internal/process/functions/call/named-call-handling.d.ts +2 -2
- package/documentation/wiki-absint.js +6 -5
- package/documentation/wiki-analyzer.js +0 -2
- package/documentation/wiki-linter.js +1 -0
- package/documentation/wiki-normalized-ast.js +7 -7
- package/linter/linter-rules.d.ts +24 -1
- package/linter/linter-rules.js +3 -1
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +3 -4
- package/linter/rules/roxygen-arguments.d.ts +35 -0
- package/linter/rules/roxygen-arguments.js +100 -0
- package/package.json +2 -3
- package/project/context/flowr-analyzer-context.d.ts +1 -8
- package/project/context/flowr-analyzer-context.js +1 -7
- package/project/context/flowr-analyzer-environment-context.d.ts +5 -0
- package/project/context/flowr-analyzer-environment-context.js +6 -0
- package/project/context/flowr-analyzer-files-context.d.ts +6 -0
- package/project/context/flowr-analyzer-files-context.js +4 -2
- package/project/flowr-analyzer-builder.js +1 -4
- package/queries/catalog/call-context-query/call-context-query-executor.d.ts +1 -1
- package/queries/catalog/call-context-query/call-context-query-executor.js +10 -5
- package/queries/catalog/call-context-query/call-context-query-format.d.ts +1 -1
- package/queries/catalog/dependencies-query/function-info/library-functions.js +2 -0
- package/queries/catalog/df-shape-query/df-shape-query-format.js +7 -2
- package/queries/catalog/files-query/files-query-executor.js +0 -1
- package/queries/catalog/input-sources-query/simple-input-classifier.d.ts +2 -0
- package/queries/catalog/input-sources-query/simple-input-classifier.js +2 -0
- package/r-bridge/data/data.d.ts +2 -2
- package/r-bridge/data/data.js +2 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.d.ts +13 -5
- package/r-bridge/lang-4.x/ast/model/nodes/r-argument.js +14 -2
- package/r-bridge/lang-4.x/ast/model/nodes/r-function-call.d.ts +3 -3
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.d.ts +9 -0
- package/r-bridge/lang-4.x/ast/model/nodes/r-pipe.js +13 -0
- package/r-bridge/lang-4.x/ast/model/versions.d.ts +2 -0
- package/r-bridge/lang-4.x/ast/model/versions.js +3 -1
- package/r-bridge/roxygen2/documentation-provider.js +15 -6
- package/r-bridge/roxygen2/roxygen-ast.d.ts +3 -1
- package/search/flowr-search-builder.js +3 -2
- package/util/mermaid/ast.js +2 -1
- package/util/record.d.ts +23 -0
- package/util/record.js +33 -0
- package/util/version.js +1 -1
- package/abstract-interpretation/domains/mapped-abstract-domain.d.ts +0 -41
- package/abstract-interpretation/domains/mapped-abstract-domain.js +0 -213
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
282
|
+
declare function mapDataFrameIdentity(args: readonly PotentiallyEmptyRArgument<ParentInformation>[], params: {
|
|
257
283
|
dataFrame: FunctionParameterLocation;
|
|
258
284
|
special: string[];
|
|
259
285
|
disallowNamedArgs?: boolean;
|
|
@@ -10,8 +10,10 @@ const retriever_1 = require("../../../r-bridge/retriever");
|
|
|
10
10
|
const assert_1 = require("../../../util/assert");
|
|
11
11
|
const dataframe_domain_1 = require("../dataframe-domain");
|
|
12
12
|
const resolve_args_1 = require("../resolve-args");
|
|
13
|
+
const semantics_1 = require("../semantics");
|
|
13
14
|
const arguments_1 = require("./arguments");
|
|
14
15
|
const identifier_1 = require("../../../dataflow/environments/identifier");
|
|
16
|
+
const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
15
17
|
/**
|
|
16
18
|
* Represents the different types of data frames in R
|
|
17
19
|
*/
|
|
@@ -26,43 +28,48 @@ var DataFrameType;
|
|
|
26
28
|
* including information about the origin library of the functions and the type of the returned data frame.
|
|
27
29
|
*/
|
|
28
30
|
const DataFrameFunctionMapper = {
|
|
29
|
-
'data.frame': { mapper: mapDataFrameCreate, library: 'base', returnType: DataFrameType.DataFrame },
|
|
30
|
-
'as.data.frame': { mapper: mapDataFrameConvert, library: 'base', returnType: DataFrameType.DataFrame },
|
|
31
|
-
'read.table': { mapper: mapDataFrameRead, library: 'utils', returnType: DataFrameType.DataFrame },
|
|
32
|
-
'read.csv': { mapper: mapDataFrameRead, library: 'utils', returnType: DataFrameType.DataFrame },
|
|
33
|
-
'read.csv2': { mapper: mapDataFrameRead, library: 'utils', returnType: DataFrameType.DataFrame },
|
|
34
|
-
'read.delim': { mapper: mapDataFrameRead, library: 'utils', returnType: DataFrameType.DataFrame },
|
|
35
|
-
'read.delim2': { mapper: mapDataFrameRead, library: 'utils', returnType: DataFrameType.DataFrame },
|
|
36
|
-
'read_table': { mapper: mapDataFrameRead, library: 'readr', returnType: DataFrameType.Tibble },
|
|
37
|
-
'read_csv': { mapper: mapDataFrameRead, library: 'readr', returnType: DataFrameType.Tibble },
|
|
38
|
-
'read_csv2': { mapper: mapDataFrameRead, library: 'readr', returnType: DataFrameType.Tibble },
|
|
39
|
-
'read_tsv': { mapper: mapDataFrameRead, library: 'readr', returnType: DataFrameType.Tibble },
|
|
40
|
-
'read_delim': { mapper: mapDataFrameRead, library: 'readr', returnType: DataFrameType.Tibble },
|
|
31
|
+
'data.frame': { mapper: mapDataFrameCreate, library: 'base', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
32
|
+
'as.data.frame': { mapper: mapDataFrameConvert, library: 'base', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
33
|
+
'read.table': { mapper: mapDataFrameRead, library: 'utils', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
34
|
+
'read.csv': { mapper: mapDataFrameRead, library: 'utils', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
35
|
+
'read.csv2': { mapper: mapDataFrameRead, library: 'utils', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
36
|
+
'read.delim': { mapper: mapDataFrameRead, library: 'utils', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
37
|
+
'read.delim2': { mapper: mapDataFrameRead, library: 'utils', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
38
|
+
'read_table': { mapper: mapDataFrameRead, library: 'readr', returnType: DataFrameType.Tibble, alwaysDataFrame: true },
|
|
39
|
+
'read_csv': { mapper: mapDataFrameRead, library: 'readr', returnType: DataFrameType.Tibble, alwaysDataFrame: true },
|
|
40
|
+
'read_csv2': { mapper: mapDataFrameRead, library: 'readr', returnType: DataFrameType.Tibble, alwaysDataFrame: true },
|
|
41
|
+
'read_tsv': { mapper: mapDataFrameRead, library: 'readr', returnType: DataFrameType.Tibble, alwaysDataFrame: true },
|
|
42
|
+
'read_delim': { mapper: mapDataFrameRead, library: 'readr', returnType: DataFrameType.Tibble, alwaysDataFrame: true },
|
|
41
43
|
'cbind': { mapper: mapDataFrameColBind, library: 'base', returnType: DataFrameType.DataFrame },
|
|
42
44
|
'rbind': { mapper: mapDataFrameRowBind, library: 'base', returnType: DataFrameType.DataFrame },
|
|
43
45
|
'head': { mapper: mapDataFrameHeadTail, library: 'utils', returnType: DataFrameType.DataFrame },
|
|
44
46
|
'tail': { mapper: mapDataFrameHeadTail, library: 'utils', returnType: DataFrameType.DataFrame },
|
|
45
47
|
'subset': { mapper: mapDataFrameSubset, library: 'base', returnType: DataFrameType.DataFrame },
|
|
46
|
-
'filter': { mapper: mapDataFrameFilter, library: 'dplyr', returnType: DataFrameType.DataFrame },
|
|
47
|
-
'select': { mapper: mapDataFrameSelect, library: 'dplyr', returnType: DataFrameType.DataFrame },
|
|
48
|
-
'mutate': { mapper: mapDataFrameMutate, library: 'dplyr', returnType: DataFrameType.DataFrame },
|
|
49
|
-
'transform': { mapper: mapDataFrameMutate, library: 'base', returnType: DataFrameType.DataFrame },
|
|
50
|
-
'group_by': { mapper: mapDataFrameGroupBy, library: 'dplyr', returnType: DataFrameType.Tibble },
|
|
51
|
-
'summarise': { mapper: mapDataFrameSummarize, library: 'dplyr', returnType: DataFrameType.DataFrame },
|
|
52
|
-
'summarize': { mapper: mapDataFrameSummarize, library: 'dplyr', returnType: DataFrameType.DataFrame },
|
|
53
|
-
'inner_join': { mapper: mapDataFrameJoin, library: 'dplyr', returnType: DataFrameType.DataFrame },
|
|
54
|
-
'left_join': { mapper: mapDataFrameJoin, library: 'dplyr', returnType: DataFrameType.DataFrame },
|
|
55
|
-
'right_join': { mapper: mapDataFrameJoin, library: 'dplyr', returnType: DataFrameType.DataFrame },
|
|
56
|
-
'full_join': { mapper: mapDataFrameJoin, library: 'dplyr', returnType: DataFrameType.DataFrame },
|
|
57
|
-
'merge': { mapper: mapDataFrameJoin, library: 'base', returnType: DataFrameType.DataFrame },
|
|
58
|
-
'relocate': { mapper: mapDataFrameIdentity, library: 'dplyr', returnType: DataFrameType.DataFrame },
|
|
59
|
-
'arrange': { mapper: mapDataFrameIdentity, library: 'dplyr', returnType: DataFrameType.DataFrame }
|
|
48
|
+
'filter': { mapper: mapDataFrameFilter, library: 'dplyr', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
49
|
+
'select': { mapper: mapDataFrameSelect, library: 'dplyr', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
50
|
+
'mutate': { mapper: mapDataFrameMutate, library: 'dplyr', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
51
|
+
'transform': { mapper: mapDataFrameMutate, library: 'base', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
52
|
+
'group_by': { mapper: mapDataFrameGroupBy, library: 'dplyr', returnType: DataFrameType.Tibble, alwaysDataFrame: true },
|
|
53
|
+
'summarise': { mapper: mapDataFrameSummarize, library: 'dplyr', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
54
|
+
'summarize': { mapper: mapDataFrameSummarize, library: 'dplyr', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
55
|
+
'inner_join': { mapper: mapDataFrameJoin, library: 'dplyr', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
56
|
+
'left_join': { mapper: mapDataFrameJoin, library: 'dplyr', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
57
|
+
'right_join': { mapper: mapDataFrameJoin, library: 'dplyr', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
58
|
+
'full_join': { mapper: mapDataFrameJoin, library: 'dplyr', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
59
|
+
'merge': { mapper: mapDataFrameJoin, library: 'base', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
60
|
+
'relocate': { mapper: mapDataFrameIdentity, library: 'dplyr', returnType: DataFrameType.DataFrame, alwaysDataFrame: true },
|
|
61
|
+
'arrange': { mapper: mapDataFrameIdentity, library: 'dplyr', returnType: DataFrameType.DataFrame, alwaysDataFrame: true }
|
|
60
62
|
};
|
|
61
63
|
/**
|
|
62
64
|
* List of other data frame functions that are not explicitly supported but may return data frames.
|
|
63
65
|
*/
|
|
64
66
|
const OtherDataFrameFunctions = [
|
|
65
67
|
{
|
|
68
|
+
type: 'entry_point',
|
|
69
|
+
names: ['as.data.frame.matrix'], // S3 dispatch of `as.data.frame`
|
|
70
|
+
library: 'base',
|
|
71
|
+
returnType: DataFrameType.DataFrame
|
|
72
|
+
}, {
|
|
66
73
|
type: 'entry_point',
|
|
67
74
|
names: ['anova', 'AIC', 'BIC'],
|
|
68
75
|
library: 'anova',
|
|
@@ -72,11 +79,6 @@ const OtherDataFrameFunctions = [
|
|
|
72
79
|
names: ['Anova', 'Manova'],
|
|
73
80
|
library: 'car',
|
|
74
81
|
returnType: DataFrameType.DataFrame
|
|
75
|
-
}, {
|
|
76
|
-
type: 'entry_point',
|
|
77
|
-
names: ['lmer'],
|
|
78
|
-
library: 'lme4',
|
|
79
|
-
returnType: DataFrameType.DataFrame
|
|
80
82
|
}, {
|
|
81
83
|
type: 'entry_point',
|
|
82
84
|
names: ['data_frame', 'as_data_frame'],
|
|
@@ -115,7 +117,7 @@ const OtherDataFrameFunctions = [
|
|
|
115
117
|
dataFrame: { pos: 0, name: 'object' }
|
|
116
118
|
}, {
|
|
117
119
|
type: 'transformation',
|
|
118
|
-
names: ['unique', '
|
|
120
|
+
names: ['unique', 'droplevels'],
|
|
119
121
|
library: 'base',
|
|
120
122
|
returnType: DataFrameType.DataFrame,
|
|
121
123
|
dataFrame: { pos: 0, name: 'x' }
|
|
@@ -151,6 +153,7 @@ const OtherDataFrameFunctions = [
|
|
|
151
153
|
],
|
|
152
154
|
library: 'dplyr',
|
|
153
155
|
returnType: DataFrameType.DataFrame,
|
|
156
|
+
alwaysDataFrame: true,
|
|
154
157
|
dataFrame: { pos: 0, name: '.data' }
|
|
155
158
|
}, {
|
|
156
159
|
type: 'transformation',
|
|
@@ -163,6 +166,7 @@ const OtherDataFrameFunctions = [
|
|
|
163
166
|
],
|
|
164
167
|
library: 'dplyr',
|
|
165
168
|
returnType: DataFrameType.Tibble,
|
|
169
|
+
alwaysDataFrame: true,
|
|
166
170
|
dataFrame: { pos: 0, name: '.tbl' }
|
|
167
171
|
}, {
|
|
168
172
|
type: 'transformation',
|
|
@@ -173,12 +177,14 @@ const OtherDataFrameFunctions = [
|
|
|
173
177
|
],
|
|
174
178
|
library: 'dplyr',
|
|
175
179
|
returnType: DataFrameType.DataFrame,
|
|
180
|
+
alwaysDataFrame: true,
|
|
176
181
|
dataFrame: { pos: 0, name: 'x' }
|
|
177
182
|
}, {
|
|
178
183
|
type: 'transformation',
|
|
179
184
|
names: ['bind_cols', 'bind_rows'],
|
|
180
185
|
library: 'dplyr',
|
|
181
|
-
returnType: DataFrameType.DataFrame
|
|
186
|
+
returnType: DataFrameType.DataFrame,
|
|
187
|
+
alwaysDataFrame: true
|
|
182
188
|
}, {
|
|
183
189
|
type: 'transformation',
|
|
184
190
|
names: [
|
|
@@ -193,6 +199,7 @@ const OtherDataFrameFunctions = [
|
|
|
193
199
|
names: ['add_column', 'add_row', 'add_case'],
|
|
194
200
|
library: 'tibble',
|
|
195
201
|
returnType: DataFrameType.Tibble,
|
|
202
|
+
alwaysDataFrame: true,
|
|
196
203
|
dataFrame: { pos: 0, name: '.data' }
|
|
197
204
|
}, {
|
|
198
205
|
type: 'transformation',
|
|
@@ -200,6 +207,20 @@ const OtherDataFrameFunctions = [
|
|
|
200
207
|
library: 'data.table',
|
|
201
208
|
returnType: DataFrameType.DataTable,
|
|
202
209
|
dataFrame: { pos: 0, name: 'data' }
|
|
210
|
+
}, {
|
|
211
|
+
type: 'modification',
|
|
212
|
+
names: ['setNames'],
|
|
213
|
+
library: 'stats',
|
|
214
|
+
constraintType: semantics_1.ConstraintType.OperandModification,
|
|
215
|
+
returnType: DataFrameType.DataFrame,
|
|
216
|
+
dataFrame: { pos: 0, name: 'object' }
|
|
217
|
+
}, {
|
|
218
|
+
type: 'modification',
|
|
219
|
+
names: ['unname'],
|
|
220
|
+
library: 'base',
|
|
221
|
+
constraintType: semantics_1.ConstraintType.OperandModification,
|
|
222
|
+
returnType: DataFrameType.DataFrame,
|
|
223
|
+
dataFrame: { pos: 0, name: 'obj' }
|
|
203
224
|
}
|
|
204
225
|
];
|
|
205
226
|
/**
|
|
@@ -529,30 +550,33 @@ function mapDataFrameFunctionCall(node, inference, dfg, ctx) {
|
|
|
529
550
|
return;
|
|
530
551
|
}
|
|
531
552
|
const resolveInfo = { graph: dfg, idMap: dfg.idMap, full: true, resolve: config_1.VariableResolve.Alias, ctx };
|
|
532
|
-
const
|
|
533
|
-
if (isDataFrameFunction(
|
|
534
|
-
const
|
|
535
|
-
const mapper = DataFrameFunctionMapper[functionName].mapper;
|
|
553
|
+
const functionName = identifier_1.Identifier.getName(node.functionName.content);
|
|
554
|
+
if (isDataFrameFunction(functionName)) {
|
|
555
|
+
const mapping = DataFrameFunctionMapper[functionName];
|
|
536
556
|
const params = DataFrameFunctionParamsMapper[functionName];
|
|
537
557
|
const args = (0, arguments_1.getFunctionArguments)(node, dfg);
|
|
538
558
|
if ((0, arguments_1.hasCriticalArgument)(args, params.critical, resolveInfo)) {
|
|
539
559
|
return [{ operation: 'unknown', operand: undefined }];
|
|
540
560
|
}
|
|
541
561
|
else {
|
|
542
|
-
return mapper(args, params, inference, resolveInfo);
|
|
562
|
+
return mapping.mapper(args, params, inference, resolveInfo) ?? (mapping.alwaysDataFrame ? [{ operation: 'unknown', operand: undefined }] : undefined);
|
|
543
563
|
}
|
|
544
564
|
}
|
|
545
565
|
else {
|
|
546
|
-
const mapping = getOtherDataFrameFunction(
|
|
566
|
+
const mapping = getOtherDataFrameFunction(functionName);
|
|
547
567
|
if (mapping === undefined) {
|
|
548
568
|
return;
|
|
549
569
|
}
|
|
550
570
|
else if (mapping.type === 'entry_point') {
|
|
551
571
|
return [{ operation: 'unknown', operand: undefined }];
|
|
552
572
|
}
|
|
553
|
-
else if (mapping.type === 'transformation'
|
|
573
|
+
else if (mapping.type === 'transformation') {
|
|
574
|
+
const args = (0, arguments_1.getFunctionArguments)(node, dfg);
|
|
575
|
+
return mapDataFrameUnknown(args, mapping, inference, resolveInfo) ?? (mapping.alwaysDataFrame ? [{ operation: 'unknown', operand: undefined }] : undefined);
|
|
576
|
+
}
|
|
577
|
+
else if (mapping.type === 'modification') {
|
|
554
578
|
const args = (0, arguments_1.getFunctionArguments)(node, dfg);
|
|
555
|
-
return mapDataFrameUnknown(args, mapping, inference, resolveInfo);
|
|
579
|
+
return mapDataFrameUnknown(args, { ...mapping, constraintType: semantics_1.ConstraintType.OperandModification }, inference, resolveInfo);
|
|
556
580
|
}
|
|
557
581
|
else {
|
|
558
582
|
(0, assert_1.assertUnreachable)(mapping);
|
|
@@ -873,7 +897,7 @@ function mapDataFrameSelect(args, params, inference, info) {
|
|
|
873
897
|
const accessedCols = [...selectedCols ?? [], ...unselectedCols ?? []];
|
|
874
898
|
const mixedAccess = accessedCols.some(col => typeof col === 'string') && accessedCols.some(col => typeof col === 'number');
|
|
875
899
|
const duplicateAccess = accessedCols.some((col, _, list) => col !== undefined && list.filter(other => other === col).length > 1);
|
|
876
|
-
const renamedCols = selectArgs.some(
|
|
900
|
+
const renamedCols = selectArgs.some(r_argument_1.RArgument.isNamed);
|
|
877
901
|
// map to top if columns are selected mixed by string and number, or are selected duplicate
|
|
878
902
|
if (mixedAccess || duplicateAccess) {
|
|
879
903
|
selectedCols = undefined;
|
|
@@ -974,8 +998,8 @@ function mapDataFrameGroupBy(args, params, inference, info) {
|
|
|
974
998
|
const result = [];
|
|
975
999
|
const byArgs = args.filter(arg => arg !== dataFrame);
|
|
976
1000
|
const accessedNames = byArgs.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph)).map(identifier_1.Identifier.toString);
|
|
977
|
-
const byNames = byArgs.map(arg =>
|
|
978
|
-
const mutatedCols = byArgs.some(
|
|
1001
|
+
const byNames = byArgs.map(arg => r_argument_1.RArgument.isNamed(arg) ? (0, resolve_args_1.resolveIdToArgName)(arg, info) : (0, resolve_args_1.resolveIdToArgValueSymbolName)(arg, info));
|
|
1002
|
+
const mutatedCols = byArgs.some(r_argument_1.RArgument.isNamed) || byNames.some(assert_1.isUndefined);
|
|
979
1003
|
if (accessedNames.length > 0) {
|
|
980
1004
|
result.push({
|
|
981
1005
|
operation: 'accessCols',
|
|
@@ -1076,7 +1100,7 @@ function mapDataFrameIdentity(args, params, inference, info) {
|
|
|
1076
1100
|
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
1077
1101
|
return;
|
|
1078
1102
|
}
|
|
1079
|
-
else if (params.disallowNamedArgs && args.some(
|
|
1103
|
+
else if (params.disallowNamedArgs && args.some(r_argument_1.RArgument.isNamed)) {
|
|
1080
1104
|
return [{ operation: 'unknown', operand: dataFrame.value.info.id }];
|
|
1081
1105
|
}
|
|
1082
1106
|
return [{
|
|
@@ -1125,21 +1149,23 @@ function getRequestFromRead(fileNameArg, textArg, params, info) {
|
|
|
1125
1149
|
else if (textArg !== undefined && textArg !== r_function_call_1.EmptyArgument) {
|
|
1126
1150
|
const text = (0, resolve_args_1.resolveIdToArgValue)(textArg, info);
|
|
1127
1151
|
if (typeof text === 'string') {
|
|
1128
|
-
source = text;
|
|
1129
1152
|
request = (0, retriever_1.requestFromInput)((0, resolve_args_1.unescapeSpecialChars)(text));
|
|
1130
1153
|
}
|
|
1131
1154
|
}
|
|
1132
|
-
request
|
|
1155
|
+
if (request?.request === 'file' && info.ctx.files.hasCached(request.content)) {
|
|
1156
|
+
request = info.ctx.files.resolveRequest(request).r;
|
|
1157
|
+
}
|
|
1133
1158
|
return { source, request };
|
|
1134
1159
|
}
|
|
1135
1160
|
/**
|
|
1136
1161
|
* Gets all entries from a line of a CSV file using a custom separator char, quote char, and comment char
|
|
1137
1162
|
*/
|
|
1138
1163
|
function getEntriesFromCsvLine(line, sep = ',', quote = '"', comment = '', trim = true) {
|
|
1164
|
+
sep = sep.length > 0 ? sep : '\\s'; // default to whitespace separator
|
|
1139
1165
|
sep = (0, arguments_1.escapeRegExp)(sep, true); // only allow tokens like `\s`, `\t`, or `\n` in separator, quote, and comment chars
|
|
1140
1166
|
quote = (0, arguments_1.escapeRegExp)(quote);
|
|
1141
1167
|
comment = (0, arguments_1.escapeRegExp)(comment);
|
|
1142
|
-
const quantifier = sep === '\\s' ? '+' : '*'; // do not allow unquoted empty entries in whitespace-
|
|
1168
|
+
const quantifier = sep === '\\s' ? '+' : '*'; // do not allow unquoted empty entries in whitespace-separated files
|
|
1143
1169
|
const LineCommentRegex = new RegExp(`[${comment}].*`);
|
|
1144
1170
|
const CsvEntryRegex = new RegExp(`(?<=^|[${sep}])(?:[${quote}]((?:[^${quote}]|[${quote}]{2})*)[${quote}]|([^${sep}]${quantifier}))`, 'g');
|
|
1145
1171
|
const DoubleQuoteRegex = new RegExp(`([${quote}])\\1`, 'g'); // regex for doubled quotes like `""` or `''`
|
|
@@ -4,6 +4,7 @@ exports.mapDataFrameReplacementFunction = mapDataFrameReplacementFunction;
|
|
|
4
4
|
const config_1 = require("../../../config");
|
|
5
5
|
const vertex_1 = require("../../../dataflow/graph/vertex");
|
|
6
6
|
const make_argument_1 = require("../../../dataflow/internal/process/functions/call/argument/make-argument");
|
|
7
|
+
const r_argument_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-argument");
|
|
7
8
|
const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-function-call");
|
|
8
9
|
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
9
10
|
const resolve_args_1 = require("../resolve-args");
|
|
@@ -107,7 +108,7 @@ function mapDataFrameNamedColumnAssignment(access, expression, inference, info)
|
|
|
107
108
|
}
|
|
108
109
|
function mapDataFrameIndexColRowAssignment(access, expression, inference, info) {
|
|
109
110
|
const dataFrame = access.accessed;
|
|
110
|
-
const args = access.access;
|
|
111
|
+
const args = access.access.filter(arg => r_argument_1.RArgument.isEmpty(arg) || r_argument_1.RArgument.isUnnamed(arg));
|
|
111
112
|
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference) || args.every(arg => arg === r_function_call_1.EmptyArgument)) {
|
|
112
113
|
return;
|
|
113
114
|
}
|