LexicalScopeSequence
public struct LexicalScopeSequence : IteratorProtocol, Sequence
A sequence of lexical scopes, from inner to outer.
-
Declaration
Swift
public typealias Element = AnyScopeID -
A map from scope to its parent scope.
Declaration
Swift
private let scopeToParent: ASTProperty<AnyScopeID> -
The next scope returned by
next().Declaration
Swift
private var nextScope: AnyScopeID? -
Creates an instance iterating over
sand its ancestors, reading scope relationships fromscopeToParent.Declaration
Swift
init<S>(scopeToParent: ASTProperty<AnyScopeID>, from s: S) where S : ScopeID -
Advances to the next scope and returns it, or
nilif no next scope exists.Declaration
Swift
public mutating func next() -> AnyScopeID? -
Returns first scope in the sequence that has type
s, ornilif no such scope exists.Declaration
Swift
public func first<S>(_ s: S.Type) -> S.ID? where S : LexicalScope, S : Node
View on GitHub