Environment class

Represents the execution environment for a code context.

The Environment class manages the variable stack and filters used within a code context. It provides methods for pushing and popping scopes, as well as accessing and modifying variables within the current scope.

Constructors

Environment([Map<String, dynamic> data = const {}])
Constructs a new Environment instance with the provided initial data.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

all() Map<String, dynamic>
Returns a map containing all variables in the current context.
call(String key) → dynamic
clear() → void
Clears the variable stack and adds a new global scope.
clone() Environment
Creates a new Environment instance that is a deep copy of the current instance.
getFilter(String name) FilterFunction?
Gets the filter function registered with the given name.
getRoot() Root?
getVariable(String name) → dynamic
Retrieves the value of a variable from the current scope or any parent scopes.
merge(Map<String, dynamic> newData) → void
Merges new data into the current scope.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
popScope() → void
Removes the most recently added scope from the variable stack.
pushScope() → void
Pushes a new scope onto the variable stack.
registerFilter(String name, FilterFunction function) → void
Registers a new filter function with the given name.
setRoot(Root? root) → void
setVariable(String name, dynamic value) → void
Sets a variable in the current scope.
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited