@eagleoutice/flowr 2.7.0 → 2.7.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 +20 -20
- 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 +10 -9
- package/abstract-interpretation/data-frame/mappers/arguments.js +7 -4
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +17 -17
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +45 -50
- 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/semantics.js +2 -3
- 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-files-context.d.ts +9 -1
- package/project/context/flowr-analyzer-files-context.js +4 -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-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-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 +2 -0
- package/project/plugins/plugin-registry.d.ts +2 -1
- package/project/plugins/plugin-registry.js +2 -0
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +7 -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
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowrDescriptionFile = void 0;
|
|
4
|
+
const flowr_file_1 = require("../../../context/flowr-file");
|
|
5
|
+
/**
|
|
6
|
+
* This decorates a text file and provides access to its content as a DCF (Debian Control File)-like structure.
|
|
7
|
+
*/
|
|
8
|
+
class FlowrDescriptionFile extends flowr_file_1.FlowrFile {
|
|
9
|
+
wrapped;
|
|
10
|
+
/**
|
|
11
|
+
* Prefer the static {@link FlowrDescriptionFile.from} method to create instances of this class as it will not re-create if already a description file
|
|
12
|
+
* and handle role assignments.
|
|
13
|
+
*/
|
|
14
|
+
constructor(file) {
|
|
15
|
+
super(file.path(), file.role);
|
|
16
|
+
this.wrapped = file;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Loads and parses the content of the wrapped file as a DCF structure.
|
|
20
|
+
* @see {@link parseDCF} for details on the parsing logic.
|
|
21
|
+
*/
|
|
22
|
+
loadContent() {
|
|
23
|
+
return parseDCF(this.wrapped);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Description file lifter, this does not re-create if already a description file
|
|
27
|
+
*/
|
|
28
|
+
static from(file, role) {
|
|
29
|
+
if (role) {
|
|
30
|
+
file.assignRole(role);
|
|
31
|
+
}
|
|
32
|
+
return file instanceof FlowrDescriptionFile ? file : new FlowrDescriptionFile(file);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
exports.FlowrDescriptionFile = FlowrDescriptionFile;
|
|
36
|
+
/**
|
|
37
|
+
* Parses the given file in the 'Debian Control Format'.
|
|
38
|
+
* @param file - The file to parse
|
|
39
|
+
*/
|
|
40
|
+
function parseDCF(file) {
|
|
41
|
+
const result = new Map();
|
|
42
|
+
let currentKey = '';
|
|
43
|
+
let currentValue = '';
|
|
44
|
+
const indentRegex = new RegExp(/^\s/);
|
|
45
|
+
const firstColonRegex = new RegExp(/:(.*)/s);
|
|
46
|
+
const fileContent = file.content().toString().split(/\r?\n/);
|
|
47
|
+
for (const line of fileContent) {
|
|
48
|
+
if (indentRegex.test(line)) {
|
|
49
|
+
currentValue += '\n' + line.trim();
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
if (currentKey) {
|
|
53
|
+
const values = currentValue ? cleanValues(currentValue) : [];
|
|
54
|
+
result.set(currentKey, values);
|
|
55
|
+
}
|
|
56
|
+
const [key, rest] = line.split(firstColonRegex).map(s => s.trim());
|
|
57
|
+
currentKey = key?.trim() ?? '';
|
|
58
|
+
currentValue = rest?.trim() ?? '';
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (currentKey) {
|
|
62
|
+
const values = currentValue ? cleanValues(currentValue) : [];
|
|
63
|
+
result.set(currentKey, values);
|
|
64
|
+
}
|
|
65
|
+
return result;
|
|
66
|
+
}
|
|
67
|
+
const cleanSplitRegex = /[\n,]+/;
|
|
68
|
+
const cleanQuotesRegex = /'/g;
|
|
69
|
+
function cleanValues(values) {
|
|
70
|
+
return values
|
|
71
|
+
.split(cleanSplitRegex)
|
|
72
|
+
.map(s => s.trim().replace(cleanQuotesRegex, ''))
|
|
73
|
+
.filter(s => s.length > 0);
|
|
74
|
+
}
|
|
75
|
+
//# sourceMappingURL=flowr-description-file.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type FlowrFileProvider, type FileRole, FlowrFile } from '../../../context/flowr-file';
|
|
2
|
+
export interface NewsChunk {
|
|
3
|
+
header?: string;
|
|
4
|
+
version?: string;
|
|
5
|
+
date?: string;
|
|
6
|
+
entries: string[] | NewsChunk[];
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* This decorates a text file and provides access to its content following R's NEWS file structure.
|
|
10
|
+
*/
|
|
11
|
+
export declare class FlowrNewsFile extends FlowrFile<NewsChunk[]> {
|
|
12
|
+
private readonly wrapped;
|
|
13
|
+
/**
|
|
14
|
+
* Prefer the static {@link FlowrNewsFile.from} method to create instances of this class as it will not re-create if already a news file
|
|
15
|
+
* and handle role assignments.
|
|
16
|
+
*/
|
|
17
|
+
constructor(file: FlowrFileProvider);
|
|
18
|
+
/**
|
|
19
|
+
* Loads and parses the content of the wrapped file as news chunks.
|
|
20
|
+
* @see {@link parseNews} for details on the parsing logic.
|
|
21
|
+
*/
|
|
22
|
+
protected loadContent(): NewsChunk[];
|
|
23
|
+
/**
|
|
24
|
+
* News file lifter, this does not re-create if already a news file
|
|
25
|
+
*/
|
|
26
|
+
static from(file: FlowrFileProvider | FlowrNewsFile, role?: FileRole): FlowrNewsFile;
|
|
27
|
+
}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowrNewsFile = void 0;
|
|
4
|
+
const flowr_file_1 = require("../../../context/flowr-file");
|
|
5
|
+
const r_regex_1 = require("../../../../util/r-regex");
|
|
6
|
+
const objects_1 = require("../../../../util/objects");
|
|
7
|
+
/**
|
|
8
|
+
* This decorates a text file and provides access to its content following R's NEWS file structure.
|
|
9
|
+
*/
|
|
10
|
+
class FlowrNewsFile extends flowr_file_1.FlowrFile {
|
|
11
|
+
wrapped;
|
|
12
|
+
/**
|
|
13
|
+
* Prefer the static {@link FlowrNewsFile.from} method to create instances of this class as it will not re-create if already a news file
|
|
14
|
+
* and handle role assignments.
|
|
15
|
+
*/
|
|
16
|
+
constructor(file) {
|
|
17
|
+
super(file.path(), file.role);
|
|
18
|
+
this.wrapped = file;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Loads and parses the content of the wrapped file as news chunks.
|
|
22
|
+
* @see {@link parseNews} for details on the parsing logic.
|
|
23
|
+
*/
|
|
24
|
+
loadContent() {
|
|
25
|
+
return parseNews(this.wrapped);
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* News file lifter, this does not re-create if already a news file
|
|
29
|
+
*/
|
|
30
|
+
static from(file, role) {
|
|
31
|
+
if (role) {
|
|
32
|
+
file.assignRole(role);
|
|
33
|
+
}
|
|
34
|
+
return file instanceof FlowrNewsFile ? file : new FlowrNewsFile(file);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
exports.FlowrNewsFile = FlowrNewsFile;
|
|
38
|
+
function makeRversionRegex() {
|
|
39
|
+
// ^([[:space:]]*(%s)|(%s))(%s).*$
|
|
40
|
+
const fst = 'CHANGES? *(IN|FOR).*VERSION *|CHANGES? *(IN|FOR|TO) *';
|
|
41
|
+
const pVersion = r_regex_1.RStandardRegexp.ValidPackageVersion.source;
|
|
42
|
+
const pName = r_regex_1.RStandardRegexp.ValidPackageName.source;
|
|
43
|
+
const teachingDemos = [
|
|
44
|
+
// TeachingDemos pomp ouch
|
|
45
|
+
'NEW IN .*',
|
|
46
|
+
// HyperbolicDist nls2 proto
|
|
47
|
+
'VERSION:? *',
|
|
48
|
+
`${pName} +`,
|
|
49
|
+
// E.g., lattice:
|
|
50
|
+
// Changes in lattice 0.17
|
|
51
|
+
`CHANGES IN ${pName} +`,
|
|
52
|
+
// sv*
|
|
53
|
+
`== Changes in ${pName} +`,
|
|
54
|
+
// tcltk2
|
|
55
|
+
'== Version +',
|
|
56
|
+
// R2WinBUGS
|
|
57
|
+
'update *',
|
|
58
|
+
'v *',
|
|
59
|
+
'',
|
|
60
|
+
].join('|');
|
|
61
|
+
const weAreNicerFlags = 'i';
|
|
62
|
+
const pkgVersionLine = `\\s*(${pName})\\s+version\\s+(${pVersion})\\s*|\\s*#+\\s*${pName} (\\([^)]*\\)|${pVersion}).*`;
|
|
63
|
+
return new RegExp(`^(\\s*(${fst})|(${teachingDemos}))((${pVersion}).*)|${pkgVersionLine}$`, weAreNicerFlags);
|
|
64
|
+
}
|
|
65
|
+
//"^.*([[:digit:]]{4}-[[:digit:]]{2}-[[:digit:]]{2})[[:punct:][:space:]]*$",
|
|
66
|
+
const RDateRegex = new RegExp(`^.*(\\d{4}-\\d{2}-\\d{2})[${r_regex_1.RPunctuationChars}\\s]*$`);
|
|
67
|
+
// ^[[:space:]]*([o*+-])
|
|
68
|
+
const RBulletPointRegex = /^\s*(?<bullet>[o*+-])/;
|
|
69
|
+
// ^([[:alpha:]].*)[[:space:]]*$"
|
|
70
|
+
const RCategoryRegex = /^((#+\s*)?([A-Za-z].*))\s*$/;
|
|
71
|
+
const AnyVersionRegex = new RegExp(r_regex_1.RStandardRegexp.ValidPackageVersion.source + '|dev(e(l(opment)?)?)? (ver(sion)?)?|(?<=\\()[^)]*(?=\\))', 'i');
|
|
72
|
+
function splitLinesRegex(relevantLines, regex) {
|
|
73
|
+
const lineChunks = [];
|
|
74
|
+
let currentChunk = [];
|
|
75
|
+
for (const line of relevantLines) {
|
|
76
|
+
if (regex.test(line)) {
|
|
77
|
+
if (currentChunk.length > 0) {
|
|
78
|
+
lineChunks.push(currentChunk);
|
|
79
|
+
}
|
|
80
|
+
currentChunk = [line];
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
currentChunk.push(line);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
if (currentChunk.length > 0) {
|
|
87
|
+
lineChunks.push(currentChunk);
|
|
88
|
+
}
|
|
89
|
+
return lineChunks;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Parses the given file into news chunks.
|
|
93
|
+
* @param file - The file to parse
|
|
94
|
+
* @see https://github.com/r-devel/r-svn/blob/44474af03ae77fd3b9a340279fa10cb698d106c3/src/library/tools/R/news.R#L91-L92
|
|
95
|
+
*/
|
|
96
|
+
function parseNews(file) {
|
|
97
|
+
// ^[[:space:]]*[[:punct:]]*[[:space:]]*
|
|
98
|
+
const noiseRegex = new RegExp(`^\\s*[${r_regex_1.RPunctuationChars}]*\\s*$`);
|
|
99
|
+
const lines = file.content().toString().split(/\r?\n/)
|
|
100
|
+
// first we clean underlines and friends (according to the R impl)
|
|
101
|
+
.filter(l => !noiseRegex.test(l));
|
|
102
|
+
// this is a port of the incredible complex R NEWS regex, but luckily it is not too liberal :D
|
|
103
|
+
const regexVersion = makeRversionRegex();
|
|
104
|
+
// filter lines that match the version regex
|
|
105
|
+
const versionLines = lines.map(line => regexVersion.test(line));
|
|
106
|
+
// drop the header by removing everything before the first match
|
|
107
|
+
const firstVersionIndex = versionLines.findIndex(v => v);
|
|
108
|
+
const relevantLines = lines.slice(firstVersionIndex);
|
|
109
|
+
// split at every version line
|
|
110
|
+
const lineChunks = splitLinesRegex(relevantLines, regexVersion);
|
|
111
|
+
/**
|
|
112
|
+
* @see https://github.com/r-devel/r-svn/blob/44474af03ae77fd3b9a340279fa10cb698d106c3/src/library/tools/R/news.R#L183
|
|
113
|
+
*/
|
|
114
|
+
function processChunk(lines, header) {
|
|
115
|
+
let date;
|
|
116
|
+
let head;
|
|
117
|
+
if (header) {
|
|
118
|
+
head = AnyVersionRegex.exec(header)?.[0];
|
|
119
|
+
date = RDateRegex.exec(header)?.[1];
|
|
120
|
+
}
|
|
121
|
+
const content = lines.join('\n').trim();
|
|
122
|
+
const hasBullets = RBulletPointRegex.exec(content);
|
|
123
|
+
if (hasBullets) {
|
|
124
|
+
const separator = hasBullets.groups?.bullet ?? '-';
|
|
125
|
+
const lineChunks = splitLinesRegex(lines, new RegExp(`^\\s*[${separator}]\\s+`)).map(
|
|
126
|
+
// apparently we have to trim leading '\tab' indentations
|
|
127
|
+
chunkLines => chunkLines.map(l => {
|
|
128
|
+
return l.replace(new RegExp(`^\\s*[${separator}]\\s+`), '').replace(/^\t?/gm, '').trim();
|
|
129
|
+
}).join('\n'));
|
|
130
|
+
return (0, objects_1.compactRecord)({
|
|
131
|
+
header,
|
|
132
|
+
version: head,
|
|
133
|
+
date,
|
|
134
|
+
entries: lineChunks
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
// from the spec: "Categories should be non-empty starting in column 1."
|
|
139
|
+
const categoryChunks = splitLinesRegex(lines, RCategoryRegex);
|
|
140
|
+
// different to R we may accept no category blobs here
|
|
141
|
+
return (0, objects_1.compactRecord)({
|
|
142
|
+
header,
|
|
143
|
+
version: head,
|
|
144
|
+
date,
|
|
145
|
+
entries: categoryChunks.length > 1 ?
|
|
146
|
+
categoryChunks.map(chunkLines => processChunk(chunkLines, header = RCategoryRegex.exec(chunkLines[0])?.[1])) : [content]
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return lineChunks.map(l => processChunk(l.slice(1), l[0]));
|
|
151
|
+
}
|
|
152
|
+
//# sourceMappingURL=flowr-news-file.js.map
|
|
@@ -2,7 +2,7 @@ import { FlowrAnalyzerFilePlugin } from './flowr-analyzer-file-plugin';
|
|
|
2
2
|
import { SemVer } from 'semver';
|
|
3
3
|
import type { PathLike } from 'fs';
|
|
4
4
|
import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
|
|
5
|
-
import { FlowrDescriptionFile } from './flowr-description-file';
|
|
5
|
+
import { FlowrDescriptionFile } from './files/flowr-description-file';
|
|
6
6
|
import { type FlowrFileProvider } from '../../context/flowr-file';
|
|
7
7
|
export declare const descriptionFileLog: import("tslog").Logger<import("tslog").ILogObj>;
|
|
8
8
|
/**
|
|
@@ -4,7 +4,7 @@ exports.FlowrAnalyzerDescriptionFilePlugin = exports.descriptionFileLog = void 0
|
|
|
4
4
|
const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
|
|
5
5
|
const semver_1 = require("semver");
|
|
6
6
|
const log_1 = require("../../../util/log");
|
|
7
|
-
const flowr_description_file_1 = require("./flowr-description-file");
|
|
7
|
+
const flowr_description_file_1 = require("./files/flowr-description-file");
|
|
8
8
|
const flowr_file_1 = require("../../context/flowr-file");
|
|
9
9
|
const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source");
|
|
10
10
|
exports.descriptionFileLog = log_1.log.getSubLogger({ name: 'flowr-analyzer-loading-order-description-file-plugin' });
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { FlowrAnalyzerFilePlugin } from './flowr-analyzer-file-plugin';
|
|
2
|
+
import { SemVer } from 'semver';
|
|
3
|
+
import type { PathLike } from 'fs';
|
|
4
|
+
import type { FlowrAnalyzerContext } from '../../context/flowr-analyzer-context';
|
|
5
|
+
import { type FlowrFileProvider } from '../../context/flowr-file';
|
|
6
|
+
import { FlowrNewsFile } from './files/flowr-news-file';
|
|
7
|
+
/**
|
|
8
|
+
* This plugin provides support for R `NEWS` files.
|
|
9
|
+
* @see https://rdrr.io/r/utils/news.html
|
|
10
|
+
*/
|
|
11
|
+
export declare class FlowrAnalyzerNewsFilePlugin extends FlowrAnalyzerFilePlugin {
|
|
12
|
+
readonly name = "flowr-analyzer-news-file-plugin";
|
|
13
|
+
readonly description = "This plugin provides support for NEWS files and extracts their content into version chunks.";
|
|
14
|
+
readonly version: SemVer;
|
|
15
|
+
private readonly pattern;
|
|
16
|
+
/**
|
|
17
|
+
* Creates a new instance of the NEWS file plugin.
|
|
18
|
+
* @param filePattern - The pattern to identify NEWS files, see {@link NewsFilePattern} for the default pattern.
|
|
19
|
+
*/
|
|
20
|
+
constructor(filePattern?: RegExp);
|
|
21
|
+
applies(file: PathLike): boolean;
|
|
22
|
+
process(_ctx: FlowrAnalyzerContext, file: FlowrFileProvider): FlowrNewsFile;
|
|
23
|
+
}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FlowrAnalyzerNewsFilePlugin = void 0;
|
|
4
|
+
const flowr_analyzer_file_plugin_1 = require("./flowr-analyzer-file-plugin");
|
|
5
|
+
const semver_1 = require("semver");
|
|
6
|
+
const flowr_file_1 = require("../../context/flowr-file");
|
|
7
|
+
const built_in_source_1 = require("../../../dataflow/internal/process/functions/call/built-in/built-in-source");
|
|
8
|
+
const flowr_news_file_1 = require("./files/flowr-news-file");
|
|
9
|
+
const NewsFilePattern = /^NEWS(\.(rd|md))?$/i;
|
|
10
|
+
/**
|
|
11
|
+
* This plugin provides support for R `NEWS` files.
|
|
12
|
+
* @see https://rdrr.io/r/utils/news.html
|
|
13
|
+
*/
|
|
14
|
+
class FlowrAnalyzerNewsFilePlugin extends flowr_analyzer_file_plugin_1.FlowrAnalyzerFilePlugin {
|
|
15
|
+
name = 'flowr-analyzer-news-file-plugin';
|
|
16
|
+
description = 'This plugin provides support for NEWS files and extracts their content into version chunks.';
|
|
17
|
+
version = new semver_1.SemVer('0.1.0');
|
|
18
|
+
pattern;
|
|
19
|
+
/**
|
|
20
|
+
* Creates a new instance of the NEWS file plugin.
|
|
21
|
+
* @param filePattern - The pattern to identify NEWS files, see {@link NewsFilePattern} for the default pattern.
|
|
22
|
+
*/
|
|
23
|
+
constructor(filePattern = NewsFilePattern) {
|
|
24
|
+
super();
|
|
25
|
+
this.pattern = filePattern;
|
|
26
|
+
}
|
|
27
|
+
applies(file) {
|
|
28
|
+
return this.pattern.test((0, built_in_source_1.platformBasename)(file.toString()));
|
|
29
|
+
}
|
|
30
|
+
process(_ctx, file) {
|
|
31
|
+
return flowr_news_file_1.FlowrNewsFile.from(file, flowr_file_1.FileRole.News);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.FlowrAnalyzerNewsFilePlugin = FlowrAnalyzerNewsFilePlugin;
|
|
35
|
+
//# sourceMappingURL=flowr-analyzer-news-file-plugin.js.map
|
|
@@ -3,7 +3,7 @@ import { SemVer } from 'semver';
|
|
|
3
3
|
import type { FlowrAnalyzerContext } from '../../../context/flowr-analyzer-context';
|
|
4
4
|
import type { FlowrFileProvider } from '../../../context/flowr-file';
|
|
5
5
|
import { FlowrAnalyzerFilePlugin } from '../flowr-analyzer-file-plugin';
|
|
6
|
-
import { FlowrJupyterFile } from '
|
|
6
|
+
import { FlowrJupyterFile } from '../files/flowr-jupyter-file';
|
|
7
7
|
/**
|
|
8
8
|
* The plugin provides support for Jupyter (`.ipynb`) files
|
|
9
9
|
*/
|
|
@@ -4,7 +4,7 @@ exports.FlowrAnalyzerJupyterFilePlugin = void 0;
|
|
|
4
4
|
const semver_1 = require("semver");
|
|
5
5
|
const flowr_analyzer_file_plugin_1 = require("../flowr-analyzer-file-plugin");
|
|
6
6
|
const built_in_source_1 = require("../../../../dataflow/internal/process/functions/call/built-in/built-in-source");
|
|
7
|
-
const flowr_jupyter_file_1 = require("
|
|
7
|
+
const flowr_jupyter_file_1 = require("../files/flowr-jupyter-file");
|
|
8
8
|
const IpynbPattern = /\.ipynb$/i;
|
|
9
9
|
/**
|
|
10
10
|
* The plugin provides support for Jupyter (`.ipynb`) files
|
|
@@ -3,7 +3,7 @@ import { SemVer } from 'semver';
|
|
|
3
3
|
import type { FlowrAnalyzerContext } from '../../../context/flowr-analyzer-context';
|
|
4
4
|
import type { FlowrFileProvider } from '../../../context/flowr-file';
|
|
5
5
|
import { FlowrAnalyzerFilePlugin } from '../flowr-analyzer-file-plugin';
|
|
6
|
-
import { FlowrRMarkdownFile } from '
|
|
6
|
+
import { FlowrRMarkdownFile } from '../files/flowr-rmarkdown-file';
|
|
7
7
|
/**
|
|
8
8
|
* The plugin provides support for Quarto R Markdown (`.qmd`) files
|
|
9
9
|
*/
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FlowrAnalyzerQmdFilePlugin = void 0;
|
|
4
4
|
const semver_1 = require("semver");
|
|
5
5
|
const flowr_analyzer_file_plugin_1 = require("../flowr-analyzer-file-plugin");
|
|
6
|
-
const flowr_rmarkdown_file_1 = require("
|
|
6
|
+
const flowr_rmarkdown_file_1 = require("../files/flowr-rmarkdown-file");
|
|
7
7
|
const built_in_source_1 = require("../../../../dataflow/internal/process/functions/call/built-in/built-in-source");
|
|
8
8
|
const QmdPattern = /\.qmd$/i;
|
|
9
9
|
/**
|
|
@@ -3,7 +3,7 @@ import { SemVer } from 'semver';
|
|
|
3
3
|
import type { FlowrAnalyzerContext } from '../../../context/flowr-analyzer-context';
|
|
4
4
|
import { type FlowrFileProvider } from '../../../context/flowr-file';
|
|
5
5
|
import { FlowrAnalyzerFilePlugin } from '../flowr-analyzer-file-plugin';
|
|
6
|
-
import { FlowrRMarkdownFile } from '
|
|
6
|
+
import { FlowrRMarkdownFile } from '../files/flowr-rmarkdown-file';
|
|
7
7
|
/**
|
|
8
8
|
* The plugin provides support for R Markdown (`.rmd`) files
|
|
9
9
|
*/
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.FlowrAnalyzerRmdFilePlugin = void 0;
|
|
4
4
|
const semver_1 = require("semver");
|
|
5
5
|
const flowr_analyzer_file_plugin_1 = require("../flowr-analyzer-file-plugin");
|
|
6
|
-
const flowr_rmarkdown_file_1 = require("
|
|
6
|
+
const flowr_rmarkdown_file_1 = require("../files/flowr-rmarkdown-file");
|
|
7
7
|
const built_in_source_1 = require("../../../../dataflow/internal/process/functions/call/built-in/built-in-source");
|
|
8
8
|
const RmdPattern = /\.rmd$/i;
|
|
9
9
|
/**
|
|
@@ -7,6 +7,7 @@ const flowr_analyzer_loading_order_description_file_plugin_1 = require("./loadin
|
|
|
7
7
|
const flowr_analyzer_rmd_file_plugin_1 = require("./file-plugins/notebooks/flowr-analyzer-rmd-file-plugin");
|
|
8
8
|
const flowr_analyzer_qmd_file_plugin_1 = require("./file-plugins/notebooks/flowr-analyzer-qmd-file-plugin");
|
|
9
9
|
const flowr_analyzer_jupyter_file_plugin_1 = require("./file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin");
|
|
10
|
+
const flowr_analyzer_news_file_plugin_1 = require("./file-plugins/flowr-analyzer-news-file-plugin");
|
|
10
11
|
/**
|
|
11
12
|
* Provides the default set of Flowr Analyzer plugins.
|
|
12
13
|
*/
|
|
@@ -18,6 +19,7 @@ function FlowrAnalyzerPluginDefaults() {
|
|
|
18
19
|
new flowr_analyzer_rmd_file_plugin_1.FlowrAnalyzerRmdFilePlugin(),
|
|
19
20
|
new flowr_analyzer_qmd_file_plugin_1.FlowrAnalyzerQmdFilePlugin(),
|
|
20
21
|
new flowr_analyzer_jupyter_file_plugin_1.FlowrAnalyzerJupyterFilePlugin(),
|
|
22
|
+
new flowr_analyzer_news_file_plugin_1.FlowrAnalyzerNewsFilePlugin()
|
|
21
23
|
];
|
|
22
24
|
}
|
|
23
25
|
//# sourceMappingURL=flowr-analyzer-plugin-defaults.js.map
|
|
@@ -5,10 +5,11 @@ import { FlowrAnalyzerLoadingOrderDescriptionFilePlugin } from './loading-order-
|
|
|
5
5
|
import { FlowrAnalyzerRmdFilePlugin } from './file-plugins/notebooks/flowr-analyzer-rmd-file-plugin';
|
|
6
6
|
import { FlowrAnalyzerQmdFilePlugin } from './file-plugins/notebooks/flowr-analyzer-qmd-file-plugin';
|
|
7
7
|
import { FlowrAnalyzerJupyterFilePlugin } from './file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin';
|
|
8
|
+
import { FlowrAnalyzerNewsFilePlugin } from './file-plugins/flowr-analyzer-news-file-plugin';
|
|
8
9
|
/**
|
|
9
10
|
* The built-in Flowr Analyzer plugins that are always available.
|
|
10
11
|
*/
|
|
11
|
-
export declare const BuiltInPlugins: [["file:description", typeof FlowrAnalyzerDescriptionFilePlugin], ["versions:description", typeof FlowrAnalyzerPackageVersionsDescriptionFilePlugin], ["loading-order:description", typeof FlowrAnalyzerLoadingOrderDescriptionFilePlugin], ["file:rmd", typeof FlowrAnalyzerRmdFilePlugin], ["file:qmd", typeof FlowrAnalyzerQmdFilePlugin], ["file:ipynb", typeof FlowrAnalyzerJupyterFilePlugin]];
|
|
12
|
+
export declare const BuiltInPlugins: [["file:description", typeof FlowrAnalyzerDescriptionFilePlugin], ["versions:description", typeof FlowrAnalyzerPackageVersionsDescriptionFilePlugin], ["loading-order:description", typeof FlowrAnalyzerLoadingOrderDescriptionFilePlugin], ["file:rmd", typeof FlowrAnalyzerRmdFilePlugin], ["file:qmd", typeof FlowrAnalyzerQmdFilePlugin], ["file:ipynb", typeof FlowrAnalyzerJupyterFilePlugin], ["file:news", typeof FlowrAnalyzerNewsFilePlugin]];
|
|
12
13
|
export type BuiltInFlowrPluginName = typeof BuiltInPlugins[number][0];
|
|
13
14
|
export type BuiltInFlowrPluginArgs<N extends BuiltInFlowrPluginName> = N extends typeof BuiltInPlugins[number][0] ? ConstructorParameters<Extract<typeof BuiltInPlugins[number], [N, PluginProducer]>[1]> : never;
|
|
14
15
|
type PluginProducer = new (...args: never[]) => FlowrAnalyzerPlugin;
|
|
@@ -11,6 +11,7 @@ const flowr_analyzer_rmd_file_plugin_1 = require("./file-plugins/notebooks/flowr
|
|
|
11
11
|
const flowr_analyzer_qmd_file_plugin_1 = require("./file-plugins/notebooks/flowr-analyzer-qmd-file-plugin");
|
|
12
12
|
const assert_1 = require("../../util/assert");
|
|
13
13
|
const flowr_analyzer_jupyter_file_plugin_1 = require("./file-plugins/notebooks/flowr-analyzer-jupyter-file-plugin");
|
|
14
|
+
const flowr_analyzer_news_file_plugin_1 = require("./file-plugins/flowr-analyzer-news-file-plugin");
|
|
14
15
|
/**
|
|
15
16
|
* The built-in Flowr Analyzer plugins that are always available.
|
|
16
17
|
*/
|
|
@@ -21,6 +22,7 @@ exports.BuiltInPlugins = [
|
|
|
21
22
|
['file:rmd', flowr_analyzer_rmd_file_plugin_1.FlowrAnalyzerRmdFilePlugin],
|
|
22
23
|
['file:qmd', flowr_analyzer_qmd_file_plugin_1.FlowrAnalyzerQmdFilePlugin],
|
|
23
24
|
['file:ipynb', flowr_analyzer_jupyter_file_plugin_1.FlowrAnalyzerJupyterFilePlugin],
|
|
25
|
+
['file:news', flowr_analyzer_news_file_plugin_1.FlowrAnalyzerNewsFilePlugin]
|
|
24
26
|
];
|
|
25
27
|
/**
|
|
26
28
|
* The registry of built-in and user-registered Flowr Analyzer plugins.
|
|
@@ -20,6 +20,7 @@ class FlowrAnalyzerProjectDiscoveryPlugin extends flowr_analyzer_plugin_1.FlowrA
|
|
|
20
20
|
}
|
|
21
21
|
exports.FlowrAnalyzerProjectDiscoveryPlugin = FlowrAnalyzerProjectDiscoveryPlugin;
|
|
22
22
|
const discoverRSourcesRegex = /\.(r|rmd|ipynb|qmd)$/i;
|
|
23
|
+
const ignorePathsWith = /(\.git|\.svn|\.hg|renv|packrat|node_modules|__pycache__|\.Rproj\.user)/i;
|
|
23
24
|
/**
|
|
24
25
|
* This is the default dummy implementation of the {@link FlowrAnalyzerProjectDiscoveryPlugin}.
|
|
25
26
|
* It simply collects all files in the given folder and returns them as either {@link RParseRequest} (for R and Rmd files) or {@link FlowrTextFile} (for all other files).
|
|
@@ -29,14 +30,19 @@ class DefaultFlowrAnalyzerProjectDiscoveryPlugin extends FlowrAnalyzerProjectDis
|
|
|
29
30
|
description = 'This is the default project discovery plugin that does nothing.';
|
|
30
31
|
version = new semver_1.SemVer('0.0.0');
|
|
31
32
|
supportedExtensions;
|
|
32
|
-
|
|
33
|
+
ignorePathsRegex;
|
|
34
|
+
constructor(triggerOnExtensions = discoverRSourcesRegex, ignorePathsRegex = ignorePathsWith) {
|
|
33
35
|
super();
|
|
34
36
|
this.supportedExtensions = triggerOnExtensions;
|
|
37
|
+
this.ignorePathsRegex = ignorePathsRegex;
|
|
35
38
|
}
|
|
36
39
|
process(_context, args) {
|
|
37
40
|
const requests = [];
|
|
38
41
|
/* the dummy approach of collecting all files, group R and Rmd files, and be done with it */
|
|
39
42
|
for (const file of (0, files_1.getAllFilesSync)(args.content)) {
|
|
43
|
+
if (this.ignorePathsRegex.test(file)) {
|
|
44
|
+
continue;
|
|
45
|
+
}
|
|
40
46
|
if (this.supportedExtensions.test(file)) {
|
|
41
47
|
requests.push({ content: file, request: 'file' });
|
|
42
48
|
}
|
|
@@ -16,7 +16,9 @@ async function executeDfShapeQuery({ analyzer }, queries) {
|
|
|
16
16
|
const dfg = (await analyzer.dataflow()).graph;
|
|
17
17
|
const cfg = await analyzer.controlflow();
|
|
18
18
|
const start = Date.now();
|
|
19
|
-
const
|
|
19
|
+
const inference = new shape_inference_1.DataFrameShapeInferenceVisitor({ controlFlow: cfg, dfg, normalizedAst: ast, ctx: analyzer.inspectContext() });
|
|
20
|
+
inference.start();
|
|
21
|
+
const domains = inference.getEndState();
|
|
20
22
|
if (queries.length === 1 && queries[0].criterion === undefined) {
|
|
21
23
|
return {
|
|
22
24
|
'.meta': {
|
|
@@ -37,7 +39,7 @@ async function executeDfShapeQuery({ analyzer }, queries) {
|
|
|
37
39
|
}
|
|
38
40
|
const nodeId = (0, parse_1.slicingCriterionToId)(query.criterion, ast.idMap);
|
|
39
41
|
const node = ast.idMap.get(nodeId);
|
|
40
|
-
const value =
|
|
42
|
+
const value = inference.getAbstractValue(node?.info.id);
|
|
41
43
|
result.set(query.criterion, value);
|
|
42
44
|
}
|
|
43
45
|
return {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { FilesQuery, FilesQueryResult } from './files-query-format';
|
|
2
|
+
import type { BasicQueryData } from '../../base-query-format';
|
|
3
|
+
/**
|
|
4
|
+
* Executes the given files queries using the provided analyzer.
|
|
5
|
+
*/
|
|
6
|
+
export declare function executeFileQuery({ analyzer }: BasicQueryData, queries: readonly FilesQuery[]): Promise<FilesQueryResult>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeFileQuery = executeFileQuery;
|
|
4
|
+
/**
|
|
5
|
+
* Executes the given files queries using the provided analyzer.
|
|
6
|
+
*/
|
|
7
|
+
function executeFileQuery({ analyzer }, queries) {
|
|
8
|
+
const start = Date.now();
|
|
9
|
+
analyzer.inspectContext().resolvePreAnalysis();
|
|
10
|
+
const base = analyzer.inspectContext().files.getAllFiles();
|
|
11
|
+
let files = [];
|
|
12
|
+
const foundFingerprints = new Set();
|
|
13
|
+
for (const query of queries) {
|
|
14
|
+
if (query.matchesPathRegex === undefined && query.roles === undefined) {
|
|
15
|
+
files = base.map(l => ({
|
|
16
|
+
role: l.role,
|
|
17
|
+
content: l.content(),
|
|
18
|
+
path: l.path()
|
|
19
|
+
}));
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
const pathRegex = query.matchesPathRegex ? new RegExp(query.matchesPathRegex) : undefined;
|
|
23
|
+
for (const file of base) {
|
|
24
|
+
const fingerprint = `${file.role}:::${file.path()}`;
|
|
25
|
+
if (foundFingerprints.has(fingerprint)) {
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (pathRegex && !pathRegex.test(file.path())) {
|
|
29
|
+
continue;
|
|
30
|
+
}
|
|
31
|
+
if (query.roles && !query.roles.includes(file.role ?? '')) {
|
|
32
|
+
continue;
|
|
33
|
+
}
|
|
34
|
+
foundFingerprints.add(fingerprint);
|
|
35
|
+
files.push({
|
|
36
|
+
role: file.role,
|
|
37
|
+
content: file.content(),
|
|
38
|
+
path: file.path()
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
return Promise.resolve({
|
|
43
|
+
'.meta': {
|
|
44
|
+
timing: Date.now() - start
|
|
45
|
+
},
|
|
46
|
+
files
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=files-query-executor.js.map
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
2
|
+
import Joi from 'joi';
|
|
3
|
+
import type { ParsedQueryLine } from '../../query';
|
|
4
|
+
import { executeFileQuery } from './files-query-executor';
|
|
5
|
+
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
6
|
+
import { FileRole } from '../../../project/context/flowr-file';
|
|
7
|
+
import type { ReplOutput } from '../../../cli/repl/commands/repl-main';
|
|
8
|
+
import type { FlowrConfigOptions } from '../../../config';
|
|
9
|
+
import type { CommandCompletions } from '../../../cli/repl/core';
|
|
10
|
+
/**
|
|
11
|
+
* Returns the content(s) of all files matching the given pattern.
|
|
12
|
+
*/
|
|
13
|
+
export interface FilesQuery extends BaseQueryFormat {
|
|
14
|
+
readonly type: 'files';
|
|
15
|
+
readonly roles?: FileRole[];
|
|
16
|
+
readonly matchesPathRegex?: string;
|
|
17
|
+
}
|
|
18
|
+
export interface FileQueryInfo<T = object> {
|
|
19
|
+
role?: FileRole;
|
|
20
|
+
path: string;
|
|
21
|
+
content: T;
|
|
22
|
+
}
|
|
23
|
+
export interface FilesQueryResult extends BaseQueryResult {
|
|
24
|
+
files: FileQueryInfo[];
|
|
25
|
+
}
|
|
26
|
+
declare function filesQueryLineParser(output: ReplOutput, line: readonly string[], _config: FlowrConfigOptions): ParsedQueryLine<'files'>;
|
|
27
|
+
declare function filesQueryCompleter(line: readonly string[], startingNewArg: boolean, _config: FlowrConfigOptions): CommandCompletions;
|
|
28
|
+
export declare const FilesQueryDefinition: {
|
|
29
|
+
readonly executor: typeof executeFileQuery;
|
|
30
|
+
readonly asciiSummarizer: (formatter: import("../../../util/text/ansi").OutputFormatter, _analyzer: import("../../../project/flowr-analyzer").ReadonlyFlowrAnalysisProvider<import("../../../r-bridge/parser").KnownParser>, queryResults: BaseQueryResult, result: string[]) => true;
|
|
31
|
+
readonly completer: typeof filesQueryCompleter;
|
|
32
|
+
readonly fromLine: typeof filesQueryLineParser;
|
|
33
|
+
readonly schema: Joi.ObjectSchema<any>;
|
|
34
|
+
readonly flattenInvolvedNodes: (_: BaseQueryResult) => NodeId[];
|
|
35
|
+
};
|
|
36
|
+
export {};
|