@@ -65,8 +65,7 @@ struct EscapeInfo<V: EscapeInfoVisitor> {
65
65
/// The EscapePath is updated and maintained during the up-walk and down-walk.
66
66
///
67
67
/// It's passed to the EscapeInfoVisitor's `visitUse` and `visitDef`.
68
- struct EscapePath : WalkingPath {
69
-
68
+ struct EscapePath : SmallProjectionWalkingPath {
70
69
/// During the walk, a projection path indicates where the initial value is
71
70
/// contained in an aggregate.
72
71
/// Example for a walk-down:
@@ -115,12 +114,16 @@ struct EscapeInfo<V: EscapeInfoVisitor> {
115
114
/// \endcode
116
115
let knownType : Type ?
117
116
117
+ func with( projectionPath: SmallProjectionPath ) -> Self {
118
+ return Self ( projectionPath: projectionPath, followStores: self . followStores, knownType: self . knownType)
119
+ }
120
+
118
121
func with( followStores: Bool ) -> Self {
119
- return Self ( projectionPath: projectionPath, followStores: followStores, knownType: self . knownType)
122
+ return Self ( projectionPath: self . projectionPath, followStores: followStores, knownType: self . knownType)
120
123
}
121
124
122
125
func with( knownType: Type ? ) -> Self {
123
- return Self ( projectionPath: projectionPath, followStores: self . followStores, knownType: knownType)
126
+ return Self ( projectionPath: self . projectionPath, followStores: self . followStores, knownType: knownType)
124
127
}
125
128
126
129
func merge( with other: EscapePath ) -> EscapePath {
@@ -138,25 +141,6 @@ struct EscapeInfo<V: EscapeInfoVisitor> {
138
141
}
139
142
return EscapePath ( projectionPath: mergedPath, followStores: mergedFollowStores, knownType: mergedKnownType)
140
143
}
141
-
142
- // The following push and pop functions simply forward to the projectionPath.
143
-
144
- func pop( kind: FieldKind ) -> ( index: Int , path: Self ) ? {
145
- if let ( idx, p) = projectionPath. pop ( kind: kind) {
146
- return ( idx, EscapePath ( projectionPath: p, followStores: followStores, knownType: knownType) )
147
- }
148
- return nil
149
- }
150
- func popIfMatches( _ kind: FieldKind , index: Int ? ) -> Self ? {
151
- if let p = projectionPath. popIfMatches ( kind, index: index) {
152
- return EscapePath ( projectionPath: p, followStores: followStores, knownType: knownType)
153
- }
154
- return nil
155
- }
156
- func push( _ kind: FieldKind , index: Int ) -> Self {
157
- return EscapePath ( projectionPath: projectionPath. push ( kind, index: index) , followStores: followStores, knownType: knownType)
158
- }
159
-
160
144
}
161
145
162
146
enum DefVisitResult {
0 commit comments