@eagleoutice/flowr 2.2.3 → 2.2.4
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 +412 -39
- package/benchmark/slicer.js +0 -1
- package/benchmark/summarizer/first-phase/process.js +18 -8
- package/benchmark/summarizer/summarizer.d.ts +1 -1
- package/benchmark/summarizer/summarizer.js +1 -1
- package/cli/benchmark-app.js +1 -1
- package/cli/common/script.js +0 -1
- package/cli/repl/commands/repl-cfg.js +38 -8
- package/cli/repl/commands/repl-commands.js +1 -1
- package/cli/repl/commands/repl-dataflow.js +38 -8
- package/cli/repl/commands/repl-normalize.js +38 -8
- package/cli/repl/commands/repl-query.js +2 -2
- package/cli/repl/core.js +17 -8
- package/cli/repl/print-version.js +2 -1
- package/cli/repl/server/connection.js +17 -7
- package/cli/repl/server/messages/all-messages.js +17 -7
- package/cli/repl/server/messages/message-repl.js +17 -7
- package/cli/repl/server/messages/message-slice.js +17 -7
- package/cli/script-core/statistics-helper-core.js +0 -1
- package/core/print/normalize-printer.js +0 -1
- package/dataflow/environments/resolve-by-name.d.ts +2 -0
- package/dataflow/environments/resolve-by-name.js +2 -0
- package/dataflow/graph/resolve-graph.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +1 -1
- package/documentation/data/server/doc-data-server-messages.js +1 -2
- package/documentation/doc-util/doc-auto-gen.d.ts +1 -0
- package/documentation/doc-util/doc-auto-gen.js +5 -1
- package/documentation/doc-util/doc-benchmarks.d.ts +23 -0
- package/documentation/doc-util/doc-benchmarks.js +76 -0
- package/documentation/doc-util/doc-code.d.ts +1 -0
- package/documentation/doc-util/doc-code.js +4 -0
- package/documentation/doc-util/doc-files.d.ts +1 -0
- package/documentation/doc-util/doc-files.js +2 -1
- package/documentation/doc-util/doc-server-message.js +1 -1
- package/documentation/doc-util/doc-structure.d.ts +1 -1
- package/documentation/doc-util/doc-structure.js +2 -2
- package/documentation/doc-util/doc-types.d.ts +1 -0
- package/documentation/doc-util/doc-types.js +16 -8
- package/documentation/print-core-wiki.js +8 -1
- package/documentation/print-interface-wiki.js +21 -15
- package/documentation/print-linting-and-testing-wiki.js +3 -1
- package/documentation/print-readme.d.ts +1 -0
- package/documentation/print-readme.js +160 -0
- package/package.json +28 -40
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +77 -45
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +3 -0
- package/queries/catalog/dependencies-query/dependencies-query-format.js +3 -2
- package/r-bridge/lang-4.x/ast/model/model.d.ts +2 -3
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.d.ts +1 -0
- package/r-bridge/lang-4.x/tree-sitter/tree-sitter-executor.js +3 -0
- package/r-bridge/shell.js +18 -8
- package/statistics/features/supported/comments/comments.js +17 -7
- package/statistics/features/supported/used-functions/post-process.js +0 -1
- package/statistics/features/supported/used-packages/used-packages.js +17 -7
- package/statistics/features/supported/values/values.js +17 -7
- package/statistics/summarizer/summarizer.js +1 -2
- package/util/files.js +17 -7
- package/util/json.js +0 -2
- package/util/numbers.d.ts +1 -0
- package/util/numbers.js +5 -0
- package/util/parallel.js +17 -7
- package/util/quads.js +3 -3
- package/util/version.js +1 -1
|
@@ -2,6 +2,7 @@ import type { BaseQueryFormat, BaseQueryResult } from '../../base-query-format';
|
|
|
2
2
|
import type { NodeId } from '../../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
3
3
|
import Joi from 'joi';
|
|
4
4
|
import { executeDependenciesQuery } from './dependencies-query-executor';
|
|
5
|
+
export declare const Unknown = "unknown";
|
|
5
6
|
export declare const LibraryFunctions: FunctionInfo[];
|
|
6
7
|
export declare const SourceFunctions: FunctionInfo[];
|
|
7
8
|
export declare const ReadFunctions: FunctionInfo[];
|
|
@@ -30,6 +31,8 @@ export interface DependencyInfo extends Record<string, unknown> {
|
|
|
30
31
|
nodeId: NodeId;
|
|
31
32
|
functionName: string;
|
|
32
33
|
linkedIds?: readonly NodeId[];
|
|
34
|
+
/** the lexeme is presented whenever the specific info is of {@link Unknown} */
|
|
35
|
+
lexemeOfArgument?: string;
|
|
33
36
|
}
|
|
34
37
|
export type LibraryInfo = (DependencyInfo & {
|
|
35
38
|
libraryName: 'unknown' | string;
|
|
@@ -3,11 +3,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.DependenciesQueryDefinition = exports.WriteFunctions = exports.ReadFunctions = exports.SourceFunctions = exports.LibraryFunctions = void 0;
|
|
6
|
+
exports.DependenciesQueryDefinition = exports.WriteFunctions = exports.ReadFunctions = exports.SourceFunctions = exports.LibraryFunctions = exports.Unknown = void 0;
|
|
7
7
|
const ansi_1 = require("../../../util/ansi");
|
|
8
8
|
const time_1 = require("../../../util/time");
|
|
9
9
|
const joi_1 = __importDefault(require("joi"));
|
|
10
10
|
const dependencies_query_executor_1 = require("./dependencies-query-executor");
|
|
11
|
+
exports.Unknown = 'unknown';
|
|
11
12
|
// these lists are originally based on https://github.com/duncantl/CodeDepends/blob/7fd96dfee16b252e5f642c77a7ababf48e9326f8/R/codeTypes.R
|
|
12
13
|
exports.LibraryFunctions = [
|
|
13
14
|
{ name: 'library', argIdx: 0, argName: 'package' },
|
|
@@ -87,7 +88,7 @@ exports.ReadFunctions = [
|
|
|
87
88
|
{ name: 'Import', argIdx: 0, argName: 'file' },
|
|
88
89
|
];
|
|
89
90
|
exports.WriteFunctions = [
|
|
90
|
-
{ name: 'save', argIdx:
|
|
91
|
+
{ name: 'save', argIdx: 2, argName: 'file' },
|
|
91
92
|
{ name: 'save.image', argIdx: 0, argName: 'file' },
|
|
92
93
|
{ name: 'write', argIdx: 1, argName: 'file' },
|
|
93
94
|
{ name: 'dput', argIdx: 1, argName: 'file' },
|
|
@@ -23,9 +23,8 @@ import type { RUnaryOp } from './nodes/r-unary-op';
|
|
|
23
23
|
import type { RBinaryOp } from './nodes/r-binary-op';
|
|
24
24
|
import type { RPipe } from './nodes/r-pipe';
|
|
25
25
|
import type { RDelimiter } from './nodes/info/r-delimiter';
|
|
26
|
-
/** Simply an empty
|
|
27
|
-
export
|
|
28
|
-
}
|
|
26
|
+
/** Simply an empty type constraint used to say that there are additional decorations (see {@link Base}). */
|
|
27
|
+
export type NoInfo = object;
|
|
29
28
|
/**
|
|
30
29
|
* Will be used to reconstruct the source of the given element in the R-ast.
|
|
31
30
|
* This will not be part of most comparisons as it is mainly of interest to the reconstruction of R code.
|
|
@@ -13,6 +13,7 @@ export declare class TreeSitterExecutor implements SyncParser<Parser.Tree> {
|
|
|
13
13
|
static initTreeSitter(): Promise<void>;
|
|
14
14
|
constructor();
|
|
15
15
|
rVersion(): Promise<string | 'unknown' | 'none'>;
|
|
16
|
+
treeSitterVersion(): number;
|
|
16
17
|
parse(request: RParseRequest): Parser.Tree;
|
|
17
18
|
close(): void;
|
|
18
19
|
}
|
package/r-bridge/shell.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
|
@@ -349,7 +359,7 @@ class RShellSession {
|
|
|
349
359
|
try {
|
|
350
360
|
fs_1.default.rmSync(f, { recursive: true, force: true });
|
|
351
361
|
}
|
|
352
|
-
catch
|
|
362
|
+
catch {
|
|
353
363
|
log_1.log.error(`failed to unlink file ${f}`);
|
|
354
364
|
}
|
|
355
365
|
}
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.comments = exports.initialCommentInfo = void 0;
|
|
27
37
|
const xpath = __importStar(require("xpath-ts2"));
|
|
@@ -96,7 +96,6 @@ function retrieveFunctionCallMetaInformation(info, outputPath) {
|
|
|
96
96
|
console.log(` [${(0, time_1.date2string)(new Date())}] Used functions metadata reading completed, summarizing and writing to file`);
|
|
97
97
|
writeFunctionCallsMetaInformationToCsv(outputPath, data);
|
|
98
98
|
for (const [index, arg] of data.args.entries()) {
|
|
99
|
-
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
100
99
|
if (!arg) {
|
|
101
100
|
// we treat the first/0-argument entry separate for legacy reasons
|
|
102
101
|
continue;
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.usedPackages = exports.initialUsedPackageInfos = void 0;
|
|
27
37
|
const xpath = __importStar(require("xpath-ts2"));
|
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.values = void 0;
|
|
27
37
|
const xpath = __importStar(require("xpath-ts2"));
|
|
@@ -88,7 +88,7 @@ class StatisticsSummarizer extends summarizer_1.Summarizer {
|
|
|
88
88
|
try {
|
|
89
89
|
fs_1.default.rmSync(path, { recursive: true, force: true });
|
|
90
90
|
}
|
|
91
|
-
catch
|
|
91
|
+
catch {
|
|
92
92
|
log_1.log.error('failure in cleanup');
|
|
93
93
|
}
|
|
94
94
|
}
|
|
@@ -122,7 +122,6 @@ class StatisticsSummarizer extends summarizer_1.Summarizer {
|
|
|
122
122
|
this.log(`Found ${count} files to summarize`);
|
|
123
123
|
return Promise.resolve();
|
|
124
124
|
}
|
|
125
|
-
// eslint-disable-next-line @typescript-eslint/require-await -- just to obey the structure
|
|
126
125
|
async summarizePhase() {
|
|
127
126
|
// detect all subfolders in the current folder (default, test...) for each: concat.
|
|
128
127
|
this.removeIfExists(this.config.outputPath);
|
package/util/files.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
37
|
};
|
package/util/json.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// to get the types within JSON.stringify
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
4
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
4
|
exports.jsonReplacer = jsonReplacer;
|
|
6
5
|
exports.jsonBigIntRetriever = jsonBigIntRetriever;
|
|
@@ -11,7 +10,6 @@ function jsonReplacer(key, value) {
|
|
|
11
10
|
return undefined;
|
|
12
11
|
}
|
|
13
12
|
else if (value instanceof Map || value instanceof Set) {
|
|
14
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-return
|
|
15
13
|
return [...value];
|
|
16
14
|
}
|
|
17
15
|
else if (typeof value === 'bigint') {
|
package/util/numbers.d.ts
CHANGED
package/util/numbers.js
CHANGED
|
@@ -1,8 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.bigint2number = bigint2number;
|
|
4
|
+
exports.roundToDecimals = roundToDecimals;
|
|
4
5
|
function bigint2number(a) {
|
|
5
6
|
// we have to remove the trailing `n`
|
|
6
7
|
return Number(String(a).slice(0, -1));
|
|
7
8
|
}
|
|
9
|
+
function roundToDecimals(value, decimals) {
|
|
10
|
+
const factor = 10 ** decimals;
|
|
11
|
+
return Math.round(value * factor) / factor;
|
|
12
|
+
}
|
|
8
13
|
//# sourceMappingURL=numbers.js.map
|
package/util/parallel.js
CHANGED
|
@@ -15,13 +15,23 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
15
15
|
}) : function(o, v) {
|
|
16
16
|
o["default"] = v;
|
|
17
17
|
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
};
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
25
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
36
|
exports.LimitedThreadPool = void 0;
|
|
27
37
|
/**
|
package/util/quads.js
CHANGED
|
@@ -15,12 +15,12 @@ exports.defaultQuadIgnoreIf = defaultQuadIgnoreIf;
|
|
|
15
15
|
exports.serialize2quads = serialize2quads;
|
|
16
16
|
exports.graph2quads = graph2quads;
|
|
17
17
|
const n3_1 = require("n3");
|
|
18
|
-
|
|
19
|
-
|
|
18
|
+
const namedNode = (v) => n3_1.DataFactory.namedNode(v);
|
|
19
|
+
const quad = (s, p, o, g) => n3_1.DataFactory.quad(s, p, o, g);
|
|
20
20
|
const objects_1 = require("./objects");
|
|
21
21
|
const assert_1 = require("./assert");
|
|
22
22
|
const defaultmap_1 = require("./defaultmap");
|
|
23
|
-
|
|
23
|
+
const literal = (v, n) => n3_1.DataFactory.literal(v, n);
|
|
24
24
|
const log_1 = require("./log");
|
|
25
25
|
const domain = 'https://uni-ulm.de/r-ast/';
|
|
26
26
|
/**
|
package/util/version.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.flowrVersion = flowrVersion;
|
|
4
4
|
const semver_1 = require("semver");
|
|
5
5
|
// this is automatically replaced with the current version by release-it
|
|
6
|
-
const version = '2.2.
|
|
6
|
+
const version = '2.2.4';
|
|
7
7
|
function flowrVersion() {
|
|
8
8
|
return new semver_1.SemVer(version);
|
|
9
9
|
}
|