@eagleoutice/flowr 2.17.3 → 2.17.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 +9 -9
- package/cli/repl/commands/repl-signature.d.ts +1 -1
- package/cli/repl/completion.d.ts +23 -0
- package/cli/repl/completion.js +9 -0
- package/cli/repl/core.d.ts +0 -23
- package/cli/repl/core.js +0 -5
- package/cli/repl/parser/slice-query-parser.d.ts +1 -1
- package/cli/repl/parser/slice-query-parser.js +3 -3
- package/dataflow/environments/built-in-props.d.ts +8 -1
- package/dataflow/environments/built-in-props.js +9 -1
- package/dataflow/environments/built-in.d.ts +5 -3
- package/dataflow/environments/built-in.js +5 -4
- package/dataflow/environments/default-builtin-config.d.ts +21 -3
- package/dataflow/environments/default-builtin-config.js +49 -47
- package/dataflow/eval/resolve/resolve-argument.js +11 -6
- package/dataflow/eval/resolve/resolve-numbers.d.ts +1 -178
- package/dataflow/eval/resolve/resolve-numbers.js +2 -13
- package/dataflow/eval/resolve/resolve-strings.d.ts +1 -93
- package/dataflow/eval/resolve/resolve-strings.js +2 -17
- package/dataflow/eval/resolve/resolve-working-directory.js +3 -4
- package/dataflow/extractor.js +44 -26
- package/dataflow/graph/df-helper.d.ts +2 -1
- package/dataflow/graph/df-helper.js +2 -1
- package/dataflow/internal/linker.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.d.ts +8 -0
- package/dataflow/internal/process/functions/call/built-in/built-in-ambient-state.js +44 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +3 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-new-env.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-source.d.ts +0 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +11 -21
- package/dataflow/internal/process/functions/call/built-in/built-in-stack-env.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-with.js +2 -1
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.d.ts +13 -3
- package/dataflow/internal/process/functions/call/built-in/transitive-side-effects.js +15 -5
- package/dataflow/internal/process/functions/call/known-call-handling.d.ts +1 -24
- package/dataflow/internal/process/functions/call/known-call-handling.js +8 -34
- package/dataflow/internal/process/functions/call/nse-kind.d.ts +24 -0
- package/dataflow/internal/process/functions/call/nse-kind.js +30 -0
- package/documentation/wiki-query.js +3 -2
- package/linter/rules/absolute-path.js +5 -5
- package/linter/rules/cmd-check/dependency-declaration.js +2 -2
- package/linter/rules/cmd-check/package-runtime.js +2 -2
- package/linter/rules/deprecated-functions.js +2 -2
- package/linter/rules/file-path-validity.js +5 -5
- package/linter/rules/function-finder-util.js +2 -2
- package/linter/rules/overwritten-file.js +2 -4
- package/linter/rules/secret-exfiltration.d.ts +3 -2
- package/linter/rules/secret-exfiltration.js +8 -3
- package/linter/rules/unused-import.js +20 -6
- package/package.json +1 -1
- package/project/cache/flowr-analyzer-controlflow-cache.d.ts +0 -6
- package/project/cache/flowr-analyzer-controlflow-cache.js +7 -27
- package/project/context/flowr-analyzer-context.d.ts +2 -2
- package/project/context/flowr-analyzer-context.js +2 -2
- package/project/context/flowr-analyzer-files-context.d.ts +8 -0
- package/project/context/flowr-analyzer-files-context.js +51 -6
- package/project/flowr-analyzer.d.ts +0 -9
- package/project/flowr-analyzer.js +7 -28
- package/project/plugins/file-plugins/files/flowr-namespace-file.d.ts +0 -3
- package/project/plugins/file-plugins/files/flowr-namespace-file.js +57 -163
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.d.ts +2 -3
- package/project/plugins/file-plugins/flowr-analyzer-file-plugin.js +2 -3
- package/project/plugins/file-plugins/flowr-analyzer-rprofile-file-plugin.js +3 -3
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-lockfile-plugin.js +2 -2
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-namespace-file-plugin.js +1 -2
- package/project/plugins/package-version-plugins/flowr-analyzer-package-versions-sigdb-plugin.js +0 -1
- package/project/plugins/package-version-plugins/package.js +1 -1
- package/project/plugins/project-discovery/flowr-analyzer-project-discovery-plugin.js +2 -3
- package/queries/catalog/absint-query/absint-query-format.d.ts +1 -1
- package/queries/catalog/config-query/config-query-format.d.ts +1 -1
- package/queries/catalog/config-query/config-query-format.js +4 -4
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +6 -5
- package/queries/catalog/dependencies-query/dependencies-query-format.d.ts +1 -4
- package/queries/catalog/dependencies-query/dependencies-query-format.js +11 -11
- package/queries/catalog/dependencies-query/dependency-values.d.ts +9 -0
- package/queries/catalog/dependencies-query/dependency-values.js +13 -0
- package/queries/catalog/dependencies-query/function-info/remote-functions.js +2 -2
- package/queries/catalog/dependencies-query/function-info/write-functions.js +8 -7
- package/queries/catalog/dependencies-query/implicit-echo.js +2 -1
- package/queries/catalog/dependencies-query/plot-description.d.ts +1 -1
- package/queries/catalog/dependencies-query/plot-description.js +2 -2
- package/queries/catalog/dice-query/dice-query-format.d.ts +1 -1
- package/queries/catalog/files-query/files-query-format.d.ts +1 -1
- package/queries/catalog/linter-query/linter-query-format.d.ts +2 -2
- package/queries/catalog/linter-query/linter-query-format.js +13 -9
- package/queries/catalog/signature-query/signature-query-executor.d.ts +1 -1
- package/queries/catalog/taint-query/taint-query-format.d.ts +1 -1
- package/queries/query-function-filter.d.ts +1 -1
- package/queries/query.d.ts +2 -2
- package/r-bridge/init.js +1 -1
- package/search/flowr-search-filters.js +2 -2
- package/search/search-executor/search-generators.d.ts +0 -1
- package/search/search-executor/search-generators.js +5 -6
- package/search/search-logger.d.ts +1 -0
- package/search/search-logger.js +6 -0
- package/util/flowr-version.d.ts +1 -1
- package/util/flowr-version.js +2 -2
package/README.md
CHANGED
|
@@ -38,7 +38,7 @@ It offers a wide variety of features, for example:
|
|
|
38
38
|
|
|
39
39
|
```shell
|
|
40
40
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
41
|
-
flowR repl v2.17.
|
|
41
|
+
flowR repl v2.17.3, R grammar v14 (tree-sitter engine)
|
|
42
42
|
R> :query @linter "read.csv(\"/root/x.txt\")"
|
|
43
43
|
```
|
|
44
44
|
|
|
@@ -46,7 +46,7 @@ It offers a wide variety of features, for example:
|
|
|
46
46
|
<summary style='color:gray'>Output</summary>
|
|
47
47
|
|
|
48
48
|
```text
|
|
49
|
-
Query: linter (
|
|
49
|
+
Query: linter (14 ms)
|
|
50
50
|
╰ Deprecated Functions (deprecated-functions): no findings
|
|
51
51
|
╰ File Path Validity (file-path-validity):
|
|
52
52
|
╰ certain:
|
|
@@ -72,7 +72,7 @@ It offers a wide variety of features, for example:
|
|
|
72
72
|
╰ Namespace Access Validity (namespace-access): no findings
|
|
73
73
|
╰ Secret Exfiltration (secret-exfiltration): no findings
|
|
74
74
|
╰ Process State in Session (process-state-in-session): no findings
|
|
75
|
-
All queries together required ≈
|
|
75
|
+
All queries together required ≈14 ms (1ms accuracy, total 14 ms)
|
|
76
76
|
```
|
|
77
77
|
|
|
78
78
|
The linter will analyze the code and return any issues found.
|
|
@@ -86,7 +86,7 @@ It offers a wide variety of features, for example:
|
|
|
86
86
|
|
|
87
87
|
_Results (prettified and summarized):_
|
|
88
88
|
|
|
89
|
-
Query: **linter** (
|
|
89
|
+
Query: **linter** (19 ms)\
|
|
90
90
|
╰ **Deprecated Functions** (deprecated-functions): _no findings_\
|
|
91
91
|
╰ **File Path Validity** (file-path-validity):\
|
|
92
92
|
╰ certain:\
|
|
@@ -112,7 +112,7 @@ It offers a wide variety of features, for example:
|
|
|
112
112
|
╰ **Namespace Access Validity** (namespace-access): _no findings_\
|
|
113
113
|
╰ **Secret Exfiltration** (secret-exfiltration): _no findings_\
|
|
114
114
|
╰ **Process State in Session** (process-state-in-session): _no findings_\
|
|
115
|
-
_All queries together required ≈
|
|
115
|
+
_All queries together required ≈20 ms (1ms accuracy, total 20 ms)_
|
|
116
116
|
|
|
117
117
|
<details> <summary style="color:gray">Show Detailed Results as Json</summary>
|
|
118
118
|
|
|
@@ -205,7 +205,7 @@ It offers a wide variety of features, for example:
|
|
|
205
205
|
|
|
206
206
|
```shell
|
|
207
207
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
208
|
-
flowR repl v2.17.
|
|
208
|
+
flowR repl v2.17.3, R grammar v14 (tree-sitter engine)
|
|
209
209
|
R> :query @static-slice (11@sum) file://test/testfiles/example.R
|
|
210
210
|
```
|
|
211
211
|
|
|
@@ -218,7 +218,7 @@ It offers a wide variety of features, for example:
|
|
|
218
218
|
N <- 10
|
|
219
219
|
for(i in 1:(N-1)) sum <- sum + i + w
|
|
220
220
|
sum
|
|
221
|
-
All queries together required ≈
|
|
221
|
+
All queries together required ≈3 ms (1ms accuracy, total 3 ms)
|
|
222
222
|
```
|
|
223
223
|
|
|
224
224
|
</details>
|
|
@@ -226,7 +226,7 @@ It offers a wide variety of features, for example:
|
|
|
226
226
|
</details>
|
|
227
227
|
|
|
228
228
|
* 🚀 **fast call-graph, data-, and control-flow graphs**\
|
|
229
|
-
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">
|
|
229
|
+
Within just [<i><span title="This measurement is automatically fetched from the latest benchmark!">95.1 ms</span></i> (as of Nov 6, 2026)](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark),
|
|
230
230
|
_flowR_ can analyze the data- and control-flow of the average real-world R script. See the [benchmarks](https://flowr-analysis.github.io/flowr/wiki/stats/benchmark) for more information,
|
|
231
231
|
and consult the [wiki pages](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) for more details on the [dataflow graphs](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph) as well as [call graphs](https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph#perspectives-cg).
|
|
232
232
|
( [▶ Explore in Browser](https://flowr-analysis.github.io/flowr/wiki/playground/#c=zDYSwRgTghhCeAUATADsWECUAoLBnAxlMAKYD6ALgPakC2UAHgAQA8AtIwGYCuAdvuSEo949DIyYB6RnXojsWaAHdGKlW0aIo5KADoO0GsXghEjALyMAjAC4AbABpGANyJdi5xvngBmRwA5HAHZHACZHAE5HABYMbHwSKB5VdQ4QYHJiCHglRxdgN0YAPkYQuISeABICImJTdWqSCmoZeHjiRIq8t3lcLho6OFJcbXJcFnZe-pgQXCM2xMdDRI8l4Qba2KxeLlnEJu1gNQm%2B7KhFTtdieUUIEAydfFwneEmB2CGR3EcAIleYWAeT2%2B2FQlHIrXKVUIJEQIMoIB4owh7UqJgwQA&p=13:1 "run this script in flowR's playground, no setup") )
|
|
@@ -257,7 +257,7 @@ It offers a wide variety of features, for example:
|
|
|
257
257
|
|
|
258
258
|
```shell
|
|
259
259
|
$ docker run -it --rm eagleoutice/flowr # or npm run flowr
|
|
260
|
-
flowR repl v2.17.
|
|
260
|
+
flowR repl v2.17.3, R grammar v14 (tree-sitter engine)
|
|
261
261
|
R> :dataflow* test/testfiles/example.R
|
|
262
262
|
```
|
|
263
263
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReplCodeCommand } from './repl-main';
|
|
2
|
-
import type { CommandCompletions } from '../
|
|
2
|
+
import type { CommandCompletions } from '../completion';
|
|
3
3
|
/** the `:signature` subcommand names, offered as completions for its first argument */
|
|
4
4
|
export declare const signatureSubcommandNames: string[];
|
|
5
5
|
/** completes `:signature`: its subcommands, then a file path for `add` (query args are freeform names) */
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Completion suggestions for a specific REPL command
|
|
3
|
+
*/
|
|
4
|
+
export interface CommandCompletions {
|
|
5
|
+
/** The possible completions for the current argument */
|
|
6
|
+
readonly completions: string[];
|
|
7
|
+
/**
|
|
8
|
+
* The current argument fragment being completed, if any.
|
|
9
|
+
* This is relevant if an argument is composed of multiple parts (e.g. comma-separated lists).
|
|
10
|
+
*/
|
|
11
|
+
readonly argumentPart?: string;
|
|
12
|
+
/** What Tab displays per completion, only used while several remain: readline inserts what it displays. */
|
|
13
|
+
readonly labels?: ReadonlyMap<string, string>;
|
|
14
|
+
/** Display-only suggestions (e.g. a `<string>` type placeholder): previewed as a ghost hint but never inserted on Tab. */
|
|
15
|
+
readonly hints?: readonly string[];
|
|
16
|
+
/**
|
|
17
|
+
* The completer already selected these, so they must not be filtered against the typed fragment again.
|
|
18
|
+
* Needed when a completion legitimately shares no prefix with what was typed, e.g. a glob expanding to the keys it matches.
|
|
19
|
+
*/
|
|
20
|
+
readonly preFiltered?: boolean;
|
|
21
|
+
}
|
|
22
|
+
/** Labels a completion with what it does, see {@link CommandCompletions#labels|labels}. */
|
|
23
|
+
export declare function describeCompletion(insert: string, describe: string): string;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.describeCompletion = describeCompletion;
|
|
4
|
+
const ansi_1 = require("../../util/text/ansi");
|
|
5
|
+
/** Labels a completion with what it does, see {@link CommandCompletions#labels|labels}. */
|
|
6
|
+
function describeCompletion(insert, describe) {
|
|
7
|
+
return `${insert} ${ansi_1.ansiFormatter.format(describe, { style: 2 /* FontStyles.Faint */ })}`;
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=completion.js.map
|
package/cli/repl/core.d.ts
CHANGED
|
@@ -4,29 +4,6 @@ import { type ReplOutput } from './commands/repl-main';
|
|
|
4
4
|
import type { MergeableRecord } from '../../util/objects';
|
|
5
5
|
import type { FlowrConfig } from '../../config';
|
|
6
6
|
import type { FlowrAnalyzer } from '../../project/flowr-analyzer';
|
|
7
|
-
/**
|
|
8
|
-
* Completion suggestions for a specific REPL command
|
|
9
|
-
*/
|
|
10
|
-
export interface CommandCompletions {
|
|
11
|
-
/** The possible completions for the current argument */
|
|
12
|
-
readonly completions: string[];
|
|
13
|
-
/**
|
|
14
|
-
* The current argument fragment being completed, if any.
|
|
15
|
-
* This is relevant if an argument is composed of multiple parts (e.g. comma-separated lists).
|
|
16
|
-
*/
|
|
17
|
-
readonly argumentPart?: string;
|
|
18
|
-
/** What Tab displays per completion, only used while several remain: readline inserts what it displays. */
|
|
19
|
-
readonly labels?: ReadonlyMap<string, string>;
|
|
20
|
-
/** Display-only suggestions (e.g. a `<string>` type placeholder): previewed as a ghost hint but never inserted on Tab. */
|
|
21
|
-
readonly hints?: readonly string[];
|
|
22
|
-
/**
|
|
23
|
-
* The completer already selected these, so they must not be filtered against the typed fragment again.
|
|
24
|
-
* Needed when a completion legitimately shares no prefix with what was typed, e.g. a glob expanding to the keys it matches.
|
|
25
|
-
*/
|
|
26
|
-
readonly preFiltered?: boolean;
|
|
27
|
-
}
|
|
28
|
-
/** Labels a completion with what it does, see {@link CommandCompletions#labels|labels}. */
|
|
29
|
-
export declare function describeCompletion(insert: string, describe: string): string;
|
|
30
7
|
/**
|
|
31
8
|
* Every completion for `line`, the fragment of it they replace, the labels saying what each does, and the
|
|
32
9
|
* display-only hints; {@link replCompleter} and {@link completionSuggestion} are the two views the terminal needs.
|
package/cli/repl/core.js
CHANGED
|
@@ -36,7 +36,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
36
36
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.describeCompletion = describeCompletion;
|
|
40
39
|
exports.computeCompletions = computeCompletions;
|
|
41
40
|
exports.replCompleter = replCompleter;
|
|
42
41
|
exports.completionSuggestion = completionSuggestion;
|
|
@@ -86,10 +85,6 @@ function isReplStatsLine(line) {
|
|
|
86
85
|
const text = line.trimStart();
|
|
87
86
|
return (text.startsWith(prompt_1.rawPrompt) ? text.slice(prompt_1.rawPrompt.length).trimStart() : text).startsWith('[REPL Stats]');
|
|
88
87
|
}
|
|
89
|
-
/** Labels a completion with what it does, see {@link CommandCompletions#labels|labels}. */
|
|
90
|
-
function describeCompletion(insert, describe) {
|
|
91
|
-
return `${insert} ${ansi_1.ansiFormatter.format(describe, { style: 2 /* FontStyles.Faint */ })}`;
|
|
92
|
-
}
|
|
93
88
|
/**
|
|
94
89
|
* Every completion for `line`, the fragment of it they replace, the labels saying what each does, and the
|
|
95
90
|
* display-only hints; {@link replCompleter} and {@link completionSuggestion} are the two views the terminal needs.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SlicingCriterion, SlicingCriteria } from '../../../slicing/criterion/parse';
|
|
2
2
|
import { SliceDirection } from '../../../util/slice-direction';
|
|
3
|
-
import { type CommandCompletions } from '../
|
|
3
|
+
import { type CommandCompletions } from '../completion';
|
|
4
4
|
import type { FlowrConfig } from '../../../config';
|
|
5
5
|
import type { SliceQueryOptions } from '../../../queries/catalog/slice-query-options';
|
|
6
6
|
import type { ReplOutput } from '../commands/repl-main';
|
|
@@ -14,7 +14,7 @@ exports.sliceFlagCompletions = sliceFlagCompletions;
|
|
|
14
14
|
exports.criteriaQueryCompleter = criteriaQueryCompleter;
|
|
15
15
|
exports.diceCriteriaParser = diceCriteriaParser;
|
|
16
16
|
const slice_direction_1 = require("../../../util/slice-direction");
|
|
17
|
-
const
|
|
17
|
+
const completion_1 = require("../completion");
|
|
18
18
|
const ansi_1 = require("../../../util/text/ansi");
|
|
19
19
|
const arrays_1 = require("../../../util/collections/arrays");
|
|
20
20
|
/**
|
|
@@ -151,8 +151,8 @@ function sliceFlagCompletions(arg, flags) {
|
|
|
151
151
|
return {
|
|
152
152
|
completions: [...offered.map(f => arg + f.flag), arg + ' '],
|
|
153
153
|
labels: new Map([
|
|
154
|
-
...offered.map(f => [arg + f.flag, (0,
|
|
155
|
-
[arg + ' ', (0,
|
|
154
|
+
...offered.map(f => [arg + f.flag, (0, completion_1.describeCompletion)(f.flag, f.describe)]),
|
|
155
|
+
[arg + ' ', (0, completion_1.describeCompletion)('<space>', 'then the code')]
|
|
156
156
|
]),
|
|
157
157
|
argumentPart: arg
|
|
158
158
|
};
|
|
@@ -60,7 +60,12 @@ export declare enum ArgProp {
|
|
|
60
60
|
* besides its value, the expression as written names a part of the result, like `a` in `data.frame(a)`,
|
|
61
61
|
* which becomes the column `a`; passing `identity(a)` instead changes the name
|
|
62
62
|
*/
|
|
63
|
-
Deparsed = 65536
|
|
63
|
+
Deparsed = 65536,
|
|
64
|
+
/**
|
|
65
|
+
* a {@link ArgProp.Resource} whose default names none, like `file` in `cat(..., file = "")`, which prints to the console,
|
|
66
|
+
* or in `capture.output(..., file = NULL)`; left out, the call accesses no file through it
|
|
67
|
+
*/
|
|
68
|
+
Optional = 131072
|
|
64
69
|
}
|
|
65
70
|
/**
|
|
66
71
|
* The properties of the behavior of a call, as a bitmask.
|
|
@@ -137,6 +142,8 @@ export declare enum SemanticCallTag {
|
|
|
137
142
|
Glob = "glob",
|
|
138
143
|
/** draws on a graphics device */
|
|
139
144
|
Graphics = "draws-graphics",
|
|
145
|
+
/** hands back a console connection (`stdout()`, `stderr()`, `stdin()`), which names no file */
|
|
146
|
+
Console = "console",
|
|
140
147
|
/** talks to a database */
|
|
141
148
|
Database = "database",
|
|
142
149
|
/** hands back a handle the program is expected to close again, like `file` or `DBI::dbConnect` */
|
|
@@ -67,6 +67,11 @@ var ArgProp;
|
|
|
67
67
|
* which becomes the column `a`; passing `identity(a)` instead changes the name
|
|
68
68
|
*/
|
|
69
69
|
ArgProp[ArgProp["Deparsed"] = 65536] = "Deparsed";
|
|
70
|
+
/**
|
|
71
|
+
* a {@link ArgProp.Resource} whose default names none, like `file` in `cat(..., file = "")`, which prints to the console,
|
|
72
|
+
* or in `capture.output(..., file = NULL)`; left out, the call accesses no file through it
|
|
73
|
+
*/
|
|
74
|
+
ArgProp[ArgProp["Optional"] = 131072] = "Optional";
|
|
70
75
|
})(ArgProp || (exports.ArgProp = ArgProp = {}));
|
|
71
76
|
/**
|
|
72
77
|
* The properties of the behavior of a call, as a bitmask.
|
|
@@ -145,6 +150,8 @@ var SemanticCallTag;
|
|
|
145
150
|
SemanticCallTag["Glob"] = "glob";
|
|
146
151
|
/** draws on a graphics device */
|
|
147
152
|
SemanticCallTag["Graphics"] = "draws-graphics";
|
|
153
|
+
/** hands back a console connection (`stdout()`, `stderr()`, `stdin()`), which names no file */
|
|
154
|
+
SemanticCallTag["Console"] = "console";
|
|
148
155
|
/** talks to a database */
|
|
149
156
|
SemanticCallTag["Database"] = "database";
|
|
150
157
|
/** hands back a handle the program is expected to close again, like `file` or `DBI::dbConnect` */
|
|
@@ -438,7 +445,8 @@ const ArgPropWords = {
|
|
|
438
445
|
[ArgProp.Handle]: { word: 'handle', about: 'an open connection' },
|
|
439
446
|
[ArgProp.Lazy]: { word: 'lazy', short: 'L', about: 'never evaluated' },
|
|
440
447
|
[ArgProp.Injectable]: { word: 'injectable', about: 'open to injection' },
|
|
441
|
-
[ArgProp.Deparsed]: { word: 'deparsed', about: 'its expression names part of the result' }
|
|
448
|
+
[ArgProp.Deparsed]: { word: 'deparsed', about: 'its expression names part of the result' },
|
|
449
|
+
[ArgProp.Optional]: { word: 'optional', about: 'a resource whose default names none' }
|
|
442
450
|
};
|
|
443
451
|
/** The bitfield the given {@link ArgProp}/{@link CallProp} member names stand for, unknown ones ignored. */
|
|
444
452
|
function maskOfNames(of, names) {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { DataflowProcessorInformation } from '../processor';
|
|
2
2
|
import type { DataflowInformation } from '../info';
|
|
3
3
|
import { ExitPointType } from '../info';
|
|
4
|
-
import { type NseArguments } from '../internal/process/functions/call/
|
|
4
|
+
import { type NseArguments } from '../internal/process/functions/call/nse-kind';
|
|
5
5
|
import { processAccess } from '../internal/process/functions/call/built-in/built-in-access';
|
|
6
6
|
import { processIfThenElse } from '../internal/process/functions/call/built-in/built-in-if-then-else';
|
|
7
7
|
import { processAssignment, processAssignmentLike, processDefineArgument } from '../internal/process/functions/call/built-in/built-in-assignment';
|
|
@@ -32,8 +32,10 @@ import { type AmbientScope, type AmbientStateAccess } from '../internal/process/
|
|
|
32
32
|
import type { Value } from '../eval/values/r-value';
|
|
33
33
|
import type { ResolveInfo } from '../eval/resolve/alias-tracking';
|
|
34
34
|
import { resolveAsElement, resolveAsSeq, resolveAsVector } from '../eval/resolve/resolve';
|
|
35
|
+
import { resolveAsStringFn } from '../eval/resolve/resolve-strings';
|
|
35
36
|
import { resolveAsComparison, resolveAsGroup, resolveAsLogical } from '../eval/resolve/resolve-operators';
|
|
36
37
|
import { resolveAsGet } from '../eval/resolve/resolve-get';
|
|
38
|
+
import { resolveAsNumeric } from '../eval/resolve/resolve-numbers';
|
|
37
39
|
import type { VariableResolve } from '../../config';
|
|
38
40
|
import type { BuiltInConstantDefinition, BuiltInDefinition, BuiltInFunctionDefinition, BuiltInReplacementDefinition } from './built-in-config';
|
|
39
41
|
import { processStopIfNot } from '../internal/process/functions/call/built-in/built-in-stop-if-not';
|
|
@@ -182,10 +184,10 @@ export declare const BuiltInProcessorMapper: {
|
|
|
182
184
|
export declare const BuiltInEvalHandlerMapper: {
|
|
183
185
|
readonly "eval:vector": typeof resolveAsVector;
|
|
184
186
|
readonly "eval:seq": typeof resolveAsSeq;
|
|
185
|
-
readonly "eval:numeric":
|
|
187
|
+
readonly "eval:numeric": typeof resolveAsNumeric;
|
|
186
188
|
readonly "eval:cmp": typeof resolveAsComparison;
|
|
187
189
|
readonly "eval:logical": typeof resolveAsLogical;
|
|
188
|
-
readonly "eval:string-fn":
|
|
190
|
+
readonly "eval:string-fn": typeof resolveAsStringFn;
|
|
189
191
|
readonly "eval:group": typeof resolveAsGroup;
|
|
190
192
|
readonly "eval:get": typeof resolveAsGet;
|
|
191
193
|
readonly "eval:element": typeof resolveAsElement;
|
|
@@ -4,6 +4,7 @@ exports.BuiltIns = exports.BuiltInEvalHandlerMapper = exports.BuiltInProcessorMa
|
|
|
4
4
|
const ambient_state_name_1 = require("./ambient-state-name");
|
|
5
5
|
const function_semantics_1 = require("../fn/function-semantics");
|
|
6
6
|
const known_call_handling_1 = require("../internal/process/functions/call/known-call-handling");
|
|
7
|
+
const nse_kind_1 = require("../internal/process/functions/call/nse-kind");
|
|
7
8
|
const built_in_access_1 = require("../internal/process/functions/call/built-in/built-in-access");
|
|
8
9
|
const built_in_if_then_else_1 = require("../internal/process/functions/call/built-in/built-in-if-then-else");
|
|
9
10
|
const built_in_assignment_1 = require("../internal/process/functions/call/built-in/built-in-assignment");
|
|
@@ -130,7 +131,7 @@ function defaultBuiltInProcessor(name, args, rootId, data, { useAsProcessor = bu
|
|
|
130
131
|
dropQuotedReferences(res, processedArguments, nsePositions, lastEnv);
|
|
131
132
|
}
|
|
132
133
|
(0, known_call_handling_1.markArgumentsAsNonStandardEvaluation)(res.graph, rootId, processedArguments, nse, { first });
|
|
133
|
-
(0, known_call_handling_1.markArgumentsAsNonStandardEvaluation)(res.graph, rootId, processedArguments, masked, { kind:
|
|
134
|
+
(0, known_call_handling_1.markArgumentsAsNonStandardEvaluation)(res.graph, rootId, processedArguments, masked, { kind: nse_kind_1.NseKind.DataMasked, first });
|
|
134
135
|
if (keepArgumentOut) {
|
|
135
136
|
res.out = [...res.out, ...processedArguments.flatMap(arg => arg?.out ?? [])];
|
|
136
137
|
}
|
|
@@ -218,7 +219,7 @@ function defaultBuiltInProcessorReadallArgs(name, args, rootId, data, { useAsPro
|
|
|
218
219
|
readArguments(information.graph, rootId, processedArguments);
|
|
219
220
|
const first = firstParameterArgument(args, sig === undefined ? undefined : function_semantics_1.FunctionSemantics.call.signature.layout(sig));
|
|
220
221
|
(0, known_call_handling_1.markArgumentsAsNonStandardEvaluation)(information.graph, rootId, processedArguments, nse, { first });
|
|
221
|
-
(0, known_call_handling_1.markArgumentsAsNonStandardEvaluation)(information.graph, rootId, processedArguments, masked, { kind:
|
|
222
|
+
(0, known_call_handling_1.markArgumentsAsNonStandardEvaluation)(information.graph, rootId, processedArguments, masked, { kind: nse_kind_1.NseKind.DataMasked, first });
|
|
222
223
|
if (namesIn !== undefined && sig !== undefined) {
|
|
223
224
|
readNamedVariables(information, args, rootId, data, sig, namesIn);
|
|
224
225
|
}
|
|
@@ -332,10 +333,10 @@ exports.BuiltInProcessorMapper = {
|
|
|
332
333
|
exports.BuiltInEvalHandlerMapper = {
|
|
333
334
|
[built_in_eval_name_1.BuiltInEvalName.Vector]: resolve_1.resolveAsVector,
|
|
334
335
|
[built_in_eval_name_1.BuiltInEvalName.Seq]: resolve_1.resolveAsSeq,
|
|
335
|
-
[built_in_eval_name_1.BuiltInEvalName.Numeric]: resolve_numbers_1.
|
|
336
|
+
[built_in_eval_name_1.BuiltInEvalName.Numeric]: resolve_numbers_1.resolveAsNumeric,
|
|
336
337
|
[built_in_eval_name_1.BuiltInEvalName.Comparison]: resolve_operators_1.resolveAsComparison,
|
|
337
338
|
[built_in_eval_name_1.BuiltInEvalName.Logical]: resolve_operators_1.resolveAsLogical,
|
|
338
|
-
[built_in_eval_name_1.BuiltInEvalName.StringFn]: resolve_strings_1.
|
|
339
|
+
[built_in_eval_name_1.BuiltInEvalName.StringFn]: resolve_strings_1.resolveAsStringFn,
|
|
339
340
|
[built_in_eval_name_1.BuiltInEvalName.Group]: resolve_operators_1.resolveAsGroup,
|
|
340
341
|
[built_in_eval_name_1.BuiltInEvalName.Get]: resolve_get_1.resolveAsGet,
|
|
341
342
|
[built_in_eval_name_1.BuiltInEvalName.Element]: resolve_1.resolveAsElement
|
|
@@ -8,7 +8,7 @@ import { KnownHooks } from '../hooks';
|
|
|
8
8
|
import { Identifier } from './identifier';
|
|
9
9
|
import { BuiltInProcName } from './built-in-proc-name';
|
|
10
10
|
import { BuiltInEvalName } from './built-in-eval-name';
|
|
11
|
-
import { NseArguments } from '../internal/process/functions/call/
|
|
11
|
+
import { NseArguments } from '../internal/process/functions/call/nse-kind';
|
|
12
12
|
import { Unquote } from '../internal/process/functions/call/nse';
|
|
13
13
|
import { ArgProp, CallProp, type FnSig, SemanticCallTag, type SemanticCallTags } from './built-in-props';
|
|
14
14
|
import { ClassSystem, MemberVisibility } from '../fn/class-declaration';
|
|
@@ -2402,7 +2402,7 @@ export declare const WrittenBuiltinDefinitions: [{
|
|
|
2402
2402
|
readonly callName: RegExp;
|
|
2403
2403
|
};
|
|
2404
2404
|
readonly tags: [SemanticCallTag.File, SemanticCallTag.Writes];
|
|
2405
|
-
readonly sig: [["filename", number], ["plot", number], ["device", ArgProp.Flag], ["path",
|
|
2405
|
+
readonly sig: [["filename", number], ["plot", number], ["device", ArgProp.Flag], ["path", number], ["scale", ArgProp.Flag], ["width", ArgProp.Flag], ["height", ArgProp.Flag], ["units", ArgProp.Flag], ["dpi", ArgProp.Flag], ["limitsize", ArgProp.Flag], ["bg", ArgProp.Flag], ["create.dir", ArgProp.Flag], ["...", ArgProp.Flag]];
|
|
2406
2406
|
};
|
|
2407
2407
|
readonly assumePrimitive: false;
|
|
2408
2408
|
}, {
|
|
@@ -2846,6 +2846,14 @@ export declare const WrittenBuiltinDefinitions: [{
|
|
|
2846
2846
|
readonly sig: [["object", number]];
|
|
2847
2847
|
};
|
|
2848
2848
|
readonly assumePrimitive: false;
|
|
2849
|
+
}, {
|
|
2850
|
+
readonly type: "function";
|
|
2851
|
+
readonly names: Identifier[];
|
|
2852
|
+
readonly processor: BuiltInProcName.Default;
|
|
2853
|
+
readonly config: {
|
|
2854
|
+
readonly tags: [SemanticCallTag.Console];
|
|
2855
|
+
};
|
|
2856
|
+
readonly assumePrimitive: false;
|
|
2849
2857
|
}, {
|
|
2850
2858
|
readonly type: "function";
|
|
2851
2859
|
readonly names: [Identifier];
|
|
@@ -3866,7 +3874,17 @@ export declare const WrittenBuiltinDefinitions: [{
|
|
|
3866
3874
|
readonly assumePrimitive: false;
|
|
3867
3875
|
}, {
|
|
3868
3876
|
readonly type: "function";
|
|
3869
|
-
readonly names: Identifier
|
|
3877
|
+
readonly names: [Identifier];
|
|
3878
|
+
readonly processor: BuiltInProcName.DefaultReadAllArgs;
|
|
3879
|
+
readonly config: {
|
|
3880
|
+
readonly props: CallProp.Invisible;
|
|
3881
|
+
readonly tags: [SemanticCallTag.File, SemanticCallTag.Writes, SemanticCallTag.Prints];
|
|
3882
|
+
readonly sig: [["x", number], ["file", number]];
|
|
3883
|
+
};
|
|
3884
|
+
readonly assumePrimitive: false;
|
|
3885
|
+
}, {
|
|
3886
|
+
readonly type: "function";
|
|
3887
|
+
readonly names: [Identifier];
|
|
3870
3888
|
readonly processor: BuiltInProcName.DefaultReadAllArgs;
|
|
3871
3889
|
readonly config: {
|
|
3872
3890
|
readonly props: CallProp.Invisible;
|