PlaceholderStack class final
A stack of binding frames implementing lexical, shadowing scope.
Starts with a single root frame. push opens a child frame; bind always writes to the current (top) frame; lookup / has walk top→root so a child binding shadows a same-named parent one; pop discards the top frame and restores the parent's view.
Constructors
- PlaceholderStack()
- Creates a stack with a single, empty root frame.
Properties
Methods
-
bind(
String name, Object? value) → void -
Binds
nametovaluein the current (top) frame, shadowing any same-named binding in a parent frame for as long as this frame lives. -
bindAll(
Map< String, Object?> values) → void -
Binds every entry of
valuesin the current (top) frame. -
flatten(
) → Map< String, Object?> -
The whole chain flattened into one map, with child frames winning on
name collisions — the binding view a
${{ … }}expression sees. -
has(
String name) → bool -
Whether any frame currently binds
name. -
lookup(
String name) → Object? -
The value bound to
namein the nearest enclosing frame, ornullwhen no frame binds it. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
pop(
) → void - Pops and discards the top frame, restoring the parent's bindings.
-
push(
[Map< String, Object?> ? initial]) → void -
Pushes a new child frame, optionally seeded with
initialbindings. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited