@eagleoutice/flowr 2.6.3 → 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 +22 -22
- 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 +4 -7
- package/abstract-interpretation/data-frame/dataframe-domain.js +26 -16
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +6 -4
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +11 -14
- package/abstract-interpretation/data-frame/mappers/arguments.d.ts +10 -9
- package/abstract-interpretation/data-frame/mappers/arguments.js +8 -5
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +18 -18
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +53 -58
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +7 -5
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +26 -29
- package/abstract-interpretation/data-frame/semantics.js +48 -44
- 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/abstract-domain.d.ts +1 -0
- package/abstract-interpretation/domains/abstract-domain.js +3 -2
- package/abstract-interpretation/domains/bounded-set-domain.d.ts +2 -2
- package/abstract-interpretation/domains/bounded-set-domain.js +1 -1
- package/abstract-interpretation/domains/interval-domain.d.ts +4 -4
- package/abstract-interpretation/domains/interval-domain.js +3 -6
- package/abstract-interpretation/domains/lattice.d.ts +2 -0
- package/abstract-interpretation/domains/lattice.js +3 -1
- package/abstract-interpretation/domains/positive-interval-domain.d.ts +1 -1
- package/abstract-interpretation/domains/positive-interval-domain.js +1 -1
- package/abstract-interpretation/domains/satisfiable-domain.d.ts +2 -2
- package/abstract-interpretation/domains/satisfiable-domain.js +2 -2
- package/abstract-interpretation/domains/set-range-domain.d.ts +104 -0
- package/abstract-interpretation/domains/set-range-domain.js +406 -0
- package/abstract-interpretation/domains/set-upper-bound-domain.d.ts +2 -2
- package/abstract-interpretation/domains/set-upper-bound-domain.js +2 -2
- package/abstract-interpretation/domains/singleton-domain.d.ts +2 -2
- package/abstract-interpretation/domains/singleton-domain.js +2 -2
- package/benchmark/slicer.d.ts +2 -1
- package/benchmark/slicer.js +50 -29
- package/benchmark/stats/print.js +8 -5
- package/benchmark/stats/stats.d.ts +3 -2
- package/benchmark/summarizer/data.d.ts +11 -8
- package/benchmark/summarizer/first-phase/process.js +11 -8
- package/benchmark/summarizer/second-phase/process.js +24 -18
- 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/cfg-dead-code.js +3 -2
- 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/control-flow/useless-loop.js +4 -2
- package/core/steps/all/static-slicing/00-slice.d.ts +3 -0
- package/core/steps/all/static-slicing/00-slice.js +2 -1
- package/core/steps/pipeline/default-pipelines.d.ts +42 -42
- package/dataflow/cluster.js +2 -2
- package/dataflow/environments/append.d.ts +5 -0
- package/dataflow/environments/append.js +6 -20
- package/dataflow/environments/built-in.d.ts +2 -1
- package/dataflow/environments/clone.d.ts +1 -1
- package/dataflow/environments/clone.js +3 -27
- package/dataflow/environments/define.d.ts +7 -3
- package/dataflow/environments/define.js +9 -56
- package/dataflow/environments/diff.js +1 -1
- package/dataflow/environments/environment.d.ts +48 -28
- package/dataflow/environments/environment.js +187 -62
- package/dataflow/environments/overwrite.js +2 -45
- package/dataflow/environments/reference-to-maybe.d.ts +13 -0
- package/dataflow/environments/reference-to-maybe.js +54 -0
- package/dataflow/environments/resolve-by-name.d.ts +6 -1
- package/dataflow/environments/resolve-by-name.js +56 -4
- package/dataflow/environments/scoping.d.ts +2 -2
- package/dataflow/environments/scoping.js +7 -7
- package/dataflow/eval/resolve/alias-tracking.d.ts +10 -4
- package/dataflow/eval/resolve/alias-tracking.js +16 -14
- package/dataflow/eval/resolve/resolve-argument.d.ts +2 -1
- package/dataflow/eval/resolve/resolve-argument.js +8 -8
- package/dataflow/eval/resolve/resolve.d.ts +13 -11
- package/dataflow/eval/resolve/resolve.js +16 -15
- package/dataflow/extractor.js +1 -7
- package/dataflow/fn/higher-order-function.d.ts +2 -1
- package/dataflow/fn/higher-order-function.js +4 -4
- package/dataflow/graph/dataflowgraph-builder.d.ts +9 -5
- package/dataflow/graph/dataflowgraph-builder.js +21 -11
- package/dataflow/graph/diff-dataflow-graph.js +2 -2
- package/dataflow/graph/graph.d.ts +10 -2
- package/dataflow/graph/graph.js +41 -12
- package/dataflow/graph/invert-dfg.d.ts +3 -2
- package/dataflow/graph/invert-dfg.js +3 -3
- package/dataflow/graph/resolve-graph.d.ts +2 -1
- package/dataflow/graph/resolve-graph.js +2 -2
- package/dataflow/graph/vertex.d.ts +3 -3
- package/dataflow/graph/vertex.js +3 -3
- package/dataflow/info.d.ts +1 -1
- package/dataflow/internal/linker.d.ts +2 -0
- package/dataflow/internal/linker.js +13 -19
- package/dataflow/internal/process/functions/call/argument/unpack-argument.d.ts +7 -1
- package/dataflow/internal/process/functions/call/argument/unpack-argument.js +12 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-access.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-apply.js +2 -2
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.d.ts +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-assignment.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-eval.js +9 -9
- package/dataflow/internal/process/functions/call/built-in/built-in-expression-list.js +9 -7
- package/dataflow/internal/process/functions/call/built-in/built-in-for-loop.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.d.ts +2 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-function-definition.js +9 -13
- package/dataflow/internal/process/functions/call/built-in/built-in-get.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.d.ts +3 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-if-then-else.js +8 -6
- package/dataflow/internal/process/functions/call/built-in/built-in-library.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-pipe.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-repeat-loop.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-replacement.js +3 -3
- package/dataflow/internal/process/functions/call/built-in/built-in-rm.js +6 -4
- package/dataflow/internal/process/functions/call/built-in/built-in-source.js +1 -1
- package/dataflow/internal/process/functions/call/built-in/built-in-while-loop.js +5 -5
- package/dataflow/internal/process/functions/call/common.js +2 -3
- package/dataflow/internal/process/functions/call/known-call-handling.js +1 -1
- package/dataflow/internal/process/functions/call/unnamed-call-handling.js +1 -1
- package/dataflow/internal/process/functions/process-argument.js +1 -1
- package/dataflow/internal/process/process-symbol.js +1 -1
- package/dataflow/internal/process/process-value.d.ts +1 -1
- package/dataflow/internal/process/process-value.js +7 -7
- package/dataflow/processor.d.ts +1 -5
- 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-dfg.js +3 -2
- 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 +5 -4
- package/documentation/doc-util/doc-types.d.ts +1 -1
- package/documentation/doc-util/doc-types.js +2 -2
- package/documentation/issue-linting-rule.d.ts +1 -1
- package/documentation/wiki-analyzer.d.ts +1 -1
- package/documentation/wiki-analyzer.js +14 -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 +10 -11
- 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-faq.js +0 -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-linter.js +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 +5 -2
- 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/linter-rules.d.ts +2 -2
- package/linter/rules/absolute-path.js +4 -4
- package/linter/rules/dataframe-access-validation.d.ts +2 -2
- package/linter/rules/dataframe-access-validation.js +9 -11
- package/linter/rules/function-finder-util.d.ts +2 -2
- package/linter/rules/function-finder-util.js +1 -1
- package/linter/rules/network-functions.js +1 -1
- package/linter/rules/seeded-randomness.d.ts +1 -1
- package/linter/rules/seeded-randomness.js +5 -5
- package/linter/rules/unused-definition.js +1 -1
- package/package.json +1 -2
- package/project/context/flowr-analyzer-context.d.ts +11 -0
- package/project/context/flowr-analyzer-context.js +3 -0
- package/project/context/flowr-analyzer-environment-context.d.ts +47 -0
- package/project/context/flowr-analyzer-environment-context.js +50 -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/call-context-query/call-context-query-executor.js +1 -4
- package/queries/catalog/control-flow-query/control-flow-query-format.js +3 -2
- package/queries/catalog/dataflow-lens-query/dataflow-lens-query-executor.js +1 -1
- package/queries/catalog/dependencies-query/dependencies-query-executor.js +4 -4
- package/queries/catalog/df-shape-query/df-shape-query-executor.d.ts +1 -1
- package/queries/catalog/df-shape-query/df-shape-query-executor.js +5 -3
- package/queries/catalog/df-shape-query/df-shape-query-format.d.ts +4 -4
- package/queries/catalog/df-shape-query/df-shape-query-format.js +2 -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/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -3
- package/queries/catalog/linter-query/linter-query-format.js +1 -1
- package/queries/catalog/resolve-value-query/resolve-value-query-executor.js +1 -1
- package/queries/catalog/static-slice-query/static-slice-query-executor.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/slicing/static/slice-call.d.ts +3 -2
- package/slicing/static/slice-call.js +4 -4
- package/slicing/static/static-slicer.d.ts +3 -1
- package/slicing/static/static-slicer.js +6 -7
- package/statistics/features/supported/control-flow/control-flow.js +1 -1
- package/statistics/features/supported/data-access/data-access.js +1 -1
- package/statistics/features/supported/used-functions/used-functions.js +1 -1
- package/statistics/features/supported/variables/variables.js +2 -1
- package/util/containers.js +2 -2
- 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 +2 -7
- package/util/mermaid/dfg.js +10 -6
- 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/simple-df/dfg-view.d.ts +2 -1
- package/util/simple-df/dfg-view.js +2 -2
- 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 -19
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +0 -33
- package/dataflow/environments/remove.d.ts +0 -12
- package/dataflow/environments/remove.js +0 -52
- 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
|
@@ -7,18 +7,18 @@ const identifier_1 = require("../../environments/identifier");
|
|
|
7
7
|
/**
|
|
8
8
|
*
|
|
9
9
|
*/
|
|
10
|
-
function processValue({ info: { id } },
|
|
10
|
+
function processValue({ info: { id } }, { controlDependencies, completeAst: { idMap }, ctx: { env }, environment }) {
|
|
11
11
|
return {
|
|
12
12
|
unknownReferences: [],
|
|
13
|
-
in: [{ nodeId: id, name: undefined, controlDependencies
|
|
13
|
+
in: [{ nodeId: id, name: undefined, controlDependencies, type: identifier_1.ReferenceType.Constant }],
|
|
14
14
|
out: [],
|
|
15
|
-
environment
|
|
16
|
-
graph: new graph_1.DataflowGraph(
|
|
15
|
+
environment,
|
|
16
|
+
graph: new graph_1.DataflowGraph(idMap).addVertex({
|
|
17
17
|
tag: vertex_1.VertexType.Value,
|
|
18
18
|
id: id,
|
|
19
|
-
cds:
|
|
20
|
-
}),
|
|
21
|
-
exitPoints: [{ nodeId: id, type: 0 /* ExitPointType.Default */, controlDependencies
|
|
19
|
+
cds: controlDependencies
|
|
20
|
+
}, env.makeCleanEnv()),
|
|
21
|
+
exitPoints: [{ nodeId: id, type: 0 /* ExitPointType.Default */, controlDependencies }],
|
|
22
22
|
entryPoint: id
|
|
23
23
|
};
|
|
24
24
|
}
|
package/dataflow/processor.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import type { ControlDependency, DataflowInformation } from './info';
|
|
5
5
|
import type { NormalizedAst, ParentInformation, RNodeWithParent } from '../r-bridge/lang-4.x/ast/model/processing/decorate';
|
|
6
|
-
import type {
|
|
6
|
+
import type { REnvironmentInformation } from './environments/environment';
|
|
7
7
|
import type { RNode } from '../r-bridge/lang-4.x/ast/model/model';
|
|
8
8
|
import type { KnownParserType, Parser } from '../r-bridge/parser';
|
|
9
9
|
import type { FlowrAnalyzerContext } from '../project/context/flowr-analyzer-context';
|
|
@@ -31,10 +31,6 @@ export interface DataflowProcessorInformation<OtherInfo> {
|
|
|
31
31
|
* The chain of control-flow {@link NodeId}s that lead to the current node (e.g., of known ifs).
|
|
32
32
|
*/
|
|
33
33
|
readonly controlDependencies: ControlDependency[] | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* The built-in environment
|
|
36
|
-
*/
|
|
37
|
-
readonly builtInEnvironment: IEnvironment;
|
|
38
34
|
/**
|
|
39
35
|
* The flowr context used for environment seeding, files, and precision control, ...
|
|
40
36
|
*/
|
|
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
|
|
|
3
3
|
/**
|
|
4
4
|
* https://github.com/flowr-analysis/flowr/wiki/Capabilities
|
|
5
5
|
*/
|
|
6
|
-
export declare class DocCapabilities extends DocMaker {
|
|
6
|
+
export declare class DocCapabilities extends DocMaker<'wiki/Capabilities.md'> {
|
|
7
7
|
constructor();
|
|
8
8
|
protected text({ treeSitter }: DocMakerArgs): Promise<string>;
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
|
|
|
3
3
|
/**
|
|
4
4
|
* https://github.com/flowr-analysis/flowr/blob/main/README.md
|
|
5
5
|
*/
|
|
6
|
-
export declare class DocReadme extends DocMaker {
|
|
6
|
+
export declare class DocReadme extends DocMaker<'README.md'> {
|
|
7
7
|
constructor();
|
|
8
8
|
text({ treeSitter }: DocMakerArgs): Promise<string>;
|
|
9
9
|
}
|
|
@@ -30,7 +30,7 @@ async function getCfg(parser, code, simplifications = [], useDfg = true) {
|
|
|
30
30
|
*/
|
|
31
31
|
function printCfg(cfg, ast, prefix = 'flowchart BT\n', simplify = false) {
|
|
32
32
|
return `
|
|
33
|
-
${(0, doc_code_1.codeBlock)('mermaid', (0, cfg_1.cfgToMermaid)(cfg, ast, prefix, simplify))}
|
|
33
|
+
${(0, doc_code_1.codeBlock)('mermaid', (0, cfg_1.cfgToMermaid)(cfg, ast, { prefix, simplify }))}
|
|
34
34
|
`;
|
|
35
35
|
}
|
|
36
36
|
/**
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
/** Automatically provides hover over with the documentation for these! */
|
|
2
2
|
import { scripts } from '../../cli/common/scripts-info';
|
|
3
3
|
import { flowrMainOptionDefinitions } from '../../cli/flowr-main-options';
|
|
4
|
-
type
|
|
4
|
+
import type { ReplCommandNames } from '../../cli/repl/commands/repl-commands';
|
|
5
|
+
export type ScriptOptions<Type extends keyof typeof scripts | 'flowr'> = Type extends keyof typeof scripts ? typeof scripts[Type]['options'][number]['name'] : Type extends 'flowr' ? typeof flowrMainOptionDefinitions[number]['name'] : never;
|
|
5
6
|
/**
|
|
6
|
-
*
|
|
7
|
+
* Produce the documentation string for a CLI long option
|
|
7
8
|
*/
|
|
8
9
|
export declare function getCliLongOptionOf<ScriptName extends keyof typeof scripts | 'flowr', OptionName extends ScriptOptions<ScriptName>>(scriptName: ScriptName, optionName: OptionName, withAlias?: boolean, quote?: boolean): string;
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* Produce the documentation string for multiple CLI long options
|
|
11
12
|
*/
|
|
12
13
|
export declare function multipleCliOptions<ScriptName extends keyof typeof scripts | 'flowr', OptionName extends ScriptOptions<ScriptName>>(scriptName: ScriptName, ...options: OptionName[]): string;
|
|
13
14
|
/**
|
|
14
|
-
*
|
|
15
|
+
* Produce the documentation string for a REPL command
|
|
15
16
|
*/
|
|
16
|
-
export declare function getReplCommand(commandName: string, quote?: boolean, showStar?: boolean): string;
|
|
17
|
-
export {};
|
|
17
|
+
export declare function getReplCommand(commandName: ReplCommandNames | string, quote?: boolean, showStar?: boolean): string;
|
|
@@ -11,7 +11,7 @@ const flowr_main_options_1 = require("../../cli/flowr-main-options");
|
|
|
11
11
|
const repl_commands_1 = require("../../cli/repl/commands/repl-commands");
|
|
12
12
|
const doc_escape_1 = require("./doc-escape");
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Produce the documentation string for a CLI long option
|
|
15
15
|
*/
|
|
16
16
|
function getCliLongOptionOf(scriptName, optionName, withAlias = false, quote = true) {
|
|
17
17
|
const script = scriptName === 'flowr' ? flowr_main_options_1.flowrMainOptionDefinitions : scripts_info_1.scripts[scriptName].options;
|
|
@@ -26,13 +26,13 @@ function getCliLongOptionOf(scriptName, optionName, withAlias = false, quote = t
|
|
|
26
26
|
return (0, html_hover_over_1.textWithTooltip)(`${char}-${ligatureBreaker}-${optionName}${char}`, 'Description (Command Line Argument): ' + description) + alias;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Produce the documentation string for multiple CLI long options
|
|
30
30
|
*/
|
|
31
31
|
function multipleCliOptions(scriptName, ...options) {
|
|
32
32
|
return options.map(o => getCliLongOptionOf(scriptName, o, false, true)).join(' ');
|
|
33
33
|
}
|
|
34
34
|
/**
|
|
35
|
-
*
|
|
35
|
+
* Produce the documentation string for a REPL command
|
|
36
36
|
*/
|
|
37
37
|
function getReplCommand(commandName, quote = true, showStar = false) {
|
|
38
38
|
const availableNames = (0, repl_commands_1.getReplCommands)();
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { DataflowGraph, UnknownSideEffect } from '../../dataflow/graph/graph';
|
|
2
|
-
import { type MermaidMarkdownMark } from '../../util/mermaid/dfg';
|
|
3
2
|
import type { DEFAULT_DATAFLOW_PIPELINE } from '../../core/steps/pipeline/default-pipelines';
|
|
4
3
|
import type { PipelineOutput } from '../../core/steps/pipeline/pipeline';
|
|
5
4
|
import type { KnownParser } from '../../r-bridge/parser';
|
|
5
|
+
import type { MermaidMarkdownMark } from '../../util/mermaid/info';
|
|
6
6
|
/**
|
|
7
7
|
* Visualizes the dataflow graph as a mermaid graph inside a markdown code block.
|
|
8
8
|
* Please use this only for documentation purposes, for programmatic usage use {@link graphToMermaid} directly.
|
|
@@ -82,13 +82,14 @@ ${switchCodeAndGraph ? dfGraph : codeText}
|
|
|
82
82
|
}
|
|
83
83
|
/** returns resolved expected df graph */
|
|
84
84
|
async function verifyExpectedSubgraph(parser, code, expectedSubgraph) {
|
|
85
|
+
const context = (0, flowr_analyzer_context_1.contextFromInput)(code);
|
|
85
86
|
/* we verify that we get what we want first! */
|
|
86
87
|
const info = await (0, default_pipelines_1.createDataflowPipeline)(parser, {
|
|
87
|
-
context:
|
|
88
|
+
context: context,
|
|
88
89
|
getId: (0, decorate_1.deterministicCountingIdGenerator)(0)
|
|
89
90
|
}).allRemainingSteps();
|
|
90
91
|
expectedSubgraph.setIdMap(info.normalize.idMap);
|
|
91
|
-
expectedSubgraph = (0, resolve_graph_1.resolveDataflowGraph)(expectedSubgraph);
|
|
92
|
+
expectedSubgraph = (0, resolve_graph_1.resolveDataflowGraph)(expectedSubgraph, context);
|
|
92
93
|
const report = (0, diff_dataflow_graph_1.diffOfDataflowGraphs)({ name: 'expected', graph: expectedSubgraph }, { name: 'got', graph: info.dataflow.graph }, {
|
|
93
94
|
leftIsSubgraph: true
|
|
94
95
|
});
|
|
@@ -3,11 +3,14 @@ export declare const FlowrGithubBaseRef = "https://github.com/flowr-analysis";
|
|
|
3
3
|
export declare const FlowrSiteBaseRef = "https://flowr-analysis.github.io/flowr";
|
|
4
4
|
export declare const RemoteFlowrFilePathBaseRef = "https://github.com/flowr-analysis/flowr/tree/main/";
|
|
5
5
|
export declare const FlowrWikiBaseRef = "https://github.com/flowr-analysis/flowr/wiki";
|
|
6
|
+
export declare const FlowrGithubRef: string;
|
|
6
7
|
export declare const FlowrNpmRef = "https://www.npmjs.com/package/@eagleoutice/flowr";
|
|
7
8
|
export declare const FlowrDockerRef = "https://hub.docker.com/r/eagleoutice/flowr";
|
|
8
9
|
export declare const FlowrCodecovRef = "https://app.codecov.io/gh/flowr-analysis/flowr";
|
|
9
10
|
export declare const FlowrVsCode = "https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr";
|
|
10
11
|
export declare const FlowrPositron = "https://open-vsx.org/extension/code-inspect/vscode-flowr";
|
|
12
|
+
export declare const FlowrRStudioAddin = "https://github.com/flowr-analysis/rstudio-addin-flowr";
|
|
13
|
+
export declare const FlowrRAdapter = "https://github.com/flowr-analysis/flowr-r-adapter";
|
|
11
14
|
/**
|
|
12
15
|
* Returns a markdown link to the given file path relative to the project root.
|
|
13
16
|
*/
|
|
@@ -3,7 +3,7 @@ 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.FlowrPositron = exports.FlowrVsCode = exports.FlowrCodecovRef = exports.FlowrDockerRef = exports.FlowrNpmRef = exports.FlowrWikiBaseRef = exports.RemoteFlowrFilePathBaseRef = exports.FlowrSiteBaseRef = exports.FlowrGithubBaseRef = exports.FlowrGithubGroupName = void 0;
|
|
6
|
+
exports.FlowrRAdapter = exports.FlowrRStudioAddin = exports.FlowrPositron = exports.FlowrVsCode = exports.FlowrCodecovRef = exports.FlowrDockerRef = exports.FlowrNpmRef = exports.FlowrGithubRef = exports.FlowrWikiBaseRef = exports.RemoteFlowrFilePathBaseRef = exports.FlowrSiteBaseRef = exports.FlowrGithubBaseRef = exports.FlowrGithubGroupName = void 0;
|
|
7
7
|
exports.getFilePathMd = getFilePathMd;
|
|
8
8
|
exports.getFileContentFromRoot = getFileContentFromRoot;
|
|
9
9
|
exports.linkFlowRSourceFile = linkFlowRSourceFile;
|
|
@@ -13,11 +13,14 @@ exports.FlowrGithubBaseRef = `https://github.com/${exports.FlowrGithubGroupName}
|
|
|
13
13
|
exports.FlowrSiteBaseRef = `https://${exports.FlowrGithubGroupName}.github.io/flowr`;
|
|
14
14
|
exports.RemoteFlowrFilePathBaseRef = `${exports.FlowrGithubBaseRef}/flowr/tree/main/`;
|
|
15
15
|
exports.FlowrWikiBaseRef = `${exports.FlowrGithubBaseRef}/flowr/wiki`;
|
|
16
|
+
exports.FlowrGithubRef = exports.FlowrGithubBaseRef + '/flowr';
|
|
16
17
|
exports.FlowrNpmRef = 'https://www.npmjs.com/package/@eagleoutice/flowr';
|
|
17
18
|
exports.FlowrDockerRef = 'https://hub.docker.com/r/eagleoutice/flowr';
|
|
18
19
|
exports.FlowrCodecovRef = `https://app.codecov.io/gh/${exports.FlowrGithubGroupName}/flowr`;
|
|
19
20
|
exports.FlowrVsCode = 'https://marketplace.visualstudio.com/items?itemName=code-inspect.vscode-flowr';
|
|
20
21
|
exports.FlowrPositron = 'https://open-vsx.org/extension/code-inspect/vscode-flowr';
|
|
22
|
+
exports.FlowrRStudioAddin = `${exports.FlowrGithubBaseRef}/rstudio-addin-flowr`;
|
|
23
|
+
exports.FlowrRAdapter = `${exports.FlowrGithubBaseRef}/flowr-r-adapter`;
|
|
21
24
|
/**
|
|
22
25
|
* Returns a markdown link to the given file path relative to the project root.
|
|
23
26
|
*/
|
|
@@ -19,7 +19,7 @@ const flowr_analyzer_context_1 = require("../../project/context/flowr-analyzer-c
|
|
|
19
19
|
function printNormalizedAst(ast, prefix = 'flowchart TD\n') {
|
|
20
20
|
return `
|
|
21
21
|
\`\`\`mermaid
|
|
22
|
-
${(0, ast_1.normalizedAstToMermaid)(ast, prefix)}
|
|
22
|
+
${(0, ast_1.normalizedAstToMermaid)(ast, { prefix })}
|
|
23
23
|
\`\`\`
|
|
24
24
|
`;
|
|
25
25
|
}
|
|
@@ -50,7 +50,7 @@ ${code}
|
|
|
50
50
|
<summary style="color:gray">Mermaid Code</summary>
|
|
51
51
|
|
|
52
52
|
\`\`\`
|
|
53
|
-
${(0, ast_1.normalizedAstToMermaid)(result.normalize.ast, prefix)}
|
|
53
|
+
${(0, ast_1.normalizedAstToMermaid)(result.normalize.ast, { prefix })}
|
|
54
54
|
\`\`\`
|
|
55
55
|
|
|
56
56
|
</details>
|
|
@@ -64,12 +64,13 @@ ${(0, ast_1.normalizedAstToMermaid)(result.normalize.ast, prefix)}
|
|
|
64
64
|
*/
|
|
65
65
|
async function verifyExpectedSubgraph(shell, code, expectedSubgraph) {
|
|
66
66
|
/* we verify that we get what we want first! */
|
|
67
|
+
const context = (0, flowr_analyzer_context_1.contextFromInput)(code);
|
|
67
68
|
const info = await (0, default_pipelines_1.createDataflowPipeline)(shell, {
|
|
68
|
-
context:
|
|
69
|
+
context: context,
|
|
69
70
|
getId: (0, decorate_1.deterministicCountingIdGenerator)(0)
|
|
70
71
|
}).allRemainingSteps();
|
|
71
72
|
expectedSubgraph.setIdMap(info.normalize.idMap);
|
|
72
|
-
expectedSubgraph = (0, resolve_graph_1.resolveDataflowGraph)(expectedSubgraph);
|
|
73
|
+
expectedSubgraph = (0, resolve_graph_1.resolveDataflowGraph)(expectedSubgraph, context);
|
|
73
74
|
const report = (0, diff_dataflow_graph_1.diffOfDataflowGraphs)({ name: 'expected', graph: expectedSubgraph }, { name: 'got', graph: info.dataflow.graph }, {
|
|
74
75
|
leftIsSubgraph: true
|
|
75
76
|
});
|
|
@@ -133,7 +133,7 @@ export interface FnElementInfo {
|
|
|
133
133
|
export declare function printCodeOfElement({ program, info, dropLinesEnd, dropLinesStart, doNotAutoGobble, hideDefinedAt }: FnElementInfo, name: string): string;
|
|
134
134
|
/**
|
|
135
135
|
* Create a short link to a type in the documentation.
|
|
136
|
-
* If you create a wiki, please refer to the functions provided by the {@link
|
|
136
|
+
* If you create a wiki, please refer to the functions provided by the {@link GeneralDocContext}.
|
|
137
137
|
* @param name - The name of the type, e.g. `MyType`, may include a container, e.g.,`MyContainer::MyType` (this works with function nestings too)
|
|
138
138
|
* Use `:::` if you want to access a scoped function, but the name should be displayed without the scope
|
|
139
139
|
* @param hierarchy - The hierarchy of types to search in
|
|
@@ -477,7 +477,7 @@ function printCodeOfElement({ program, info, dropLinesEnd = 0, dropLinesStart =
|
|
|
477
477
|
const lines = code.replaceAll('\t', ' ').split(/\n/g);
|
|
478
478
|
let gobble = Number.POSITIVE_INFINITY;
|
|
479
479
|
for (const line of lines) {
|
|
480
|
-
const match = line.match(/^(\s
|
|
480
|
+
const match = line.match(/^(\s*)\S+/);
|
|
481
481
|
if (match) {
|
|
482
482
|
gobble = Math.min(gobble, match[1].length);
|
|
483
483
|
}
|
|
@@ -523,7 +523,7 @@ function retrieveNode(name, hierarchy, fuzzy = false, type = undefined) {
|
|
|
523
523
|
}
|
|
524
524
|
/**
|
|
525
525
|
* Create a short link to a type in the documentation.
|
|
526
|
-
* If you create a wiki, please refer to the functions provided by the {@link
|
|
526
|
+
* If you create a wiki, please refer to the functions provided by the {@link GeneralDocContext}.
|
|
527
527
|
* @param name - The name of the type, e.g. `MyType`, may include a container, e.g.,`MyContainer::MyType` (this works with function nestings too)
|
|
528
528
|
* Use `:::` if you want to access a scoped function, but the name should be displayed without the scope
|
|
529
529
|
* @param hierarchy - The hierarchy of types to search in
|
|
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
|
|
|
3
3
|
/**
|
|
4
4
|
* https://github.com/flowr-analysis/flowr/blob/main/.github/ISSUE_TEMPLATE/linting-rule.yaml
|
|
5
5
|
*/
|
|
6
|
-
export declare class IssueLintingRule extends DocMaker {
|
|
6
|
+
export declare class IssueLintingRule extends DocMaker<'.github/ISSUE_TEMPLATE/linting-rule.yaml'> {
|
|
7
7
|
constructor();
|
|
8
8
|
text({ ctx }: DocMakerArgs): string;
|
|
9
9
|
}
|
|
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
|
|
|
3
3
|
/**
|
|
4
4
|
* https://github.com/flowr-analysis/flowr/wiki/Analyzer
|
|
5
5
|
*/
|
|
6
|
-
export declare class WikiAnalyzer extends DocMaker {
|
|
6
|
+
export declare class WikiAnalyzer extends DocMaker<'wiki/Analyzer.md'> {
|
|
7
7
|
constructor();
|
|
8
8
|
text({ ctx }: DocMakerArgs): string;
|
|
9
9
|
}
|
|
@@ -26,6 +26,7 @@ const flowr_analyzer_plugin_defaults_1 = require("../project/plugins/flowr-analy
|
|
|
26
26
|
const doc_maker_1 = require("./wiki-mk/doc-maker");
|
|
27
27
|
const flowr_analyzer_rmd_file_plugin_1 = require("../project/plugins/file-plugins/notebooks/flowr-analyzer-rmd-file-plugin");
|
|
28
28
|
const flowr_analyzer_plugin_1 = require("../project/plugins/flowr-analyzer-plugin");
|
|
29
|
+
const flowr_analyzer_environment_context_1 = require("../project/context/flowr-analyzer-environment-context");
|
|
29
30
|
async function analyzerQuickExample() {
|
|
30
31
|
const analyzer = await new flowr_analyzer_builder_1.FlowrAnalyzerBuilder()
|
|
31
32
|
.setEngine('tree-sitter')
|
|
@@ -78,7 +79,8 @@ ${(0, doc_structure_1.collapsibleToc)({
|
|
|
78
79
|
'Context Information': {
|
|
79
80
|
'Files Context': undefined,
|
|
80
81
|
'Loading Order Context': undefined,
|
|
81
|
-
'Dependencies Context': undefined
|
|
82
|
+
'Dependencies Context': undefined,
|
|
83
|
+
'Environment Context': undefined
|
|
82
84
|
},
|
|
83
85
|
'Caching': undefined
|
|
84
86
|
})}
|
|
@@ -396,6 +398,17 @@ Probably the most important method is
|
|
|
396
398
|
${ctx.linkM(flowr_analyzer_dependencies_context_1.FlowrAnalyzerDependenciesContext, 'getDependency', { codeFont: true, realNameWrapper: 'i' })}
|
|
397
399
|
that allows you to query for a specific dependency by name.
|
|
398
400
|
|
|
401
|
+
${(0, doc_structure_1.section)('Environment Context', 3)}
|
|
402
|
+
|
|
403
|
+
Here is the structure of the ${ctx.link(flowr_analyzer_environment_context_1.FlowrAnalyzerEnvironmentContext)} that provides access to the built-in environment:
|
|
404
|
+
|
|
405
|
+
${ctx.hierarchy(flowr_analyzer_environment_context_1.FlowrAnalyzerEnvironmentContext, { showImplSnippet: false })}
|
|
406
|
+
|
|
407
|
+
The environment context provides access to the built-in environment via
|
|
408
|
+
${ctx.linkM(flowr_analyzer_environment_context_1.FlowrAnalyzerEnvironmentContext, 'makeCleanEnv', { codeFont: true, realNameWrapper: 'i' })}.
|
|
409
|
+
It also provides the empty built-in environment, which only contains primitives, via
|
|
410
|
+
${ctx.linkM(flowr_analyzer_environment_context_1.FlowrAnalyzerEnvironmentContext, 'makeCleanEnvWithEmptyBuiltIns', { codeFont: true, realNameWrapper: 'i' })}.
|
|
411
|
+
|
|
399
412
|
${(0, doc_structure_1.section)('Caching', 2)}
|
|
400
413
|
|
|
401
414
|
To speed up analyses, flowR provides a caching mechanism that stores intermediate results of the analysis.
|
|
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
|
|
|
3
3
|
/**
|
|
4
4
|
* https://github.com/flowr-analysis/flowr/wiki/Control-Flow-Graph
|
|
5
5
|
*/
|
|
6
|
-
export declare class WikiCfg extends DocMaker {
|
|
6
|
+
export declare class WikiCfg extends DocMaker<'wiki/Control Flow Graph.md'> {
|
|
7
7
|
constructor();
|
|
8
8
|
text({ ctx, shell }: DocMakerArgs): Promise<string>;
|
|
9
9
|
}
|
|
@@ -8,7 +8,7 @@ export declare function inspectContextExample(analyzer: FlowrAnalyzer): void;
|
|
|
8
8
|
/**
|
|
9
9
|
* https://github.com/flowr-analysis/flowr/wiki/Core
|
|
10
10
|
*/
|
|
11
|
-
export declare class WikiCore extends DocMaker {
|
|
11
|
+
export declare class WikiCore extends DocMaker<'wiki/Core.md'> {
|
|
12
12
|
constructor();
|
|
13
13
|
text({ shell, treeSitter, ctx }: DocMakerArgs): Promise<string>;
|
|
14
14
|
}
|
|
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
|
|
|
3
3
|
/**
|
|
4
4
|
* https://github.com/flowr-analysis/flowr/wiki/Dataflow-Graph
|
|
5
5
|
*/
|
|
6
|
-
export declare class WikiDataflowGraph extends DocMaker {
|
|
6
|
+
export declare class WikiDataflowGraph extends DocMaker<'wiki/Dataflow Graph.md'> {
|
|
7
7
|
constructor();
|
|
8
8
|
protected text({ ctx, treeSitter }: DocMakerArgs): Promise<string>;
|
|
9
9
|
}
|
|
@@ -195,7 +195,7 @@ However, in general, flowR may use any fitting handler as an origin. For example
|
|
|
195
195
|
${(0, doc_structure_1.details)('Example: Simple Function Call (unresolved)', await (async () => {
|
|
196
196
|
const code = 'foo(x,3,y=3,)';
|
|
197
197
|
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, code, { mark: new Set([8]), exposeResult: true });
|
|
198
|
-
const callInfo =
|
|
198
|
+
const callInfo = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionCall && vertex.name === 'foo');
|
|
199
199
|
(0, assert_1.guard)(callInfo !== undefined, () => `Could not find call vertex for ${code}`);
|
|
200
200
|
const [callId, callVert] = callInfo;
|
|
201
201
|
const inverseMapReferenceTypes = Object.fromEntries(Object.entries(identifier_1.ReferenceType).map(([k, v]) => [v, k]));
|
|
@@ -308,7 +308,7 @@ Consider a case in which you have a built-in function (like the assignment opera
|
|
|
308
308
|
|
|
309
309
|
${await (async () => {
|
|
310
310
|
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, 'x <- 2\nif(u) `<-` <- `*`\nx <- 3', { switchCodeAndGraph: true, mark: new Set([9, '9->0', '9->10']), exposeResult: true });
|
|
311
|
-
const interestingUseOfAssignment =
|
|
311
|
+
const interestingUseOfAssignment = info.dataflow.graph.vertices(true).find(([, vertex]) => vertex.id === 11);
|
|
312
312
|
(0, assert_1.guard)(interestingUseOfAssignment !== undefined, () => 'Could not find interesting assignment vertex for the code');
|
|
313
313
|
const [id, interestingVertex] = interestingUseOfAssignment;
|
|
314
314
|
const env = interestingVertex.environment;
|
|
@@ -333,7 +333,7 @@ Hence, trying to re-resolve the call using ${ctx.link(linker_1.getAllFunctionCal
|
|
|
333
333
|
the following target ids: { \`${[...(0, linker_1.getAllFunctionCallTargets)(id, info.dataflow.graph)].join('`, `')}\` }.
|
|
334
334
|
This way we know that the call may refer to the built-in assignment operator or to the multiplication.
|
|
335
335
|
Similarly, trying to resolve the name with ${ctx.link(resolve_by_name_1.resolveByName)}\` using the environment attached to the call vertex (filtering for any reference type) returns (in a similar fashion):
|
|
336
|
-
{ \`${(0, resolve_by_name_1.
|
|
336
|
+
{ \`${(0, resolve_by_name_1.resolveByNameAnyType)(name, env)?.map(d => d.nodeId).join('`, `')}\` } (however, the latter will not trace aliases).
|
|
337
337
|
|
|
338
338
|
`;
|
|
339
339
|
})()}
|
|
@@ -449,8 +449,7 @@ vertices of function definitions or not (e.g., \`${new graph_1.DataflowGraph(und
|
|
|
449
449
|
|
|
450
450
|
${(0, doc_structure_1.details)('Example: Nested Function Definitions', await (async () => {
|
|
451
451
|
const [text, info] = await (0, doc_dfg_1.printDfGraphForCode)(parser, 'f <- function() { g <- function() 3 }', { mark: new Set([9, 6]), exposeResult: true });
|
|
452
|
-
const definitions = info.dataflow.graph.
|
|
453
|
-
.filter(([, vertex]) => vertex.tag === vertex_1.VertexType.FunctionDefinition)
|
|
452
|
+
const definitions = info.dataflow.graph.verticesOfType(vertex_1.VertexType.FunctionDefinition)
|
|
454
453
|
.map(([id, vertex]) => `| \`${id}\` | { \`${[...vertex.subflow.graph].join('`, `')}\` } |`)
|
|
455
454
|
.toArray();
|
|
456
455
|
return `
|
|
@@ -740,7 +739,7 @@ class WikiDataflowGraph extends doc_maker_1.DocMaker {
|
|
|
740
739
|
return `
|
|
741
740
|
This page briefly summarizes flowR's dataflow graph, represented by the ${ctx.link(graph_1.DataflowGraph)} class within the code.
|
|
742
741
|
In case you want to manually build such a graph (e.g., for testing), you can use the ${ctx.link(dataflowgraph_builder_1.DataflowGraphBuilder)}.
|
|
743
|
-
If you are interested in which features we support and which features are still to be worked on, please refer to our
|
|
742
|
+
If you are interested in which features we support and which features are still to be worked on, please refer to our ${ctx.linkPage('wiki/Capabilities')} page.
|
|
744
743
|
In summary, we discuss the following topics:
|
|
745
744
|
|
|
746
745
|
- [Vertices](#vertices)
|
|
@@ -759,12 +758,12 @@ wiki page if you are unsure.
|
|
|
759
758
|
|
|
760
759
|
> [!TIP]
|
|
761
760
|
> If you want to investigate the dataflow graph,
|
|
762
|
-
> you can either use the [Visual Studio Code extension](${doc_files_1.
|
|
763
|
-
> command in the REPL (see the
|
|
764
|
-
> There is also a simplified perspective available with ${
|
|
761
|
+
> you can either use the [Visual Studio Code extension](${doc_files_1.FlowrVsCode}) or the ${ctx.replCmd('dataflow*')}
|
|
762
|
+
> command in the REPL (see the ${ctx.linkPage('wiki/Interface', 'Interface wiki page')} for more information).
|
|
763
|
+
> There is also a simplified perspective available with ${ctx.replCmd('dataflowsimple*')} that does not show everything but is easier to read.
|
|
765
764
|
> When using _flowR_ as a library, you may use the functions in ${(0, doc_files_1.getFilePathMd)('../util/mermaid/dfg.ts')}.
|
|
766
765
|
>
|
|
767
|
-
> If you receive a dataflow graph in its serialized form (e.g., by talking to a [_flowR_ server](${doc_files_1.FlowrWikiBaseRef}/Interface)), you can use ${ctx.
|
|
766
|
+
> If you receive a dataflow graph in its serialized form (e.g., by talking to a [_flowR_ server](${doc_files_1.FlowrWikiBaseRef}/Interface)), you can use ${ctx.linkM(graph_1.DataflowGraph, 'fromJson', { realNameWrapper: 'i', codeFont: true })} to retrieve the graph from the JSON representation.
|
|
768
767
|
>
|
|
769
768
|
> Also, check out the [${doc_files_1.FlowrGithubGroupName}/sample-analyzer-df-diff](${doc_files_1.FlowrGithubBaseRef}/sample-analyzer-df-diff) repository for a complete example project creating and comparing dataflow graphs.
|
|
770
769
|
|
|
@@ -774,7 +773,7 @@ ${await (0, doc_dfg_1.printDfGraphForCode)(treeSitter, 'x <- 3\ny <- x + 1\ny')}
|
|
|
774
773
|
The above dataflow graph showcases the general gist. We define a dataflow graph as a directed graph G = (V, E), differentiating between ${(0, doc_data_dfg_util_1.getAllVertices)().length} types of vertices V and
|
|
775
774
|
${(0, doc_data_dfg_util_1.getAllEdges)().length} types of edges E allowing each vertex to have a single, and each edge to have multiple distinct types.
|
|
776
775
|
Additionally, every node may have links to its [control dependencies](#control-dependencies) (which you may view as a ${(0, text_1.nth)((0, doc_data_dfg_util_1.getAllEdges)().length + 1)} edge type,
|
|
777
|
-
although they are explicitly no data dependency and relate to the
|
|
776
|
+
although they are explicitly no data dependency and relate to the ${ctx.linkPage('wiki/Control Flow Graph')}.
|
|
778
777
|
|
|
779
778
|
<details open>
|
|
780
779
|
|
|
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
|
|
|
3
3
|
/**
|
|
4
4
|
* https://github.com/flowr-analysis/flowr/wiki/Engines
|
|
5
5
|
*/
|
|
6
|
-
export declare class WikiEngine extends DocMaker {
|
|
6
|
+
export declare class WikiEngine extends DocMaker<'wiki/Engines.md'> {
|
|
7
7
|
constructor();
|
|
8
8
|
text({ ctx }: DocMakerArgs): string;
|
|
9
9
|
}
|
|
@@ -5,7 +5,6 @@ const shell_1 = require("../r-bridge/shell");
|
|
|
5
5
|
const shell_executor_1 = require("../r-bridge/shell-executor");
|
|
6
6
|
const tree_sitter_executor_1 = require("../r-bridge/lang-4.x/tree-sitter/tree-sitter-executor");
|
|
7
7
|
const doc_files_1 = require("./doc-util/doc-files");
|
|
8
|
-
const doc_cli_option_1 = require("./doc-util/doc-cli-option");
|
|
9
8
|
const doc_structure_1 = require("./doc-util/doc-structure");
|
|
10
9
|
const doc_maker_1 = require("./wiki-mk/doc-maker");
|
|
11
10
|
/**
|
|
@@ -30,13 +29,13 @@ we provide the concept of engines.
|
|
|
30
29
|
Engines can be loaded with [flowR's configuration file](${doc_files_1.FlowrWikiBaseRef}/Interface#configuring-flowr). Additionally, they
|
|
31
30
|
are exposed with some command line options (e.g., when using the docker image of flowR):
|
|
32
31
|
|
|
33
|
-
- ${
|
|
34
|
-
- ${
|
|
35
|
-
- ${
|
|
36
|
-
- ${
|
|
37
|
-
- ${
|
|
38
|
-
- ${
|
|
39
|
-
- ${
|
|
32
|
+
- ${ctx.cliOption('flowr', 'engine.r-shell.disabled', false)} to disable the ${ctx.link(shell_1.RShell)} engine
|
|
33
|
+
- ${ctx.cliOption('flowr', 'engine.r-shell.r-path', false)} (which is the canonical version of ${ctx.cliOption('flowr', 'r-path')})
|
|
34
|
+
- ${ctx.cliOption('flowr', 'engine.tree-sitter.disabled', false)} to disable the ${ctx.link(tree_sitter_executor_1.TreeSitterExecutor)} engine
|
|
35
|
+
- ${ctx.cliOption('flowr', 'engine.tree-sitter.lax', false)} to use lax parsing with tree-sitter
|
|
36
|
+
- ${ctx.cliOption('flowr', 'engine.tree-sitter.wasm-path', false)} pass the path to the wasm of the r grammar of tree-sitter (see [below](#tree-sitter))
|
|
37
|
+
- ${ctx.cliOption('flowr', 'engine.tree-sitter.tree-sitter-wasm-path', false)} pass the path to the wasm of tree-sitter (see [below](#tree-sitter))
|
|
38
|
+
- ${ctx.cliOption('flowr', 'default-engine', false)} to set the default engine to use
|
|
40
39
|
|
|
41
40
|
<a id="tree-sitter"></a>
|
|
42
41
|
## Dealing with the Tree-Sitter Engine
|
|
@@ -47,8 +46,8 @@ ${(0, doc_structure_1.block)({
|
|
|
47
46
|
})}
|
|
48
47
|
|
|
49
48
|
In general, there is no need for you to pass custom paths using either
|
|
50
|
-
${
|
|
51
|
-
${
|
|
49
|
+
${ctx.cliOption('flowr', 'engine.tree-sitter.wasm-path', false)} or
|
|
50
|
+
${ctx.cliOption('flowr', 'engine.tree-sitter.tree-sitter-wasm-path', false)}.
|
|
52
51
|
However, you may want to experiment with the R grammar or provide a newer
|
|
53
52
|
one in case that of _flowR_ is outdated.
|
|
54
53
|
|
|
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
|
|
|
3
3
|
/**
|
|
4
4
|
* https://github.com/flowr-analysis/flowr/wiki/Interface
|
|
5
5
|
*/
|
|
6
|
-
export declare class WikiInterface extends DocMaker {
|
|
6
|
+
export declare class WikiInterface extends DocMaker<'wiki/Interface.md'> {
|
|
7
7
|
constructor();
|
|
8
8
|
protected text({ shell, ctx, treeSitter }: DocMakerArgs): Promise<string>;
|
|
9
9
|
}
|
|
@@ -94,11 +94,11 @@ with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
|
|
|
94
94
|
|
|
95
95
|
`;
|
|
96
96
|
}
|
|
97
|
-
async function explainRepl(parser) {
|
|
97
|
+
async function explainRepl(parser, ctx) {
|
|
98
98
|
return `
|
|
99
99
|
> [!NOTE]
|
|
100
|
-
> To execute arbitrary R commands with a repl request, _flowR_ has to be started explicitly with ${
|
|
101
|
-
> Please be aware that this introduces a security risk and note that this relies on the
|
|
100
|
+
> To execute arbitrary R commands with a repl request, _flowR_ has to be started explicitly with ${ctx.cliOption('flowr', 'r-session-access')}.
|
|
101
|
+
> Please be aware that this introduces a security risk and note that this relies on the ${ctx.linkPage('wiki/Engines', '`r-shell` engine')} .
|
|
102
102
|
|
|
103
103
|
Although primarily meant for users to explore,
|
|
104
104
|
there is nothing which forbids simply calling _flowR_ as a subprocess to use standard-in, -output, and -error
|
|
@@ -108,8 +108,8 @@ with the [REPL Request](#message-request-repl-execution) message).
|
|
|
108
108
|
The read-eval-print loop (REPL) works relatively simple.
|
|
109
109
|
You can submit an expression (using <kbd>Enter</kbd>),
|
|
110
110
|
which is interpreted as an R expression by default but interpreted as a *command* if it starts with a colon (\`:\`).
|
|
111
|
-
The best command to get started with the REPL is ${
|
|
112
|
-
Besides, you can leave the REPL either with the command ${
|
|
111
|
+
The best command to get started with the REPL is ${ctx.replCmd('help')}.
|
|
112
|
+
Besides, you can leave the REPL either with the command ${ctx.replCmd('quit')} or by pressing <kbd>Ctrl</kbd>+<kbd>C</kbd> twice.
|
|
113
113
|
When writing a *command*, you may press <kbd>Tab</kbd> to get a list of completions, if available.
|
|
114
114
|
Multiple commands can be entered in a single line by separating them with a semicolon (\`;\`), e.g. \`:parse "x<-2"; :df*\`.
|
|
115
115
|
If a command is given without R code, the REPL will re-use R code given in a previous command.
|
|
@@ -142,20 +142,20 @@ the REPL will re-use previously obtained information and not re-parse the code a
|
|
|
142
142
|
### Example: Retrieving the Dataflow Graph
|
|
143
143
|
|
|
144
144
|
To retrieve a URL to the [mermaid](https://mermaid.js.org/) diagram of the dataflow of a given expression,
|
|
145
|
-
use ${
|
|
145
|
+
use ${ctx.replCmd('dataflow*')} (or ${ctx.replCmd('dataflow')} to get the mermaid code in the cli):
|
|
146
146
|
|
|
147
147
|
${await (0, doc_repl_1.documentReplSession)(parser, [{
|
|
148
148
|
command: ':dataflow* y <- 1 + x',
|
|
149
149
|
description: `Retrieve the dataflow graph of the expression \`y <- 1 + x\`. It looks like this:\n${await (0, doc_dfg_1.printDfGraphForCode)(parser, 'y <- 1 + x')}`
|
|
150
150
|
}])}
|
|
151
151
|
|
|
152
|
-
For the slicing with ${
|
|
152
|
+
For the slicing with ${ctx.replCmd('slicer')}, you have access to the same [magic comments](#slice-magic-comments) as with the [slice request](#message-request-slice).
|
|
153
153
|
|
|
154
154
|
### Example: Interfacing with the File System
|
|
155
155
|
|
|
156
|
-
Many commands that allow for an R-expression (like ${
|
|
156
|
+
Many commands that allow for an R-expression (like ${ctx.replCmd('dataflow*')}) allow for a file as well
|
|
157
157
|
if the argument starts with \`${retriever_1.fileProtocol}\`.
|
|
158
|
-
If you are working from the root directory of the _flowR_ repository, the following gives you the parsed AST of the example file using the ${
|
|
158
|
+
If you are working from the root directory of the _flowR_ repository, the following gives you the parsed AST of the example file using the ${ctx.replCmd('parse')} command:
|
|
159
159
|
|
|
160
160
|
${await (0, doc_repl_1.documentReplSession)(parser, [{
|
|
161
161
|
command: `:parse ${retriever_1.fileProtocol}test/testfiles/example.R`,
|
|
@@ -232,9 +232,9 @@ ${(0, doc_code_1.codeBlock)('json', JSON.stringify({
|
|
|
232
232
|
}
|
|
233
233
|
},
|
|
234
234
|
abstractInterpretation: {
|
|
235
|
+
wideningThreshold: 4,
|
|
235
236
|
dataFrame: {
|
|
236
237
|
maxColNames: 20,
|
|
237
|
-
wideningThreshold: 4,
|
|
238
238
|
readLoadedData: {
|
|
239
239
|
readExternalFiles: true,
|
|
240
240
|
maxReadLines: 1_000_000
|
|
@@ -436,8 +436,7 @@ class WikiInterface extends doc_maker_1.DocMaker {
|
|
|
436
436
|
}
|
|
437
437
|
async text({ shell, ctx, treeSitter }) {
|
|
438
438
|
return `
|
|
439
|
-
Although far from being as detailed as the in-depth explanation of
|
|
440
|
-
[_flowR_](${doc_files_1.FlowrWikiBaseRef}/Core),
|
|
439
|
+
Although far from being as detailed as the in-depth explanation of ${ctx.linkPage('wiki/Core', '_flowR_')},
|
|
441
440
|
this wiki page explains how to interface with _flowR_ in more detail.
|
|
442
441
|
In general, command line arguments and other options provide short descriptions on hover over.
|
|
443
442
|
|
|
@@ -454,7 +453,7 @@ ${await explainServer(shell)}
|
|
|
454
453
|
<a id='using-the-repl'></a>
|
|
455
454
|
## 💻 Using the REPL
|
|
456
455
|
|
|
457
|
-
${await explainRepl(treeSitter)}
|
|
456
|
+
${await explainRepl(treeSitter, ctx)}
|
|
458
457
|
|
|
459
458
|
<a id='configuring-flowr'></a>
|
|
460
459
|
## ⚙️ Configuring FlowR
|
|
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
|
|
|
3
3
|
/**
|
|
4
4
|
* https://github.com/flowr-analysis/flowr/wiki/Linter
|
|
5
5
|
*/
|
|
6
|
-
export declare class WikiLinter extends DocMaker {
|
|
6
|
+
export declare class WikiLinter extends DocMaker<'wiki/Linter.md'> {
|
|
7
7
|
constructor();
|
|
8
8
|
protected text({ treeSitter }: DocMakerArgs): Promise<string>;
|
|
9
9
|
}
|
|
@@ -144,7 +144,7 @@ df[6, "value"]
|
|
|
144
144
|
const certaintyText = `\`${(0, html_hover_over_1.textWithTooltip)(rule.info.certainty, certaintyDoc)}\``;
|
|
145
145
|
if (format === 'short') {
|
|
146
146
|
ruleExplanations.set(name, () => Promise.resolve(`
|
|
147
|
-
**[${rule.info.name}](${doc_files_1.FlowrWikiBaseRef}/${getPageNameForLintingRule(name)}):** ${rule.info.description} [see ${(0, doc_types_1.shortLinkFile)(ruleType, types)}]\\
|
|
147
|
+
**[${rule.info.name}](${doc_files_1.FlowrWikiBaseRef}/${encodeURIComponent(getPageNameForLintingRule(name))}):** ${rule.info.description} [see ${(0, doc_types_1.shortLinkFile)(ruleType, types)}]\\
|
|
148
148
|
${tags}
|
|
149
149
|
|
|
150
150
|
`.trim()));
|
|
@@ -3,7 +3,7 @@ import { DocMaker } from './wiki-mk/doc-maker';
|
|
|
3
3
|
/**
|
|
4
4
|
* https://github.com/flowr-analysis/flowr/wiki/Linting-and-Testing
|
|
5
5
|
*/
|
|
6
|
-
export declare class WikiLintingAndTesting extends DocMaker {
|
|
6
|
+
export declare class WikiLintingAndTesting extends DocMaker<'wiki/Linting and Testing.md'> {
|
|
7
7
|
constructor();
|
|
8
8
|
protected text({ ctx }: DocMakerArgs): string;
|
|
9
9
|
}
|