@eagleoutice/flowr 2.7.0 → 2.7.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -14
- package/abstract-interpretation/absint-visitor.d.ts +160 -0
- package/abstract-interpretation/absint-visitor.js +279 -0
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +2 -2
- package/abstract-interpretation/data-frame/dataframe-domain.js +23 -7
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +6 -6
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +10 -14
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +15 -9
- package/abstract-interpretation/data-frame/mappers/arguments.js +27 -4
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +17 -17
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +55 -67
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +7 -7
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +25 -29
- package/abstract-interpretation/data-frame/resolve-args.d.ts +1 -1
- package/abstract-interpretation/data-frame/resolve-args.js +1 -1
- package/abstract-interpretation/data-frame/semantics.js +5 -6
- package/abstract-interpretation/data-frame/shape-inference.d.ts +52 -28
- package/abstract-interpretation/data-frame/shape-inference.js +67 -90
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +2 -2
- package/abstract-interpretation/domains/interval-domain.d.ts +2 -2
- package/abstract-interpretation/domains/set-range-domain.d.ts +10 -4
- package/abstract-interpretation/domains/set-range-domain.js +7 -1
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +2 -2
- package/abstract-interpretation/domains/singleton-domain.d.ts +2 -2
- package/benchmark/slicer.js +13 -14
- package/cli/common/options.d.ts +431 -8
- package/cli/common/options.js +1 -1
- package/cli/common/scripts-info.d.ts +431 -7
- package/cli/flowr-main-options.d.ts +102 -2
- package/cli/flowr.d.ts +102 -2
- package/cli/repl/commands/repl-commands.d.ts +25 -0
- package/cli/repl/commands/repl-query.js +17 -5
- package/cli/wiki.d.ts +13 -0
- package/cli/wiki.js +7 -2
- package/config.d.ts +4 -4
- package/config.js +1 -1
- package/control-flow/basic-cfg-guided-visitor.js +7 -8
- package/control-flow/control-flow-graph.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.d.ts +1 -1
- package/control-flow/semantic-cfg-guided-visitor.js +1 -1
- package/dataflow/eval/resolve/alias-tracking.js +1 -1
- package/dataflow/internal/linker.d.ts +2 -0
- package/dataflow/internal/linker.js +10 -12
- package/documentation/doc-capabilities.d.ts +1 -1
- package/documentation/doc-readme.d.ts +1 -1
- package/documentation/doc-util/doc-cfg.js +1 -1
- package/documentation/doc-util/doc-cli-option.d.ts +6 -6
- package/documentation/doc-util/doc-cli-option.js +3 -3
- package/documentation/doc-util/doc-dfg.d.ts +1 -1
- package/documentation/doc-util/doc-files.d.ts +3 -0
- package/documentation/doc-util/doc-files.js +4 -1
- package/documentation/doc-util/doc-normalized-ast.js +2 -2
- package/documentation/issue-linting-rule.d.ts +1 -1
- package/documentation/wiki-analyzer.d.ts +1 -1
- package/documentation/wiki-cfg.d.ts +1 -1
- package/documentation/wiki-core.d.ts +1 -1
- package/documentation/wiki-dataflow-graph.d.ts +1 -1
- package/documentation/wiki-dataflow-graph.js +6 -6
- package/documentation/wiki-engine.d.ts +1 -1
- package/documentation/wiki-engine.js +9 -10
- package/documentation/wiki-faq.d.ts +1 -1
- package/documentation/wiki-interface.d.ts +1 -1
- package/documentation/wiki-interface.js +12 -13
- package/documentation/wiki-linter.d.ts +1 -1
- package/documentation/wiki-linting-and-testing.d.ts +1 -1
- package/documentation/wiki-mk/doc-context.d.ts +54 -1
- package/documentation/wiki-mk/doc-context.js +17 -0
- package/documentation/wiki-mk/doc-maker.d.ts +5 -5
- package/documentation/wiki-mk/doc-maker.js +3 -1
- package/documentation/wiki-normalized-ast.d.ts +1 -1
- package/documentation/wiki-onboarding.d.ts +1 -1
- package/documentation/wiki-overview.d.ts +9 -0
- package/documentation/wiki-overview.js +248 -0
- package/documentation/wiki-query.d.ts +1 -1
- package/documentation/wiki-query.js +17 -1
- package/documentation/wiki-search.d.ts +1 -1
- package/documentation/wiki-setup.d.ts +9 -0
- package/documentation/wiki-setup.js +122 -0
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +8 -10
- package/linter/rules/unused-definition.js +1 -1
- package/package.json +1 -1
- package/project/context/flowr-analyzer-context.d.ts +4 -0
- package/project/context/flowr-analyzer-context.js +3 -1
- package/project/context/flowr-analyzer-dependencies-context.d.ts +3 -2
- package/project/context/flowr-analyzer-dependencies-context.js +4 -2
- package/project/context/flowr-analyzer-files-context.d.ts +9 -1
- package/project/context/flowr-analyzer-files-context.js +4 -0
- package/project/context/flowr-analyzer-functions-context.d.ts +29 -0
- package/project/context/flowr-analyzer-functions-context.js +68 -0
- package/project/context/flowr-file.d.ts +2 -0
- package/project/context/flowr-file.js +2 -0
- package/project/plugins/file-plugins/{flowr-description-file.d.ts → files/flowr-description-file.d.ts} +1 -1
- package/project/plugins/file-plugins/files/flowr-description-file.js +75 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +32 -0
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +102 -0
- package/project/plugins/file-plugins/files/flowr-news-file.d.ts +27 -0
- package/project/plugins/file-plugins/files/flowr-news-file.js +152 -0
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-description-file-plugin.js +1 -1
- package/project/plugins/file-plugins/flowr-analyzer-namespace-file-plugin.d.ts +22 -0
- package/project/plugins/file-plugins/flowr-analyzer-namespace-file-plugin.js +34 -0
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.d.ts +23 -0
- package/project/plugins/file-plugins/flowr-analyzer-news-file-plugin.js +35 -0
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin.js +1 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-qmd-file-plugin.js +1 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.d.ts +1 -1
- package/project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin.js +1 -1
- package/project/plugins/flowr-analyzer-plugin-defaults.js +4 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-description-file-plugin.js +5 -1
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.d.ts +10 -0
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +56 -0
- package/project/plugins/package-version-plugins/package.d.ts +15 -2
- package/project/plugins/package-version-plugins/package.js +33 -5
- package/project/plugins/plugin-registry.d.ts +3 -1
- package/project/plugins/plugin-registry.js +4 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +7 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +2 -1
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +2 -0
- package/queries/catalog/dependencies-query/dependencies-query-format.js +2 -1
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +4 -2
- package/queries/catalog/files-query/files-query-executor.d.ts +6 -0
- package/queries/catalog/files-query/files-query-executor.js +49 -0
- package/queries/catalog/files-query/files-query-format.d.ts +36 -0
- package/queries/catalog/files-query/files-query-format.js +114 -0
- package/queries/catalog/linter-query/linter-query-format.js +1 -1
- package/queries/query.d.ts +10 -1
- package/queries/query.js +3 -1
- package/r-bridge/lang-4.x/ast/model/model.d.ts +1 -1
- package/r-bridge/lang-4.x/ast/model/processing/decorate.js +8 -8
- package/r-bridge/lang-4.x/ast/model/processing/role.d.ts +8 -8
- package/r-bridge/lang-4.x/ast/parser/main/internal/functions/normalize-parameter.js +0 -1
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-normalize.js +0 -1
- package/statistics/features/supported/data-access/data-access.js +1 -1
- package/util/containers.js +1 -1
- package/util/files.d.ts +0 -7
- package/util/files.js +0 -41
- package/util/mermaid/ast.d.ts +3 -2
- package/util/mermaid/ast.js +13 -7
- package/util/mermaid/cfg.d.ts +3 -2
- package/util/mermaid/cfg.js +26 -6
- package/util/mermaid/dfg.d.ts +1 -7
- package/util/mermaid/dfg.js +7 -3
- package/util/mermaid/info.d.ts +17 -0
- package/util/mermaid/info.js +5 -0
- package/util/prefix.d.ts +9 -5
- package/util/prefix.js +14 -6
- package/util/r-regex.d.ts +21 -0
- package/util/r-regex.js +25 -0
- package/util/text/args.js +12 -3
- package/util/version.js +1 -1
- package/abstract-interpretation/data-frame/absint-info.d.ts +0 -109
- package/abstract-interpretation/data-frame/absint-info.js +0 -31
- package/abstract-interpretation/data-frame/absint-visitor.d.ts +0 -57
- package/abstract-interpretation/data-frame/absint-visitor.js +0 -176
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +0 -21
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +0 -34
- package/documentation/doc-util/doc-print.d.ts +0 -5
- package/documentation/doc-util/doc-print.js +0 -36
- package/project/plugins/file-plugins/flowr-description-file.js +0 -37
- package/project/plugins/file-plugins/notebooks/notebook.d.ts +0 -0
- package/project/plugins/file-plugins/notebooks/notebook.js +0 -2
- /package/project/plugins/file-plugins/{notebooks → files}/flowr-jupyter-file.d.ts +0 -0
- /package/project/plugins/file-plugins/{notebooks → files}/flowr-jupyter-file.js +0 -0
- /package/project/plugins/file-plugins/{notebooks → files}/flowr-rmarkdown-file.d.ts +0 -0
- /package/project/plugins/file-plugins/{notebooks → files}/flowr-rmarkdown-file.js +0 -0
|
@@ -8,10 +8,8 @@ const r_function_call_1 = require("../../../r-bridge/lang-4.x/ast/model/nodes/r-
|
|
|
8
8
|
const type_1 = require("../../../r-bridge/lang-4.x/ast/model/type");
|
|
9
9
|
const retriever_1 = require("../../../r-bridge/retriever");
|
|
10
10
|
const assert_1 = require("../../../util/assert");
|
|
11
|
-
const files_1 = require("../../../util/files");
|
|
12
11
|
const dataframe_domain_1 = require("../dataframe-domain");
|
|
13
12
|
const resolve_args_1 = require("../resolve-args");
|
|
14
|
-
const shape_inference_1 = require("../shape-inference");
|
|
15
13
|
const arguments_1 = require("./arguments");
|
|
16
14
|
/**
|
|
17
15
|
* Represents the different types of data frames in R
|
|
@@ -522,24 +520,23 @@ const DataFrameFunctionParamsMapper = {
|
|
|
522
520
|
* @param node - The R node of the function call
|
|
523
521
|
* @param dfg - The data flow graph for resolving the arguments
|
|
524
522
|
* @param ctx - The current flowR analyzer context
|
|
525
|
-
* @returns
|
|
523
|
+
* @returns The mapped abstract data frame operations for the function call, or `undefined` if the node does not represent a data frame function call
|
|
526
524
|
*/
|
|
527
|
-
function mapDataFrameFunctionCall(node, dfg, ctx) {
|
|
525
|
+
function mapDataFrameFunctionCall(node, inference, dfg, ctx) {
|
|
528
526
|
if (node.type !== type_1.RType.FunctionCall || !node.named) {
|
|
529
527
|
return;
|
|
530
528
|
}
|
|
531
529
|
const resolveInfo = { graph: dfg, idMap: dfg.idMap, full: true, resolve: config_1.VariableResolve.Alias, ctx };
|
|
532
|
-
let operations;
|
|
533
530
|
if (isDataFrameFunction(node.functionName.content)) {
|
|
534
531
|
const functionName = node.functionName.content;
|
|
535
532
|
const mapper = DataFrameFunctionMapper[functionName].mapper;
|
|
536
533
|
const params = DataFrameFunctionParamsMapper[functionName];
|
|
537
534
|
const args = (0, arguments_1.getFunctionArguments)(node, dfg);
|
|
538
535
|
if ((0, arguments_1.hasCriticalArgument)(args, params.critical, resolveInfo)) {
|
|
539
|
-
|
|
536
|
+
return [{ operation: 'unknown', operand: undefined }];
|
|
540
537
|
}
|
|
541
538
|
else {
|
|
542
|
-
|
|
539
|
+
return mapper(args, params, inference, resolveInfo);
|
|
543
540
|
}
|
|
544
541
|
}
|
|
545
542
|
else {
|
|
@@ -548,19 +545,16 @@ function mapDataFrameFunctionCall(node, dfg, ctx) {
|
|
|
548
545
|
return;
|
|
549
546
|
}
|
|
550
547
|
else if (mapping.type === 'entry_point') {
|
|
551
|
-
|
|
548
|
+
return [{ operation: 'unknown', operand: undefined }];
|
|
552
549
|
}
|
|
553
550
|
else if (mapping.type === 'transformation' || mapping.type === 'modification') {
|
|
554
551
|
const args = (0, arguments_1.getFunctionArguments)(node, dfg);
|
|
555
|
-
|
|
552
|
+
return mapDataFrameUnknown(args, mapping, inference, resolveInfo);
|
|
556
553
|
}
|
|
557
554
|
else {
|
|
558
555
|
(0, assert_1.assertUnreachable)(mapping);
|
|
559
556
|
}
|
|
560
557
|
}
|
|
561
|
-
if (operations !== undefined) {
|
|
562
|
-
return { type: 'expression', operations };
|
|
563
|
-
}
|
|
564
558
|
}
|
|
565
559
|
function isDataFrameFunction(functionName) {
|
|
566
560
|
// a check with `functionName in DataFrameFunctionMapper` would return true for "toString"
|
|
@@ -569,7 +563,7 @@ function isDataFrameFunction(functionName) {
|
|
|
569
563
|
function getOtherDataFrameFunction(functionName) {
|
|
570
564
|
return OtherDataFrameFunctions.find(entry => entry.names.includes(functionName));
|
|
571
565
|
}
|
|
572
|
-
function mapDataFrameCreate(args, params, info) {
|
|
566
|
+
function mapDataFrameCreate(args, params, inference, info) {
|
|
573
567
|
const checkNames = (0, arguments_1.getArgumentValue)(args, params.checkNames, info);
|
|
574
568
|
const noDupNames = (0, arguments_1.getArgumentValue)(args, params.noDupNames, info);
|
|
575
569
|
args = (0, arguments_1.getEffectiveArgs)(args, params.special);
|
|
@@ -595,7 +589,7 @@ function mapDataFrameCreate(args, params, info) {
|
|
|
595
589
|
rows
|
|
596
590
|
}];
|
|
597
591
|
}
|
|
598
|
-
function mapDataFrameConvert(args, params, info) {
|
|
592
|
+
function mapDataFrameConvert(args, params, inference, info) {
|
|
599
593
|
const dataFrame = (0, arguments_1.getFunctionArgument)(args, params.dataFrame, info);
|
|
600
594
|
if (dataFrame === r_function_call_1.EmptyArgument || dataFrame?.value === undefined) {
|
|
601
595
|
return [{ operation: 'unknown', operand: undefined }];
|
|
@@ -605,10 +599,10 @@ function mapDataFrameConvert(args, params, info) {
|
|
|
605
599
|
operand: dataFrame.value.info.id
|
|
606
600
|
}];
|
|
607
601
|
}
|
|
608
|
-
function mapDataFrameRead(args, params,
|
|
602
|
+
function mapDataFrameRead(args, params, inference, info) {
|
|
609
603
|
const fileNameArg = (0, arguments_1.getFunctionArgument)(args, params.fileName, info);
|
|
610
604
|
const textArg = params.text ? (0, arguments_1.getFunctionArgument)(args, params.text, info) : undefined;
|
|
611
|
-
const { source, request } = getRequestFromRead(fileNameArg, textArg, params, info
|
|
605
|
+
const { source, request } = getRequestFromRead(fileNameArg, textArg, params, info);
|
|
612
606
|
const header = (0, arguments_1.getArgumentValue)(args, params.header, info);
|
|
613
607
|
const separator = (0, arguments_1.getArgumentValue)(args, params.separator, info);
|
|
614
608
|
const quote = (0, arguments_1.getArgumentValue)(args, params.quote, info);
|
|
@@ -618,7 +612,7 @@ function mapDataFrameRead(args, params, info, ctx) {
|
|
|
618
612
|
const noDupNames = (0, arguments_1.getArgumentValue)(args, params.noDupNames, info);
|
|
619
613
|
const validArguments = typeof header === 'boolean' && typeof separator === 'string' && typeof quote === 'string' && typeof comment === 'string' &&
|
|
620
614
|
typeof skipLines === 'number' && typeof checkNames === 'boolean' && typeof noDupNames === 'boolean';
|
|
621
|
-
if (request === undefined || !ctx.config.abstractInterpretation.dataFrame.readLoadedData.readExternalFiles || !validArguments) {
|
|
615
|
+
if (request === undefined || !info.ctx.config.abstractInterpretation.dataFrame.readLoadedData.readExternalFiles || !validArguments) {
|
|
622
616
|
return [{
|
|
623
617
|
operation: 'read',
|
|
624
618
|
operand: undefined,
|
|
@@ -643,7 +637,7 @@ function mapDataFrameRead(args, params, info, ctx) {
|
|
|
643
637
|
}
|
|
644
638
|
}
|
|
645
639
|
};
|
|
646
|
-
const allLines = parseRequestContent(request, parseLine, ctx.config.abstractInterpretation.dataFrame.readLoadedData.maxReadLines);
|
|
640
|
+
const allLines = (0, arguments_1.parseRequestContent)(request, parseLine, info.ctx.config.abstractInterpretation.dataFrame.readLoadedData.maxReadLines);
|
|
647
641
|
let colnames;
|
|
648
642
|
if (header) {
|
|
649
643
|
colnames = (0, arguments_1.filterValidNames)(firstLine, checkNames, noDupNames, params.noEmptyNames);
|
|
@@ -659,9 +653,9 @@ function mapDataFrameRead(args, params, info, ctx) {
|
|
|
659
653
|
rows: allLines ? rowCount : [rowCount, Infinity]
|
|
660
654
|
}];
|
|
661
655
|
}
|
|
662
|
-
function mapDataFrameColBind(args, params, info) {
|
|
656
|
+
function mapDataFrameColBind(args, params, inference, info) {
|
|
663
657
|
args = (0, arguments_1.getEffectiveArgs)(args, params.special);
|
|
664
|
-
const dataFrame = args.find(arg => (0, arguments_1.isDataFrameArgument)(arg,
|
|
658
|
+
const dataFrame = args.find(arg => (0, arguments_1.isDataFrameArgument)(arg, inference));
|
|
665
659
|
if (dataFrame === undefined) {
|
|
666
660
|
return;
|
|
667
661
|
}
|
|
@@ -673,7 +667,7 @@ function mapDataFrameColBind(args, params, info) {
|
|
|
673
667
|
let colnames = [];
|
|
674
668
|
for (const arg of args) {
|
|
675
669
|
if (arg !== dataFrame && arg !== r_function_call_1.EmptyArgument) {
|
|
676
|
-
const otherDataFrame =
|
|
670
|
+
const otherDataFrame = inference.getAbstractValue(arg.value);
|
|
677
671
|
if (otherDataFrame !== undefined) {
|
|
678
672
|
result.push({
|
|
679
673
|
operation: 'concatCols',
|
|
@@ -701,9 +695,9 @@ function mapDataFrameColBind(args, params, info) {
|
|
|
701
695
|
}
|
|
702
696
|
return result;
|
|
703
697
|
}
|
|
704
|
-
function mapDataFrameRowBind(args, params, info) {
|
|
698
|
+
function mapDataFrameRowBind(args, params, inference, info) {
|
|
705
699
|
args = (0, arguments_1.getEffectiveArgs)(args, params.special);
|
|
706
|
-
const dataFrame = args.find(arg => (0, arguments_1.isDataFrameArgument)(arg,
|
|
700
|
+
const dataFrame = args.find(arg => (0, arguments_1.isDataFrameArgument)(arg, inference));
|
|
707
701
|
if (dataFrame === undefined) {
|
|
708
702
|
return;
|
|
709
703
|
}
|
|
@@ -715,7 +709,7 @@ function mapDataFrameRowBind(args, params, info) {
|
|
|
715
709
|
let rows = 0;
|
|
716
710
|
for (const arg of args) {
|
|
717
711
|
if (arg !== dataFrame && arg !== r_function_call_1.EmptyArgument) {
|
|
718
|
-
const otherDataFrame =
|
|
712
|
+
const otherDataFrame = inference.getAbstractValue(arg.value);
|
|
719
713
|
if (otherDataFrame !== undefined) {
|
|
720
714
|
result.push({
|
|
721
715
|
operation: 'concatRows',
|
|
@@ -742,9 +736,9 @@ function mapDataFrameRowBind(args, params, info) {
|
|
|
742
736
|
}
|
|
743
737
|
return result;
|
|
744
738
|
}
|
|
745
|
-
function mapDataFrameHeadTail(args, params, info) {
|
|
739
|
+
function mapDataFrameHeadTail(args, params, inference, info) {
|
|
746
740
|
const dataFrame = (0, arguments_1.getFunctionArgument)(args, params.dataFrame, info);
|
|
747
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
741
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
748
742
|
return;
|
|
749
743
|
}
|
|
750
744
|
const result = [];
|
|
@@ -772,9 +766,9 @@ function mapDataFrameHeadTail(args, params, info) {
|
|
|
772
766
|
}
|
|
773
767
|
return result;
|
|
774
768
|
}
|
|
775
|
-
function mapDataFrameSubset(args, params, info) {
|
|
769
|
+
function mapDataFrameSubset(args, params, inference, info) {
|
|
776
770
|
const dataFrame = (0, arguments_1.getFunctionArgument)(args, params.dataFrame, info);
|
|
777
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
771
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
778
772
|
return;
|
|
779
773
|
}
|
|
780
774
|
else if (args.length === 1) {
|
|
@@ -835,10 +829,10 @@ function mapDataFrameSubset(args, params, info) {
|
|
|
835
829
|
}
|
|
836
830
|
return result;
|
|
837
831
|
}
|
|
838
|
-
function mapDataFrameFilter(args, params, info) {
|
|
832
|
+
function mapDataFrameFilter(args, params, inference, info) {
|
|
839
833
|
args = (0, arguments_1.getEffectiveArgs)(args, params.special);
|
|
840
834
|
const dataFrame = (0, arguments_1.getFunctionArgument)(args, params.dataFrame, info);
|
|
841
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
835
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
842
836
|
return;
|
|
843
837
|
}
|
|
844
838
|
else if (args.length === 1) {
|
|
@@ -863,10 +857,10 @@ function mapDataFrameFilter(args, params, info) {
|
|
|
863
857
|
});
|
|
864
858
|
return result;
|
|
865
859
|
}
|
|
866
|
-
function mapDataFrameSelect(args, params, info) {
|
|
860
|
+
function mapDataFrameSelect(args, params, inference, info) {
|
|
867
861
|
args = (0, arguments_1.getEffectiveArgs)(args, params.special);
|
|
868
862
|
const dataFrame = (0, arguments_1.getFunctionArgument)(args, params.dataFrame, info);
|
|
869
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
863
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
870
864
|
return;
|
|
871
865
|
}
|
|
872
866
|
const result = [];
|
|
@@ -915,10 +909,10 @@ function mapDataFrameSelect(args, params, info) {
|
|
|
915
909
|
}
|
|
916
910
|
return result;
|
|
917
911
|
}
|
|
918
|
-
function mapDataFrameMutate(args, params, info) {
|
|
912
|
+
function mapDataFrameMutate(args, params, inference, info) {
|
|
919
913
|
args = (0, arguments_1.getEffectiveArgs)(args, params.special);
|
|
920
914
|
const dataFrame = (0, arguments_1.getFunctionArgument)(args, params.dataFrame, info);
|
|
921
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
915
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
922
916
|
return;
|
|
923
917
|
}
|
|
924
918
|
else if (args.length === 1) {
|
|
@@ -937,8 +931,8 @@ function mapDataFrameMutate(args, params, info) {
|
|
|
937
931
|
const accessedNames = mutateArgs
|
|
938
932
|
.flatMap(arg => (0, arguments_1.getUnresolvedSymbolsInExpression)(arg, info.graph))
|
|
939
933
|
.filter(arg => !mutatedCols?.includes(arg));
|
|
940
|
-
deletedCols = (0, arguments_1.filterValidNames)(deletedCols, params.checkNames, params.noDupNames);
|
|
941
|
-
mutatedCols = (0, arguments_1.filterValidNames)(mutatedCols, params.checkNames, params.noDupNames);
|
|
934
|
+
deletedCols = (0, arguments_1.filterValidNames)(deletedCols, params.checkNames, params.noDupNames, undefined, true);
|
|
935
|
+
mutatedCols = (0, arguments_1.filterValidNames)(mutatedCols, params.checkNames, params.noDupNames, undefined, true);
|
|
942
936
|
if (accessedNames.length > 0) {
|
|
943
937
|
result.push({
|
|
944
938
|
operation: 'accessCols',
|
|
@@ -965,10 +959,10 @@ function mapDataFrameMutate(args, params, info) {
|
|
|
965
959
|
}
|
|
966
960
|
return result;
|
|
967
961
|
}
|
|
968
|
-
function mapDataFrameGroupBy(args, params, info) {
|
|
962
|
+
function mapDataFrameGroupBy(args, params, inference, info) {
|
|
969
963
|
args = (0, arguments_1.getEffectiveArgs)(args, params.special);
|
|
970
964
|
const dataFrame = (0, arguments_1.getFunctionArgument)(args, params.dataFrame, info);
|
|
971
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
965
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
972
966
|
return;
|
|
973
967
|
}
|
|
974
968
|
else if (args.length === 1) {
|
|
@@ -994,10 +988,10 @@ function mapDataFrameGroupBy(args, params, info) {
|
|
|
994
988
|
});
|
|
995
989
|
return result;
|
|
996
990
|
}
|
|
997
|
-
function mapDataFrameSummarize(args, params, info) {
|
|
991
|
+
function mapDataFrameSummarize(args, params, inference, info) {
|
|
998
992
|
args = (0, arguments_1.getEffectiveArgs)(args, params.special);
|
|
999
993
|
const dataFrame = (0, arguments_1.getFunctionArgument)(args, params.dataFrame, info);
|
|
1000
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
994
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
1001
995
|
return;
|
|
1002
996
|
}
|
|
1003
997
|
const result = [];
|
|
@@ -1021,12 +1015,12 @@ function mapDataFrameSummarize(args, params, info) {
|
|
|
1021
1015
|
});
|
|
1022
1016
|
return result;
|
|
1023
1017
|
}
|
|
1024
|
-
function mapDataFrameJoin(args, params,
|
|
1018
|
+
function mapDataFrameJoin(args, params, inference, info) {
|
|
1025
1019
|
const dataFrame = (0, arguments_1.getFunctionArgument)(args, params.dataFrame, info);
|
|
1026
1020
|
const joinAll = (0, arguments_1.getArgumentValue)(args, params.joinAll, info);
|
|
1027
1021
|
const joinLeft = (0, arguments_1.getArgumentValue)(args, params.joinLeft, info);
|
|
1028
1022
|
const joinRight = (0, arguments_1.getArgumentValue)(args, params.joinRight, info);
|
|
1029
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
1023
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
1030
1024
|
return;
|
|
1031
1025
|
}
|
|
1032
1026
|
else if (args.length === 1) {
|
|
@@ -1038,7 +1032,7 @@ function mapDataFrameJoin(args, params, info, ctx) {
|
|
|
1038
1032
|
const result = [];
|
|
1039
1033
|
const otherArg = (0, arguments_1.getFunctionArgument)(args, params.otherDataFrame, info);
|
|
1040
1034
|
const byArg = (0, arguments_1.getFunctionArgument)(args, params.by, info);
|
|
1041
|
-
const otherDataFrame =
|
|
1035
|
+
const otherDataFrame = inference.getAbstractValue(otherArg) ?? dataframe_domain_1.DataFrameDomain.top(info.ctx.config.abstractInterpretation.dataFrame.maxColNames);
|
|
1042
1036
|
let byCols;
|
|
1043
1037
|
const joinType = getJoinType(joinAll, joinLeft, joinRight);
|
|
1044
1038
|
if (byArg !== undefined) {
|
|
@@ -1073,10 +1067,10 @@ function mapDataFrameJoin(args, params, info, ctx) {
|
|
|
1073
1067
|
});
|
|
1074
1068
|
return result;
|
|
1075
1069
|
}
|
|
1076
|
-
function mapDataFrameIdentity(args, params, info) {
|
|
1070
|
+
function mapDataFrameIdentity(args, params, inference, info) {
|
|
1077
1071
|
args = (0, arguments_1.getEffectiveArgs)(args, params.special);
|
|
1078
1072
|
const dataFrame = (0, arguments_1.getFunctionArgument)(args, params.dataFrame, info);
|
|
1079
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
1073
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
1080
1074
|
return;
|
|
1081
1075
|
}
|
|
1082
1076
|
else if (params.disallowNamedArgs && args.some(arguments_1.isNamedArgument)) {
|
|
@@ -1087,15 +1081,15 @@ function mapDataFrameIdentity(args, params, info) {
|
|
|
1087
1081
|
operand: dataFrame.value.info.id
|
|
1088
1082
|
}];
|
|
1089
1083
|
}
|
|
1090
|
-
function mapDataFrameUnknown(args, params, info) {
|
|
1084
|
+
function mapDataFrameUnknown(args, params, inference, info) {
|
|
1091
1085
|
let dataFrame;
|
|
1092
1086
|
if (params.dataFrame !== undefined) {
|
|
1093
1087
|
dataFrame = (0, arguments_1.getFunctionArgument)(args, params.dataFrame, info);
|
|
1094
1088
|
}
|
|
1095
1089
|
else {
|
|
1096
|
-
dataFrame = args.find(arg => (0, arguments_1.isDataFrameArgument)(arg,
|
|
1090
|
+
dataFrame = args.find(arg => (0, arguments_1.isDataFrameArgument)(arg, inference));
|
|
1097
1091
|
}
|
|
1098
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
1092
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
1099
1093
|
return;
|
|
1100
1094
|
}
|
|
1101
1095
|
return [{
|
|
@@ -1104,23 +1098,24 @@ function mapDataFrameUnknown(args, params, info) {
|
|
|
1104
1098
|
...(params.constraintType !== undefined ? { type: params.constraintType } : {})
|
|
1105
1099
|
}];
|
|
1106
1100
|
}
|
|
1107
|
-
function getRequestFromRead(fileNameArg, textArg, params, info
|
|
1101
|
+
function getRequestFromRead(fileNameArg, textArg, params, info) {
|
|
1108
1102
|
let source;
|
|
1109
1103
|
let request;
|
|
1110
1104
|
if (fileNameArg !== undefined && fileNameArg !== r_function_call_1.EmptyArgument) {
|
|
1111
1105
|
const fileName = (0, resolve_args_1.resolveIdToArgValue)(fileNameArg, info);
|
|
1112
1106
|
if (typeof fileName === 'string') {
|
|
1107
|
+
const text = (0, resolve_args_1.unescapeSpecialChars)(fileName);
|
|
1113
1108
|
source = fileName;
|
|
1114
1109
|
const referenceChain = fileNameArg.info.file ? [fileNameArg.info.file] : [];
|
|
1115
|
-
const sources = (0, built_in_source_1.findSource)(ctx.config.solver.resolveSource, fileName, { referenceChain, ctx });
|
|
1110
|
+
const sources = (0, built_in_source_1.findSource)(info.ctx.config.solver.resolveSource, fileName, { referenceChain, ctx: info.ctx });
|
|
1116
1111
|
if (sources?.length === 1) {
|
|
1117
1112
|
source = sources[0];
|
|
1118
1113
|
// create request from resolved source file path
|
|
1119
1114
|
request = { request: 'file', content: sources[0] };
|
|
1120
1115
|
}
|
|
1121
|
-
else if (params.text === undefined &&
|
|
1116
|
+
else if (params.text === undefined && text.includes('\n')) {
|
|
1122
1117
|
// create request from string if file name argument contains newline
|
|
1123
|
-
request = (0, retriever_1.requestFromInput)(
|
|
1118
|
+
request = (0, retriever_1.requestFromInput)(text);
|
|
1124
1119
|
}
|
|
1125
1120
|
}
|
|
1126
1121
|
}
|
|
@@ -1131,28 +1126,16 @@ function getRequestFromRead(fileNameArg, textArg, params, info, ctx) {
|
|
|
1131
1126
|
request = (0, retriever_1.requestFromInput)((0, resolve_args_1.unescapeSpecialChars)(text));
|
|
1132
1127
|
}
|
|
1133
1128
|
}
|
|
1134
|
-
request = request ? ctx.files.resolveRequest(request).r : undefined;
|
|
1129
|
+
request = request ? info.ctx.files.resolveRequest(request).r : undefined;
|
|
1135
1130
|
return { source, request };
|
|
1136
1131
|
}
|
|
1137
|
-
function parseRequestContent(request, parser, maxLines) {
|
|
1138
|
-
const requestType = request.request;
|
|
1139
|
-
switch (requestType) {
|
|
1140
|
-
case 'text':
|
|
1141
|
-
request.content.split('\n').forEach(parser);
|
|
1142
|
-
return true;
|
|
1143
|
-
case 'file':
|
|
1144
|
-
return (0, files_1.readLineByLineSync)(request.content, parser, maxLines);
|
|
1145
|
-
default:
|
|
1146
|
-
(0, assert_1.assertUnreachable)(requestType);
|
|
1147
|
-
}
|
|
1148
|
-
}
|
|
1149
1132
|
/**
|
|
1150
1133
|
* Gets all entries from a line of a CSV file using a custom separator char, quote char, and comment char
|
|
1151
1134
|
*/
|
|
1152
1135
|
function getEntriesFromCsvLine(line, sep = ',', quote = '"', comment = '', trim = true) {
|
|
1153
1136
|
sep = (0, arguments_1.escapeRegExp)(sep, true); // only allow tokens like `\s`, `\t`, or `\n` in separator, quote, and comment chars
|
|
1154
|
-
quote = (0, arguments_1.escapeRegExp)(quote
|
|
1155
|
-
comment = (0, arguments_1.escapeRegExp)(comment
|
|
1137
|
+
quote = (0, arguments_1.escapeRegExp)(quote);
|
|
1138
|
+
comment = (0, arguments_1.escapeRegExp)(comment);
|
|
1156
1139
|
const quantifier = sep === '\\s' ? '+' : '*'; // do not allow unquoted empty entries in whitespace-sparated files
|
|
1157
1140
|
const LineCommentRegex = new RegExp(`[${comment}].*`);
|
|
1158
1141
|
const CsvEntryRegex = new RegExp(`(?<=^|[${sep}])(?:[${quote}]((?:[^${quote}]|[${quote}]{2})*)[${quote}]|([^${sep}]${quantifier}))`, 'g');
|
|
@@ -1177,6 +1160,11 @@ function getSelectedColumns(args, info) {
|
|
|
1177
1160
|
selectedCols = joinColumns(selectedCols, result.selectedCols);
|
|
1178
1161
|
unselectedCols = joinColumns(unselectedCols, result.unselectedCols);
|
|
1179
1162
|
}
|
|
1163
|
+
else if (arg.value?.type === type_1.RType.UnaryOp && arg.value.operator === '+' && info.idMap !== undefined) {
|
|
1164
|
+
const result = getSelectedColumns([(0, make_argument_1.toUnnamedArgument)(arg.value.operand, info.idMap)], info);
|
|
1165
|
+
selectedCols = joinColumns(selectedCols, result.selectedCols);
|
|
1166
|
+
unselectedCols = joinColumns(unselectedCols, result.unselectedCols);
|
|
1167
|
+
}
|
|
1180
1168
|
else if (arg.value?.type === type_1.RType.UnaryOp && arg.value.operator === '-' && info.idMap !== undefined) {
|
|
1181
1169
|
const result = getSelectedColumns([(0, make_argument_1.toUnnamedArgument)(arg.value.operand, info.idMap)], info);
|
|
1182
1170
|
selectedCols = joinColumns(selectedCols, result.unselectedCols);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import type { DataflowGraph } from '../../../dataflow/graph/graph';
|
|
2
|
+
import type { ReadOnlyFlowrAnalyzerContext } from '../../../project/context/flowr-analyzer-context';
|
|
2
3
|
import type { RNode } from '../../../r-bridge/lang-4.x/ast/model/model';
|
|
3
4
|
import type { ParentInformation } from '../../../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
4
|
-
import type {
|
|
5
|
-
import type { ReadOnlyFlowrAnalyzerContext } from '../../../project/context/flowr-analyzer-context';
|
|
5
|
+
import type { DataFrameOperations, DataFrameShapeInferenceVisitor } from '../shape-inference';
|
|
6
6
|
/**
|
|
7
|
-
* Maps a concrete data frame replacement function to abstract data frame operations.
|
|
8
|
-
* @param node - The R node of the replacement function
|
|
7
|
+
* Maps a concrete data frame replacement function call to abstract data frame operations.
|
|
8
|
+
* @param node - The R node of the replacement function call
|
|
9
9
|
* @param dfg - The data flow graph for resolving the arguments
|
|
10
|
-
* @param ctx - The
|
|
11
|
-
* @returns
|
|
10
|
+
* @param ctx - The current flowR analysis context
|
|
11
|
+
* @returns The mapped abstract data frame operations for the replacement function call, or `undefined` if the node does not represent a data frame replacement function call
|
|
12
12
|
*/
|
|
13
|
-
export declare function mapDataFrameReplacementFunction(node: RNode<ParentInformation>, expression: RNode<ParentInformation>, dfg: DataflowGraph, ctx: ReadOnlyFlowrAnalyzerContext):
|
|
13
|
+
export declare function mapDataFrameReplacementFunction(node: RNode<ParentInformation>, expression: RNode<ParentInformation>, inference: DataFrameShapeInferenceVisitor, dfg: DataflowGraph, ctx: ReadOnlyFlowrAnalyzerContext): DataFrameOperations;
|
|
@@ -18,40 +18,36 @@ const DataFrameReplacementFunctionMapper = {
|
|
|
18
18
|
'dimnames': mapDataFrameDimNamesAssignment
|
|
19
19
|
};
|
|
20
20
|
/**
|
|
21
|
-
* Maps a concrete data frame replacement function to abstract data frame operations.
|
|
22
|
-
* @param node - The R node of the replacement function
|
|
21
|
+
* Maps a concrete data frame replacement function call to abstract data frame operations.
|
|
22
|
+
* @param node - The R node of the replacement function call
|
|
23
23
|
* @param dfg - The data flow graph for resolving the arguments
|
|
24
|
-
* @param ctx - The
|
|
25
|
-
* @returns
|
|
24
|
+
* @param ctx - The current flowR analysis context
|
|
25
|
+
* @returns The mapped abstract data frame operations for the replacement function call, or `undefined` if the node does not represent a data frame replacement function call
|
|
26
26
|
*/
|
|
27
|
-
function mapDataFrameReplacementFunction(node, expression, dfg, ctx) {
|
|
27
|
+
function mapDataFrameReplacementFunction(node, expression, inference, dfg, ctx) {
|
|
28
28
|
const parent = hasParentReplacement(node, dfg) ? dfg.idMap?.get(node.info.parent) : undefined;
|
|
29
29
|
const resolveInfo = { graph: dfg, idMap: dfg.idMap, full: true, resolve: config_1.VariableResolve.Alias, ctx };
|
|
30
|
-
let operations;
|
|
31
30
|
if (node.type === type_1.RType.Access) {
|
|
32
31
|
if (node.access.every(arg => arg === r_function_call_1.EmptyArgument)) {
|
|
33
|
-
|
|
32
|
+
return mapDataFrameContentAssignment(node, expression, inference);
|
|
34
33
|
}
|
|
35
34
|
else if ((0, access_mapper_1.isStringBasedAccess)(node)) {
|
|
36
|
-
|
|
35
|
+
return mapDataFrameNamedColumnAssignment(node, expression, inference, resolveInfo);
|
|
37
36
|
}
|
|
38
37
|
else {
|
|
39
|
-
|
|
38
|
+
return mapDataFrameIndexColRowAssignment(node, expression, inference, resolveInfo);
|
|
40
39
|
}
|
|
41
40
|
}
|
|
42
41
|
else if (node.type === type_1.RType.FunctionCall && node.named && node.arguments.length === 1 && node.arguments[0] !== r_function_call_1.EmptyArgument) {
|
|
43
42
|
if (isDataFrameReplacement(node.functionName.content)) {
|
|
44
43
|
const functionName = node.functionName.content;
|
|
45
|
-
const
|
|
46
|
-
|
|
44
|
+
const mapper = DataFrameReplacementFunctionMapper[functionName];
|
|
45
|
+
return mapper(node.arguments[0], expression, inference, resolveInfo, parent);
|
|
47
46
|
}
|
|
48
47
|
else {
|
|
49
|
-
|
|
48
|
+
return mapDataFrameUnknownAssignment(node.arguments[0], expression, inference);
|
|
50
49
|
}
|
|
51
50
|
}
|
|
52
|
-
if (operations !== undefined) {
|
|
53
|
-
return { type: 'expression', operations: operations };
|
|
54
|
-
}
|
|
55
51
|
}
|
|
56
52
|
function isDataFrameReplacement(functionName) {
|
|
57
53
|
// a check with `functionName in DataFrameReplacementFunctionMapper` would return true for "toString"
|
|
@@ -61,9 +57,9 @@ function hasParentReplacement(node, dfg) {
|
|
|
61
57
|
const parentVertex = node.info.parent ? dfg.getVertex(node.info.parent) : undefined;
|
|
62
58
|
return (0, vertex_1.isFunctionCallVertex)(parentVertex) && parentVertex.origin.includes('builtin:replacement');
|
|
63
59
|
}
|
|
64
|
-
function mapDataFrameContentAssignment(access, expression,
|
|
60
|
+
function mapDataFrameContentAssignment(access, expression, inference) {
|
|
65
61
|
const dataFrame = access.accessed;
|
|
66
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
62
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
67
63
|
return;
|
|
68
64
|
}
|
|
69
65
|
if ((0, arguments_1.isRNull)(expression)) {
|
|
@@ -82,9 +78,9 @@ function mapDataFrameContentAssignment(access, expression, info) {
|
|
|
82
78
|
}];
|
|
83
79
|
}
|
|
84
80
|
}
|
|
85
|
-
function mapDataFrameNamedColumnAssignment(access, expression, info) {
|
|
81
|
+
function mapDataFrameNamedColumnAssignment(access, expression, inference, info) {
|
|
86
82
|
const dataFrame = access.accessed;
|
|
87
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
83
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference)) {
|
|
88
84
|
return;
|
|
89
85
|
}
|
|
90
86
|
const colname = (0, resolve_args_1.resolveIdToArgValueSymbolName)(access.access[0], info);
|
|
@@ -105,10 +101,10 @@ function mapDataFrameNamedColumnAssignment(access, expression, info) {
|
|
|
105
101
|
}];
|
|
106
102
|
}
|
|
107
103
|
}
|
|
108
|
-
function mapDataFrameIndexColRowAssignment(access, expression, info) {
|
|
104
|
+
function mapDataFrameIndexColRowAssignment(access, expression, inference, info) {
|
|
109
105
|
const dataFrame = access.accessed;
|
|
110
106
|
const args = access.access;
|
|
111
|
-
if (!(0, arguments_1.isDataFrameArgument)(dataFrame,
|
|
107
|
+
if (!(0, arguments_1.isDataFrameArgument)(dataFrame, inference) || args.every(arg => arg === r_function_call_1.EmptyArgument)) {
|
|
112
108
|
return;
|
|
113
109
|
}
|
|
114
110
|
const result = [];
|
|
@@ -160,8 +156,8 @@ function mapDataFrameIndexColRowAssignment(access, expression, info) {
|
|
|
160
156
|
}
|
|
161
157
|
return result;
|
|
162
158
|
}
|
|
163
|
-
function mapDataFrameColNamesAssignment(operand, expression, info, parent) {
|
|
164
|
-
if (!(0, arguments_1.isDataFrameArgument)(operand,
|
|
159
|
+
function mapDataFrameColNamesAssignment(operand, expression, inference, info, parent) {
|
|
160
|
+
if (!(0, arguments_1.isDataFrameArgument)(operand, inference)) {
|
|
165
161
|
return;
|
|
166
162
|
}
|
|
167
163
|
const argument = info.idMap !== undefined ? (0, make_argument_1.toUnnamedArgument)(expression, info.idMap) : r_function_call_1.EmptyArgument;
|
|
@@ -173,8 +169,8 @@ function mapDataFrameColNamesAssignment(operand, expression, info, parent) {
|
|
|
173
169
|
...(parent !== undefined ? { options: { partial: true } } : {})
|
|
174
170
|
}];
|
|
175
171
|
}
|
|
176
|
-
function mapDataFrameRowNamesAssignment(operand, expression,
|
|
177
|
-
if (!(0, arguments_1.isDataFrameArgument)(operand,
|
|
172
|
+
function mapDataFrameRowNamesAssignment(operand, expression, inference) {
|
|
173
|
+
if (!(0, arguments_1.isDataFrameArgument)(operand, inference)) {
|
|
178
174
|
return;
|
|
179
175
|
}
|
|
180
176
|
return [{
|
|
@@ -183,8 +179,8 @@ function mapDataFrameRowNamesAssignment(operand, expression, info) {
|
|
|
183
179
|
type: semantics_1.ConstraintType.OperandModification
|
|
184
180
|
}];
|
|
185
181
|
}
|
|
186
|
-
function mapDataFrameDimNamesAssignment(operand, expression,
|
|
187
|
-
if (!(0, arguments_1.isDataFrameArgument)(operand,
|
|
182
|
+
function mapDataFrameDimNamesAssignment(operand, expression, inference) {
|
|
183
|
+
if (!(0, arguments_1.isDataFrameArgument)(operand, inference)) {
|
|
188
184
|
return;
|
|
189
185
|
}
|
|
190
186
|
return [{
|
|
@@ -193,8 +189,8 @@ function mapDataFrameDimNamesAssignment(operand, expression, info) {
|
|
|
193
189
|
colnames: undefined
|
|
194
190
|
}];
|
|
195
191
|
}
|
|
196
|
-
function mapDataFrameUnknownAssignment(operand, expression,
|
|
197
|
-
if (!(0, arguments_1.isDataFrameArgument)(operand,
|
|
192
|
+
function mapDataFrameUnknownAssignment(operand, expression, inference) {
|
|
193
|
+
if (!(0, arguments_1.isDataFrameArgument)(operand, inference)) {
|
|
198
194
|
return;
|
|
199
195
|
}
|
|
200
196
|
return [{
|
|
@@ -35,7 +35,7 @@ export declare function unescapeQuotes(argument: undefined): undefined;
|
|
|
35
35
|
export declare function unescapeQuotes(argument: string): string;
|
|
36
36
|
export declare function unescapeQuotes(argument: string | undefined): string | undefined;
|
|
37
37
|
/**
|
|
38
|
-
* Unescapes escape sequences like `\n`, `\t`, `\'`, `\"`, `\\` back into actual newlines, tabs, quotes, and backslashes
|
|
38
|
+
* Unescapes escape sequences like `\r`, `\n`, `\t`, `\'`, `\"`, `\\` back into actual newlines, tabs, quotes, and backslashes
|
|
39
39
|
*/
|
|
40
40
|
export declare function unescapeSpecialChars(argument: undefined): undefined;
|
|
41
41
|
export declare function unescapeSpecialChars(argument: string): string;
|
|
@@ -113,6 +113,6 @@ function unescapeSpecialChars(argument) {
|
|
|
113
113
|
if (argument === undefined) {
|
|
114
114
|
return undefined;
|
|
115
115
|
}
|
|
116
|
-
return unescapeQuotes(argument).replaceAll('\\n', '\n').replaceAll('\\t', '\t').replaceAll('\\\\', '\\');
|
|
116
|
+
return unescapeQuotes(argument).replaceAll('\\r', '\r').replaceAll('\\n', '\n').replaceAll('\\t', '\t').replaceAll('\\\\', '\\');
|
|
117
117
|
}
|
|
118
118
|
//# sourceMappingURL=resolve-args.js.map
|
|
@@ -111,10 +111,9 @@ function applyAccessRowsSemantics(value, { rows }) {
|
|
|
111
111
|
}
|
|
112
112
|
function applyAssignColsSemantics(value, { columns }) {
|
|
113
113
|
if (columns?.every(col => typeof col === 'string')) {
|
|
114
|
-
const cols = columns.length;
|
|
115
114
|
return new dataframe_domain_1.DataFrameDomain({
|
|
116
115
|
colnames: value.colnames.union(setRange(columns)),
|
|
117
|
-
cols: value.cols.add([0,
|
|
116
|
+
cols: value.cols.add([0, columns.length]).max([columns.length, columns.length]),
|
|
118
117
|
rows: value.rows
|
|
119
118
|
});
|
|
120
119
|
}
|
|
@@ -155,7 +154,7 @@ function applySetColNamesSemantics(value, { colnames }, options) {
|
|
|
155
154
|
}
|
|
156
155
|
const allColNames = colnames?.every(assert_1.isNotUndefined) && value.cols.value !== lattice_1.Bottom && colnames.length >= value.cols.value[1];
|
|
157
156
|
return new dataframe_domain_1.DataFrameDomain({
|
|
158
|
-
colnames: allColNames ? value.colnames.create(setRange(colnames)) : value.colnames.
|
|
157
|
+
colnames: allColNames ? value.colnames.create(setRange(colnames)) : value.colnames.create(setRange(colnames)).widenUp(),
|
|
159
158
|
cols: value.cols,
|
|
160
159
|
rows: value.rows
|
|
161
160
|
});
|
|
@@ -347,13 +346,13 @@ function applyJoinSemantics(value, { other, by }, options) {
|
|
|
347
346
|
let rows;
|
|
348
347
|
switch (joinType) {
|
|
349
348
|
case 'inner':
|
|
350
|
-
rows = value.rows.
|
|
349
|
+
rows = value.rows.max(other.rows).widenDown();
|
|
351
350
|
break;
|
|
352
351
|
case 'left':
|
|
353
|
-
rows = value.rows;
|
|
352
|
+
rows = value.rows.max(other.rows.isValue() ? [0, other.rows.value[1]] : lattice_1.Bottom);
|
|
354
353
|
break;
|
|
355
354
|
case 'right':
|
|
356
|
-
rows = other.rows;
|
|
355
|
+
rows = other.rows.max(value.rows.isValue() ? [0, value.rows.value[1]] : lattice_1.Bottom);
|
|
357
356
|
break;
|
|
358
357
|
case 'full':
|
|
359
358
|
rows = mergeInterval(value.rows, other.rows);
|