@eagleoutice/flowr 2.6.3 → 2.7.0
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 +13 -13
- package/abstract-interpretation/data-frame/absint-visitor.d.ts +1 -1
- package/abstract-interpretation/data-frame/absint-visitor.js +3 -3
- package/abstract-interpretation/data-frame/dataframe-domain.d.ts +4 -7
- package/abstract-interpretation/data-frame/dataframe-domain.js +5 -11
- package/abstract-interpretation/data-frame/mappers/access-mapper.d.ts +3 -1
- package/abstract-interpretation/data-frame/mappers/access-mapper.js +3 -2
- package/abstract-interpretation/data-frame/mappers/arguments.js +2 -2
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.d.ts +3 -1
- package/abstract-interpretation/data-frame/mappers/assignment-mapper.js +3 -2
- package/abstract-interpretation/data-frame/mappers/function-mapper.d.ts +1 -1
- package/abstract-interpretation/data-frame/mappers/function-mapper.js +8 -8
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.d.ts +3 -1
- package/abstract-interpretation/data-frame/mappers/replacement-mapper.js +3 -2
- package/abstract-interpretation/data-frame/semantics.js +47 -42
- package/abstract-interpretation/data-frame/shape-inference.d.ts +1 -1
- 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.js +1 -1
- package/abstract-interpretation/domains/interval-domain.d.ts +2 -2
- 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 +98 -0
- package/abstract-interpretation/domains/set-range-domain.js +400 -0
- package/abstract-interpretation/domains/set-upper-bound-domain.js +2 -2
- package/abstract-interpretation/domains/singleton-domain.js +2 -2
- package/benchmark/slicer.d.ts +2 -1
- package/benchmark/slicer.js +37 -15
- 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/control-flow/cfg-dead-code.js +3 -2
- 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 +15 -13
- 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.js +3 -7
- 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-util/doc-dfg.js +3 -2
- package/documentation/doc-util/doc-normalized-ast.js +3 -2
- package/documentation/doc-util/doc-types.d.ts +1 -1
- package/documentation/doc-util/doc-types.js +2 -2
- package/documentation/wiki-analyzer.js +14 -1
- package/documentation/wiki-dataflow-graph.js +4 -5
- package/documentation/wiki-faq.js +0 -1
- package/documentation/wiki-linter.js +1 -1
- package/documentation/wiki-mk/doc-maker.js +2 -1
- package/linter/linter-rules.d.ts +2 -2
- package/linter/rules/absolute-path.js +4 -4
- package/linter/rules/dataframe-access-validation.d.ts +1 -1
- package/linter/rules/dataframe-access-validation.js +1 -1
- 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/package.json +1 -2
- package/project/context/flowr-analyzer-context.d.ts +7 -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/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 +1 -1
- 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/inspect-higher-order-query/inspect-higher-order-query-executor.js +3 -3
- 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/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/used-functions/used-functions.js +1 -1
- package/statistics/features/supported/variables/variables.js +2 -1
- package/util/containers.js +1 -1
- package/util/mermaid/dfg.d.ts +1 -0
- package/util/mermaid/dfg.js +3 -3
- package/util/simple-df/dfg-view.d.ts +2 -1
- package/util/simple-df/dfg-view.js +2 -2
- package/util/version.js +1 -1
- package/dataflow/environments/remove.d.ts +0 -12
- package/dataflow/environments/remove.js +0 -52
|
@@ -1,20 +1,8 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides an environment structure similar to R.
|
|
3
|
-
* This allows the dataflow to hold current definition locations for variables, based on the current scope.
|
|
4
|
-
* @module
|
|
5
|
-
*/
|
|
6
|
-
import type { IdentifierReference } from './identifier';
|
|
7
|
-
import type { DataflowGraph } from '../graph/graph';
|
|
8
|
-
import type { ControlDependency } from '../info';
|
|
9
1
|
import type { BuiltInMemory } from './built-in';
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
*
|
|
16
|
-
*/
|
|
17
|
-
export declare function makeAllMaybe(references: readonly IdentifierReference[] | undefined, graph: DataflowGraph, environments: REnvironmentInformation, includeDefs: boolean, defaultCd?: ControlDependency | undefined): IdentifierReference[];
|
|
2
|
+
import type { Identifier, IdentifierDefinition } from './identifier';
|
|
3
|
+
import type { ControlDependency } from '../info';
|
|
4
|
+
import type { FlowrConfigOptions } from '../../config';
|
|
5
|
+
import type { NodeId } from '../../r-bridge/lang-4.x/ast/model/processing/node-id';
|
|
18
6
|
/** A single entry/scope within an {@link REnvironmentInformation} */
|
|
19
7
|
export interface IEnvironment {
|
|
20
8
|
/** Unique and internally generated identifier -- will not be used for comparison but helps with debugging for tracking identities */
|
|
@@ -28,6 +16,12 @@ export interface IEnvironment {
|
|
|
28
16
|
*/
|
|
29
17
|
builtInEnv?: true | undefined;
|
|
30
18
|
}
|
|
19
|
+
type Jsonified = {
|
|
20
|
+
id: NodeId;
|
|
21
|
+
parent: Jsonified | undefined;
|
|
22
|
+
builtInEnv?: true;
|
|
23
|
+
memory: BuiltInMemory;
|
|
24
|
+
};
|
|
31
25
|
/**
|
|
32
26
|
* Please use this function only if you do not know the object type.
|
|
33
27
|
* Otherwise, rely on {@link IEnvironment#builtInEnv}
|
|
@@ -36,14 +30,43 @@ export declare function isDefaultBuiltInEnvironment(obj: unknown): boolean;
|
|
|
36
30
|
/** @see REnvironmentInformation */
|
|
37
31
|
export declare class Environment implements IEnvironment {
|
|
38
32
|
readonly id: number;
|
|
39
|
-
parent:
|
|
33
|
+
parent: Environment;
|
|
40
34
|
memory: BuiltInMemory;
|
|
35
|
+
cache?: BuiltInMemory;
|
|
41
36
|
builtInEnv?: true;
|
|
42
|
-
constructor(parent:
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
37
|
+
constructor(parent: Environment, isBuiltInDefault?: true | undefined);
|
|
38
|
+
/**
|
|
39
|
+
* Create a deep clone of this environment.
|
|
40
|
+
* @param recurseParents - Whether to also clone parent environments
|
|
41
|
+
*/
|
|
42
|
+
clone(recurseParents: boolean): Environment;
|
|
43
|
+
/**
|
|
44
|
+
* Define a new identifier definition within this environment.
|
|
45
|
+
* @param definition - The definition to add.
|
|
46
|
+
* @param config - The flowr configuration options.
|
|
47
|
+
*/
|
|
48
|
+
define(definition: IdentifierDefinition & {
|
|
49
|
+
name: Identifier;
|
|
50
|
+
}, { solver: { pointerTracking } }: FlowrConfigOptions): Environment;
|
|
51
|
+
defineSuper(definition: IdentifierDefinition & {
|
|
52
|
+
name: Identifier;
|
|
53
|
+
}): Environment;
|
|
54
|
+
/**
|
|
55
|
+
* Assumes, that all definitions within other replace those within this environment (given the same name).
|
|
56
|
+
* <b>But</b> if all definitions within other are maybe, then they are appended to the current definitions (updating them to be `maybe` from now on as well), similar to {@link appendEnvironment}.
|
|
57
|
+
* This always recurses parents.
|
|
58
|
+
*/
|
|
59
|
+
overwrite(other: Environment | undefined, applyCds?: readonly ControlDependency[]): Environment;
|
|
60
|
+
/**
|
|
61
|
+
* Adds all writes of `other` to this environment (i.e., the operations of `other` *might* happen).
|
|
62
|
+
* This always recurses parents.
|
|
63
|
+
*/
|
|
64
|
+
append(other: Environment | undefined): Environment;
|
|
65
|
+
remove(name: Identifier): this;
|
|
66
|
+
removeAll(names: readonly {
|
|
67
|
+
name: Identifier;
|
|
68
|
+
}[]): Environment;
|
|
69
|
+
toJSON(): Jsonified;
|
|
47
70
|
}
|
|
48
71
|
/**
|
|
49
72
|
* An environment describes a ({@link IEnvironment#parent|scoped}) mapping of names to their definitions ({@link BuiltIns}).
|
|
@@ -55,7 +78,7 @@ export interface WorkingDirectoryReference {
|
|
|
55
78
|
* but statically determining all attached environments is theoretically impossible --- consider attachments by user input).
|
|
56
79
|
*
|
|
57
80
|
* One important environment is the {@link BuiltIns|BuiltInEnvironment} which contains the default definitions for R's built-in functions and constants.
|
|
58
|
-
*
|
|
81
|
+
* This environment is created and provided by the {@link FlowrAnalyzerEnvironmentContext}.
|
|
59
82
|
* During serialization, you may want to rely on the {@link builtInEnvJsonReplacer} to avoid the huge built-in environment.
|
|
60
83
|
* @see {@link define} - to define a new {@link IdentifierDefinition|identifier definition} within an environment
|
|
61
84
|
* @see {@link resolveByName} - to resolve an {@link Identifier|identifier/name} to its {@link IdentifierDefinition|definitions} within an environment
|
|
@@ -67,15 +90,12 @@ export interface WorkingDirectoryReference {
|
|
|
67
90
|
*/
|
|
68
91
|
export interface REnvironmentInformation {
|
|
69
92
|
/** The currently active environment (the stack is represented by the currently active {@link IEnvironment#parent}). Environments are maintained within the dataflow graph. */
|
|
70
|
-
readonly current:
|
|
93
|
+
readonly current: Environment;
|
|
71
94
|
/** nesting level of the environment, will be `0` for the global/root environment */
|
|
72
95
|
readonly level: number;
|
|
73
96
|
}
|
|
74
|
-
/**
|
|
75
|
-
* Initialize a new {@link REnvironmentInformation|environment} with the built-ins.
|
|
76
|
-
*/
|
|
77
|
-
export declare function initializeCleanEnvironments(memory?: BuiltInMemory, fullBuiltIns?: boolean): REnvironmentInformation;
|
|
78
97
|
/**
|
|
79
98
|
* Helps to serialize an environment, but replaces the built-in environment with a placeholder.
|
|
80
99
|
*/
|
|
81
100
|
export declare function builtInEnvJsonReplacer(k: unknown, v: unknown): unknown;
|
|
101
|
+
export {};
|
|
@@ -1,61 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Environment = void 0;
|
|
4
|
-
exports.makeReferenceMaybe = makeReferenceMaybe;
|
|
5
|
-
exports.makeAllMaybe = makeAllMaybe;
|
|
6
4
|
exports.isDefaultBuiltInEnvironment = isDefaultBuiltInEnvironment;
|
|
7
|
-
exports.initializeCleanEnvironments = initializeCleanEnvironments;
|
|
8
5
|
exports.builtInEnvJsonReplacer = builtInEnvJsonReplacer;
|
|
9
|
-
const identifier_1 = require("./identifier");
|
|
10
|
-
const resolve_by_name_1 = require("./resolve-by-name");
|
|
11
|
-
const json_1 = require("../../util/json");
|
|
12
|
-
const built_in_config_1 = require("./built-in-config");
|
|
13
|
-
/**
|
|
14
|
-
* Marks the reference as maybe (i.e., as controlled by a set of {@link IdentifierReference#controlDependencies|control dependencies}).
|
|
15
|
-
*/
|
|
16
|
-
function makeReferenceMaybe(ref, graph, environments, includeDefs, defaultCd = undefined) {
|
|
17
|
-
if (includeDefs) {
|
|
18
|
-
const definitions = ref.name ? (0, resolve_by_name_1.resolveByName)(ref.name, environments, ref.type) : undefined;
|
|
19
|
-
for (const definition of definitions ?? []) {
|
|
20
|
-
if (definition.type !== identifier_1.ReferenceType.BuiltInFunction && definition.type !== identifier_1.ReferenceType.BuiltInConstant) {
|
|
21
|
-
if (definition.controlDependencies) {
|
|
22
|
-
if (defaultCd && !definition.controlDependencies.find(c => c.id === defaultCd.id && c.when === defaultCd.when)) {
|
|
23
|
-
definition.controlDependencies.push(defaultCd);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
else {
|
|
27
|
-
definition.controlDependencies = defaultCd ? [defaultCd] : [];
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
const node = graph.getVertex(ref.nodeId, true);
|
|
33
|
-
if (node) {
|
|
34
|
-
if (node.cds) {
|
|
35
|
-
if (defaultCd && !node.cds.find(c => c.id === defaultCd.id && c.when === defaultCd.when)) {
|
|
36
|
-
node.cds.push(defaultCd);
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
else {
|
|
40
|
-
node.cds = defaultCd ? [defaultCd] : [];
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
if (ref.controlDependencies) {
|
|
44
|
-
if (defaultCd && !ref.controlDependencies.find(c => c.id === defaultCd.id && c.when === defaultCd.when)) {
|
|
45
|
-
return { ...ref, controlDependencies: (ref.controlDependencies ?? []).concat(defaultCd ? [defaultCd] : []) };
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
else {
|
|
49
|
-
return { ...ref, controlDependencies: ref.controlDependencies ?? (defaultCd ? [defaultCd] : []) };
|
|
50
|
-
}
|
|
51
|
-
return ref;
|
|
52
|
-
}
|
|
53
6
|
/**
|
|
54
|
-
*
|
|
7
|
+
* Provides an environment structure similar to R.
|
|
8
|
+
* This allows the dataflow to hold current definition locations for variables, based on the current scope.
|
|
9
|
+
* @module
|
|
55
10
|
*/
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
11
|
+
const json_1 = require("../../util/json");
|
|
12
|
+
const assert_1 = require("../../util/assert");
|
|
13
|
+
const info_1 = require("../info");
|
|
14
|
+
const define_1 = require("./define");
|
|
15
|
+
const append_1 = require("./append");
|
|
59
16
|
/**
|
|
60
17
|
* Please use this function only if you do not know the object type.
|
|
61
18
|
* Otherwise, rely on {@link IEnvironment#builtInEnv}
|
|
@@ -69,6 +26,7 @@ class Environment {
|
|
|
69
26
|
id;
|
|
70
27
|
parent;
|
|
71
28
|
memory;
|
|
29
|
+
cache;
|
|
72
30
|
builtInEnv;
|
|
73
31
|
constructor(parent, isBuiltInDefault = undefined) {
|
|
74
32
|
this.id = isBuiltInDefault ? 0 : environmentIdCounter++;
|
|
@@ -79,19 +37,186 @@ class Environment {
|
|
|
79
37
|
this.builtInEnv = isBuiltInDefault;
|
|
80
38
|
}
|
|
81
39
|
}
|
|
40
|
+
/**
|
|
41
|
+
* Create a deep clone of this environment.
|
|
42
|
+
* @param recurseParents - Whether to also clone parent environments
|
|
43
|
+
*/
|
|
44
|
+
clone(recurseParents) {
|
|
45
|
+
if (this.builtInEnv) {
|
|
46
|
+
return this; // do not clone the built-in environment
|
|
47
|
+
}
|
|
48
|
+
const parent = recurseParents ? this.parent.clone(recurseParents) : this.parent;
|
|
49
|
+
const clone = new Environment(parent, this.builtInEnv);
|
|
50
|
+
clone.memory = new Map(this.memory.entries()
|
|
51
|
+
.map(([k, v]) => [k,
|
|
52
|
+
v.map(s => ({
|
|
53
|
+
...s,
|
|
54
|
+
controlDependencies: s.controlDependencies?.slice()
|
|
55
|
+
}))
|
|
56
|
+
]));
|
|
57
|
+
return clone;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Define a new identifier definition within this environment.
|
|
61
|
+
* @param definition - The definition to add.
|
|
62
|
+
* @param config - The flowr configuration options.
|
|
63
|
+
*/
|
|
64
|
+
define(definition, { solver: { pointerTracking } }) {
|
|
65
|
+
const { name } = definition;
|
|
66
|
+
const newEnvironment = this.clone(false);
|
|
67
|
+
// When there are defined indices, merge the definitions
|
|
68
|
+
if (definition.controlDependencies === undefined && !pointerTracking) {
|
|
69
|
+
newEnvironment.memory.set(name, [definition]);
|
|
70
|
+
}
|
|
71
|
+
else {
|
|
72
|
+
const existing = newEnvironment.memory.get(name);
|
|
73
|
+
const inGraphDefinition = definition;
|
|
74
|
+
if (pointerTracking &&
|
|
75
|
+
existing !== undefined &&
|
|
76
|
+
inGraphDefinition.controlDependencies === undefined) {
|
|
77
|
+
if (inGraphDefinition.indicesCollection !== undefined) {
|
|
78
|
+
const defs = (0, define_1.mergeDefinitionsForPointer)(existing, inGraphDefinition);
|
|
79
|
+
newEnvironment.memory.set(name, defs);
|
|
80
|
+
}
|
|
81
|
+
else if (existing?.flatMap(i => i.indicesCollection ?? []).length > 0) {
|
|
82
|
+
// When indices couldn't be resolved, but indices where defined before, just add the definition
|
|
83
|
+
existing.push(definition);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
else if (existing === undefined || definition.controlDependencies === undefined) {
|
|
87
|
+
newEnvironment.memory.set(name, [definition]);
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
existing.push(definition);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
return newEnvironment;
|
|
94
|
+
}
|
|
95
|
+
defineSuper(definition) {
|
|
96
|
+
const { name } = definition;
|
|
97
|
+
const newEnvironment = this.clone(true);
|
|
98
|
+
let current = newEnvironment;
|
|
99
|
+
let last = undefined;
|
|
100
|
+
let found = false;
|
|
101
|
+
do {
|
|
102
|
+
if (current.memory.has(name)) {
|
|
103
|
+
current.memory.set(name, [definition]);
|
|
104
|
+
found = true;
|
|
105
|
+
break;
|
|
106
|
+
}
|
|
107
|
+
last = current;
|
|
108
|
+
current = current.parent;
|
|
109
|
+
} while (!current.builtInEnv);
|
|
110
|
+
if (!found) {
|
|
111
|
+
(0, assert_1.guard)(last !== undefined, () => `Could not find global scope for ${name}`);
|
|
112
|
+
last.memory.set(name, [definition]);
|
|
113
|
+
}
|
|
114
|
+
return newEnvironment;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Assumes, that all definitions within other replace those within this environment (given the same name).
|
|
118
|
+
* <b>But</b> if all definitions within other are maybe, then they are appended to the current definitions (updating them to be `maybe` from now on as well), similar to {@link appendEnvironment}.
|
|
119
|
+
* This always recurses parents.
|
|
120
|
+
*/
|
|
121
|
+
overwrite(other, applyCds) {
|
|
122
|
+
if (!other || this.builtInEnv) {
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
const map = new Map(this.memory);
|
|
126
|
+
for (const [key, values] of other.memory) {
|
|
127
|
+
const hasMaybe = applyCds === undefined ? values.length === 0 || values.some(v => v.controlDependencies !== undefined) : true;
|
|
128
|
+
if (hasMaybe) {
|
|
129
|
+
const old = map.get(key);
|
|
130
|
+
// we need to make a copy to avoid side effects for old reference in other environments
|
|
131
|
+
const updatedOld = old?.slice() ?? [];
|
|
132
|
+
for (const v of values) {
|
|
133
|
+
const index = updatedOld.findIndex(o => o.nodeId === v.nodeId && o.definedAt === v.definedAt);
|
|
134
|
+
if (index >= 0) {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
if (applyCds === undefined) {
|
|
138
|
+
updatedOld.push(v);
|
|
139
|
+
}
|
|
140
|
+
else {
|
|
141
|
+
updatedOld.push({
|
|
142
|
+
...v,
|
|
143
|
+
controlDependencies: v.controlDependencies ? applyCds.concat(v.controlDependencies) : applyCds.slice()
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
map.set(key, updatedOld);
|
|
148
|
+
}
|
|
149
|
+
else {
|
|
150
|
+
map.set(key, values);
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
const out = new Environment(this.parent.overwrite(other.parent, applyCds));
|
|
154
|
+
out.memory = map;
|
|
155
|
+
return out;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Adds all writes of `other` to this environment (i.e., the operations of `other` *might* happen).
|
|
159
|
+
* This always recurses parents.
|
|
160
|
+
*/
|
|
161
|
+
append(other) {
|
|
162
|
+
if (!other || this.builtInEnv) {
|
|
163
|
+
return this;
|
|
164
|
+
}
|
|
165
|
+
const map = new Map(this.memory);
|
|
166
|
+
for (const [key, value] of other.memory) {
|
|
167
|
+
const old = map.get(key);
|
|
168
|
+
if (old) {
|
|
169
|
+
map.set(key, (0, append_1.uniqueMergeValuesInDefinitions)(old, value));
|
|
170
|
+
}
|
|
171
|
+
else {
|
|
172
|
+
map.set(key, value);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
const out = new Environment(this.parent.append(other.parent));
|
|
176
|
+
out.memory = map;
|
|
177
|
+
return out;
|
|
178
|
+
}
|
|
179
|
+
remove(name) {
|
|
180
|
+
if (this.builtInEnv) {
|
|
181
|
+
return this;
|
|
182
|
+
}
|
|
183
|
+
const definition = this.memory.get(name);
|
|
184
|
+
let cont = true;
|
|
185
|
+
if (definition !== undefined) {
|
|
186
|
+
this.memory.delete(name);
|
|
187
|
+
this.cache?.delete(name);
|
|
188
|
+
cont = !definition.every(d => (0, info_1.happensInEveryBranch)(d.controlDependencies));
|
|
189
|
+
}
|
|
190
|
+
if (cont) {
|
|
191
|
+
this.parent.remove(name);
|
|
192
|
+
}
|
|
193
|
+
return this;
|
|
194
|
+
}
|
|
195
|
+
removeAll(names) {
|
|
196
|
+
if (this.builtInEnv || names.length === 0) {
|
|
197
|
+
return this;
|
|
198
|
+
}
|
|
199
|
+
const newEnv = this.clone(true);
|
|
200
|
+
// we should optimize this later
|
|
201
|
+
for (const { name } of names) {
|
|
202
|
+
newEnv.remove(name);
|
|
203
|
+
}
|
|
204
|
+
return newEnv;
|
|
205
|
+
}
|
|
206
|
+
toJSON() {
|
|
207
|
+
return this.builtInEnv ? {
|
|
208
|
+
id: this.id,
|
|
209
|
+
parent: this.parent,
|
|
210
|
+
builtInEnv: this.builtInEnv,
|
|
211
|
+
memory: this.memory,
|
|
212
|
+
} : {
|
|
213
|
+
id: this.id,
|
|
214
|
+
parent: this.parent,
|
|
215
|
+
memory: this.memory,
|
|
216
|
+
};
|
|
217
|
+
}
|
|
82
218
|
}
|
|
83
219
|
exports.Environment = Environment;
|
|
84
|
-
/**
|
|
85
|
-
* Initialize a new {@link REnvironmentInformation|environment} with the built-ins.
|
|
86
|
-
*/
|
|
87
|
-
function initializeCleanEnvironments(memory, fullBuiltIns = true) {
|
|
88
|
-
const builtInEnv = new Environment(undefined, true);
|
|
89
|
-
builtInEnv.memory = memory ?? (fullBuiltIns ? (0, built_in_config_1.getDefaultBuiltInDefinitions)().builtInMemory : (0, built_in_config_1.getDefaultBuiltInDefinitions)().emptyBuiltInMemory);
|
|
90
|
-
return {
|
|
91
|
-
current: new Environment(builtInEnv),
|
|
92
|
-
level: 0
|
|
93
|
-
};
|
|
94
|
-
}
|
|
95
220
|
/**
|
|
96
221
|
* Helps to serialize an environment, but replaces the built-in environment with a placeholder.
|
|
97
222
|
*/
|
|
@@ -2,53 +2,10 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.overwriteEnvironment = overwriteEnvironment;
|
|
4
4
|
const assert_1 = require("../../util/assert");
|
|
5
|
-
const environment_1 = require("./environment");
|
|
6
|
-
function anyIsMaybeOrEmpty(values) {
|
|
7
|
-
return values.length === 0 || values.some(v => v.controlDependencies !== undefined);
|
|
8
|
-
}
|
|
9
|
-
function overwriteIEnvironmentWith(base, next, includeParent = true, applyCds) {
|
|
10
|
-
(0, assert_1.guard)(base !== undefined && next !== undefined, 'can not overwrite environments with undefined');
|
|
11
|
-
const map = new Map(base.memory);
|
|
12
|
-
for (const [key, values] of next.memory) {
|
|
13
|
-
const hasMaybe = applyCds !== undefined ? true : anyIsMaybeOrEmpty(values);
|
|
14
|
-
if (hasMaybe) {
|
|
15
|
-
const old = map.get(key);
|
|
16
|
-
// we need to make a copy to avoid side effects for old reference in other environments
|
|
17
|
-
const updatedOld = old?.slice() ?? [];
|
|
18
|
-
for (const v of values) {
|
|
19
|
-
const index = updatedOld.findIndex(o => o.nodeId === v.nodeId && o.definedAt === v.definedAt);
|
|
20
|
-
if (index < 0) {
|
|
21
|
-
if (applyCds !== undefined) {
|
|
22
|
-
updatedOld.push({
|
|
23
|
-
...v,
|
|
24
|
-
controlDependencies: v.controlDependencies ? applyCds.concat(v.controlDependencies) : applyCds.slice()
|
|
25
|
-
});
|
|
26
|
-
}
|
|
27
|
-
else {
|
|
28
|
-
updatedOld.push(v);
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
map.set(key, updatedOld);
|
|
33
|
-
}
|
|
34
|
-
else {
|
|
35
|
-
map.set(key, values);
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
let parent;
|
|
39
|
-
if (includeParent) {
|
|
40
|
-
parent = base.parent.builtInEnv ? base.parent : overwriteIEnvironmentWith(base.parent, next.parent, includeParent, applyCds);
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
parent = base.parent;
|
|
44
|
-
}
|
|
45
|
-
const out = new environment_1.Environment(parent);
|
|
46
|
-
out.memory = map;
|
|
47
|
-
return out;
|
|
48
|
-
}
|
|
49
5
|
/**
|
|
50
6
|
* Assumes, that all definitions within next replace those within base (given the same name).
|
|
51
7
|
* <b>But</b> if all definitions within next are maybe, then they are appended to the base definitions (updating them to be `maybe` from now on as well), similar to {@link appendEnvironment}.
|
|
8
|
+
* @see {@link Environment.overwrite} - for details on how definitions are handled.
|
|
52
9
|
*/
|
|
53
10
|
function overwriteEnvironment(base, next, applyCds) {
|
|
54
11
|
if (base === undefined) {
|
|
@@ -59,7 +16,7 @@ function overwriteEnvironment(base, next, applyCds) {
|
|
|
59
16
|
}
|
|
60
17
|
(0, assert_1.guard)(next.level === base.level, `cannot overwrite environments with differently nested local scopes, base ${base.level} vs. next ${next.level}. This should not happen.`);
|
|
61
18
|
return {
|
|
62
|
-
current:
|
|
19
|
+
current: base.current.overwrite(next.current, applyCds),
|
|
63
20
|
level: base.level
|
|
64
21
|
};
|
|
65
22
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { IdentifierReference } from './identifier';
|
|
2
|
+
import type { DataflowGraph } from '../graph/graph';
|
|
3
|
+
import type { ControlDependency } from '../info';
|
|
4
|
+
import type { REnvironmentInformation } from './environment';
|
|
5
|
+
/**
|
|
6
|
+
* Marks the reference as maybe (i.e., as controlled by a set of {@link IdentifierReference#controlDependencies|control dependencies}).
|
|
7
|
+
*/
|
|
8
|
+
export declare function makeReferenceMaybe(ref: IdentifierReference, graph: DataflowGraph, environments: REnvironmentInformation, includeDefs: boolean, defaultCd?: ControlDependency | undefined): IdentifierReference;
|
|
9
|
+
/**
|
|
10
|
+
* Marks all references as maybe (i.e., as controlled by a set of {@link IdentifierReference#controlDependencies|control dependencies}).
|
|
11
|
+
* @see {@link makeReferenceMaybe}
|
|
12
|
+
*/
|
|
13
|
+
export declare function makeAllMaybe(references: readonly IdentifierReference[] | undefined, graph: DataflowGraph, environments: REnvironmentInformation, includeDefs: boolean, defaultCd?: ControlDependency | undefined): IdentifierReference[];
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeReferenceMaybe = makeReferenceMaybe;
|
|
4
|
+
exports.makeAllMaybe = makeAllMaybe;
|
|
5
|
+
const identifier_1 = require("./identifier");
|
|
6
|
+
const resolve_by_name_1 = require("./resolve-by-name");
|
|
7
|
+
/**
|
|
8
|
+
* Marks the reference as maybe (i.e., as controlled by a set of {@link IdentifierReference#controlDependencies|control dependencies}).
|
|
9
|
+
*/
|
|
10
|
+
function makeReferenceMaybe(ref, graph, environments, includeDefs, defaultCd = undefined) {
|
|
11
|
+
if (includeDefs) {
|
|
12
|
+
const definitions = ref.name ? (0, resolve_by_name_1.resolveByName)(ref.name, environments, ref.type) : undefined;
|
|
13
|
+
for (const definition of definitions ?? []) {
|
|
14
|
+
if (definition.type !== identifier_1.ReferenceType.BuiltInFunction && definition.type !== identifier_1.ReferenceType.BuiltInConstant) {
|
|
15
|
+
if (definition.controlDependencies) {
|
|
16
|
+
if (defaultCd && !definition.controlDependencies.find(c => c.id === defaultCd.id && c.when === defaultCd.when)) {
|
|
17
|
+
definition.controlDependencies.push(defaultCd);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
else {
|
|
21
|
+
definition.controlDependencies = defaultCd ? [defaultCd] : [];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
const node = graph.getVertex(ref.nodeId, true);
|
|
27
|
+
if (node) {
|
|
28
|
+
if (node.cds) {
|
|
29
|
+
if (defaultCd && !node.cds.find(c => c.id === defaultCd.id && c.when === defaultCd.when)) {
|
|
30
|
+
node.cds.push(defaultCd);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
node.cds = defaultCd ? [defaultCd] : [];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
if (ref.controlDependencies) {
|
|
38
|
+
if (defaultCd && !ref.controlDependencies.find(c => c.id === defaultCd.id && c.when === defaultCd.when)) {
|
|
39
|
+
return { ...ref, controlDependencies: (ref.controlDependencies ?? []).concat(defaultCd ? [defaultCd] : []) };
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
return { ...ref, controlDependencies: ref.controlDependencies ?? (defaultCd ? [defaultCd] : []) };
|
|
44
|
+
}
|
|
45
|
+
return ref;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Marks all references as maybe (i.e., as controlled by a set of {@link IdentifierReference#controlDependencies|control dependencies}).
|
|
49
|
+
* @see {@link makeReferenceMaybe}
|
|
50
|
+
*/
|
|
51
|
+
function makeAllMaybe(references, graph, environments, includeDefs, defaultCd = undefined) {
|
|
52
|
+
return references?.map(ref => makeReferenceMaybe(ref, graph, environments, includeDefs, defaultCd)) ?? [];
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=reference-to-maybe.js.map
|
|
@@ -3,13 +3,18 @@ import { Ternary } from '../../util/logic';
|
|
|
3
3
|
import { type Identifier, type IdentifierDefinition, ReferenceType } from './identifier';
|
|
4
4
|
/**
|
|
5
5
|
* Resolves a given identifier name to a list of its possible definition location using R scoping and resolving rules.
|
|
6
|
+
* If the type you want to reference is unknown, please use {@link resolveByNameAnyType} instead.
|
|
6
7
|
* @param name - The name of the identifier to resolve
|
|
7
8
|
* @param environment - The current environment used for name resolution
|
|
8
9
|
* @param target - The target (meta) type of the identifier to resolve
|
|
9
10
|
* @returns A list of possible identifier definitions (one if the definition location is exactly and always known), or `undefined`
|
|
10
11
|
* if the identifier is undefined in the current scope/with the current environment information.
|
|
11
12
|
*/
|
|
12
|
-
export declare function resolveByName(name: Identifier, environment: REnvironmentInformation, target
|
|
13
|
+
export declare function resolveByName(name: Identifier, environment: REnvironmentInformation, target: ReferenceType): IdentifierDefinition[] | undefined;
|
|
14
|
+
/**
|
|
15
|
+
* The more performant version of {@link resolveByName} when the target type is unknown.
|
|
16
|
+
*/
|
|
17
|
+
export declare function resolveByNameAnyType(name: Identifier, environment: REnvironmentInformation): IdentifierDefinition[] | undefined;
|
|
13
18
|
/**
|
|
14
19
|
*
|
|
15
20
|
*/
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.resolveByName = resolveByName;
|
|
4
|
+
exports.resolveByNameAnyType = resolveByNameAnyType;
|
|
4
5
|
exports.resolvesToBuiltInConstant = resolvesToBuiltInConstant;
|
|
5
6
|
const logic_1 = require("../../util/logic");
|
|
6
7
|
const identifier_1 = require("./identifier");
|
|
@@ -22,26 +23,34 @@ const TargetTypePredicate = {
|
|
|
22
23
|
};
|
|
23
24
|
/**
|
|
24
25
|
* Resolves a given identifier name to a list of its possible definition location using R scoping and resolving rules.
|
|
26
|
+
* If the type you want to reference is unknown, please use {@link resolveByNameAnyType} instead.
|
|
25
27
|
* @param name - The name of the identifier to resolve
|
|
26
28
|
* @param environment - The current environment used for name resolution
|
|
27
29
|
* @param target - The target (meta) type of the identifier to resolve
|
|
28
30
|
* @returns A list of possible identifier definitions (one if the definition location is exactly and always known), or `undefined`
|
|
29
31
|
* if the identifier is undefined in the current scope/with the current environment information.
|
|
30
32
|
*/
|
|
31
|
-
function resolveByName(name, environment, target
|
|
33
|
+
function resolveByName(name, environment, target) {
|
|
34
|
+
if (target === identifier_1.ReferenceType.Unknown) {
|
|
35
|
+
return resolveByNameAnyType(name, environment);
|
|
36
|
+
}
|
|
32
37
|
let current = environment.current;
|
|
33
38
|
let definitions = undefined;
|
|
34
39
|
const wantedType = TargetTypePredicate[target];
|
|
35
40
|
do {
|
|
36
41
|
const definition = current.memory.get(name);
|
|
37
42
|
if (definition !== undefined) {
|
|
38
|
-
const filtered =
|
|
43
|
+
const filtered = definition.filter(wantedType);
|
|
39
44
|
if (filtered.length === definition.length && definition.every(d => (0, info_1.happensInEveryBranch)(d.controlDependencies))) {
|
|
40
45
|
return definition;
|
|
41
46
|
}
|
|
42
47
|
else if (filtered.length > 0) {
|
|
43
|
-
definitions
|
|
44
|
-
|
|
48
|
+
if (definitions) {
|
|
49
|
+
definitions = definitions.concat(filtered);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
definitions = filtered;
|
|
53
|
+
}
|
|
45
54
|
}
|
|
46
55
|
}
|
|
47
56
|
current = current.parent;
|
|
@@ -54,6 +63,49 @@ function resolveByName(name, environment, target = identifier_1.ReferenceType.Un
|
|
|
54
63
|
return builtIns;
|
|
55
64
|
}
|
|
56
65
|
}
|
|
66
|
+
/**
|
|
67
|
+
* The more performant version of {@link resolveByName} when the target type is unknown.
|
|
68
|
+
*/
|
|
69
|
+
function resolveByNameAnyType(name, environment) {
|
|
70
|
+
let current = environment.current;
|
|
71
|
+
const g = current.cache?.get(name);
|
|
72
|
+
if (g !== undefined) {
|
|
73
|
+
return g;
|
|
74
|
+
}
|
|
75
|
+
let definitions = undefined;
|
|
76
|
+
do {
|
|
77
|
+
const definition = current.memory.get(name);
|
|
78
|
+
if (definition) {
|
|
79
|
+
if (definition.every(d => (0, info_1.happensInEveryBranch)(d.controlDependencies))) {
|
|
80
|
+
environment.current.cache ??= new Map();
|
|
81
|
+
environment.current.cache?.set(name, definition);
|
|
82
|
+
return definition;
|
|
83
|
+
}
|
|
84
|
+
else if (definition.length > 0) {
|
|
85
|
+
if (definitions) {
|
|
86
|
+
definitions = definitions.concat(definition);
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
definitions = definition;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
current = current.parent;
|
|
94
|
+
} while (!current.builtInEnv);
|
|
95
|
+
const builtIns = current.memory.get(name);
|
|
96
|
+
let ret;
|
|
97
|
+
if (definitions) {
|
|
98
|
+
ret = builtIns === undefined ? definitions : definitions.concat(builtIns);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
ret = builtIns;
|
|
102
|
+
}
|
|
103
|
+
if (ret) {
|
|
104
|
+
environment.current.cache ??= new Map();
|
|
105
|
+
environment.current.cache?.set(name, ret);
|
|
106
|
+
}
|
|
107
|
+
return ret;
|
|
108
|
+
}
|
|
57
109
|
/**
|
|
58
110
|
*
|
|
59
111
|
*/
|
|
@@ -3,9 +3,9 @@ import { type REnvironmentInformation } from './environment';
|
|
|
3
3
|
* Add a new local environment scope to the stack, returns the modified variant - sharing the original environments in the stack (no deep-clone)
|
|
4
4
|
* @see {@link popLocalEnvironment} - to remove the local scope again
|
|
5
5
|
*/
|
|
6
|
-
export declare function pushLocalEnvironment(
|
|
6
|
+
export declare function pushLocalEnvironment({ level, current }: REnvironmentInformation): REnvironmentInformation;
|
|
7
7
|
/**
|
|
8
8
|
* Remove the top local environment scope from the stack, returns the modified variant - sharing the original environments in the stack (no deep-clone)
|
|
9
9
|
* @see {@link pushLocalEnvironment} - to add a local scope
|
|
10
10
|
*/
|
|
11
|
-
export declare function popLocalEnvironment(
|
|
11
|
+
export declare function popLocalEnvironment({ current, level }: REnvironmentInformation): REnvironmentInformation;
|