Operations on green trees. Lifted into a namespace rather than methods
on GreenNode so the ADT stays minimal data and the operations are
easy to extend without modifying the sealed hierarchy. The
GreenNodeExt extension below forwards to these for ergonomic
node.textLength / node.toSource() call sites.
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
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
textLength<
Tok, Syn> (GreenNode< Tok, Syn> node) → int -
Total source-character length of the subtree rooted at
node, O(1). -
toSource<
Tok, Syn> (GreenNode< Tok, Syn> node) → String -
Reconstruct the original source covered by the subtree rooted at
node. Concatenates GreenToken.text in source-order traversal, skips GreenMissing (zero-width), descends into GreenUnexpected children verbatim.