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

depth → int
Number of frames currently on the stack (the root counts as 1).
no setter
hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

bind(String name, Object? value) → void
Binds name to value in 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 values in 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 name in the nearest enclosing frame, or null when 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 initial bindings.
toString() → String
A string representation of this object.
inherited

Operators

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