@@ -32,11 +32,11 @@ class SyntaxIndexInTree {
32
32
33
33
// / Assuming that this index points to the start of \p Raw, advance it so that
34
34
// / it points to the next sibling of \p Raw.
35
- SyntaxIndexInTree advancedBy (const RC< RawSyntax> & Raw) const ;
35
+ SyntaxIndexInTree advancedBy (const RawSyntax * Raw) const ;
36
36
37
37
// / Assuming that this index points to the next sibling of \p Raw, reverse it
38
38
// / so that it points to the start of \p Raw.
39
- SyntaxIndexInTree reversedBy (const RC< RawSyntax> & Raw) const ;
39
+ SyntaxIndexInTree reversedBy (const RawSyntax * Raw) const ;
40
40
41
41
// / Advance this index to point to its first immediate child.
42
42
SyntaxIndexInTree advancedToFirstChild () const ;
@@ -84,14 +84,14 @@ class SyntaxIdentifier {
84
84
85
85
// / Assuming that this identifier points to the start of \p Raw, advance it so
86
86
// / that it points to the next sibling of \p Raw.
87
- SyntaxIdentifier advancedBy (const RC< RawSyntax> & Raw) const {
87
+ SyntaxIdentifier advancedBy (const RawSyntax * Raw) const {
88
88
auto NewIndexInTree = IndexInTree.advancedBy (Raw);
89
89
return SyntaxIdentifier (RootId, NewIndexInTree);
90
90
}
91
91
92
92
// / Assuming that this identifier points to the next sibling of \p Raw,
93
93
// / reverse it so that it points to the start of \p Raw.
94
- SyntaxIdentifier reversedBy (const RC< RawSyntax> & Raw) const {
94
+ SyntaxIdentifier reversedBy (const RawSyntax * Raw) const {
95
95
auto NewIndexInTree = IndexInTree.reversedBy (Raw);
96
96
return SyntaxIdentifier (RootId, NewIndexInTree);
97
97
}
@@ -138,11 +138,11 @@ class AbsoluteSyntaxPosition {
138
138
139
139
// / Assuming that this position points to the start of \p Raw, advance it so
140
140
// / that it points to the next sibling of \p Raw.
141
- AbsoluteSyntaxPosition advancedBy (const RC< RawSyntax> & Raw) const ;
141
+ AbsoluteSyntaxPosition advancedBy (const RawSyntax * Raw) const ;
142
142
143
143
// / Assuming that this position points to the next sibling of \p Raw, reverse
144
144
// / it so that it points to the start of \p Raw.
145
- AbsoluteSyntaxPosition reversedBy (const RC< RawSyntax> & Raw) const ;
145
+ AbsoluteSyntaxPosition reversedBy (const RawSyntax * Raw) const ;
146
146
147
147
// / Get the position of the node's first immediate child.
148
148
AbsoluteSyntaxPosition advancedToFirstChild () const {
@@ -189,15 +189,15 @@ class AbsoluteSyntaxInfo {
189
189
190
190
// / Assuming that this info points to the start of \p Raw, advance it so
191
191
// / that it points to the next sibling of \p Raw.
192
- AbsoluteSyntaxInfo advancedBy (const RC< RawSyntax> & Raw) const {
192
+ AbsoluteSyntaxInfo advancedBy (const RawSyntax * Raw) const {
193
193
auto NewNodeId = NodeId.advancedBy (Raw);
194
194
auto NewPosition = Position.advancedBy (Raw);
195
195
return AbsoluteSyntaxInfo (NewPosition, NewNodeId);
196
196
}
197
197
198
198
// / Assuming that this info points to the next sibling of \p Raw, reverse
199
199
// / it so that it points to the start of \p Raw.
200
- AbsoluteSyntaxInfo reversedBy (const RC< RawSyntax> & Raw) const {
200
+ AbsoluteSyntaxInfo reversedBy (const RawSyntax * Raw) const {
201
201
auto NewNodeId = NodeId.reversedBy (Raw);
202
202
auto NewPosition = Position.reversedBy (Raw);
203
203
return AbsoluteSyntaxInfo (NewPosition, NewNodeId);
@@ -214,20 +214,20 @@ class AbsoluteSyntaxInfo {
214
214
// / A \c RawSyntax node that is enrichted with information of its position
215
215
// / within the syntax tree it lives in.
216
216
struct AbsoluteRawSyntax {
217
- const RC< RawSyntax> Raw;
217
+ const RawSyntax * Raw;
218
218
const AbsoluteSyntaxInfo Info;
219
219
220
220
public:
221
- AbsoluteRawSyntax (const RC< RawSyntax> & Raw, AbsoluteSyntaxInfo Info)
221
+ AbsoluteRawSyntax (const RawSyntax * Raw, AbsoluteSyntaxInfo Info)
222
222
: Raw(Raw), Info(Info) {}
223
223
224
224
// / Construct a \c AbsoluteRawSyntax for a \c RawSyntax node that represents
225
225
// / the syntax tree's root.
226
- static AbsoluteRawSyntax forRoot (const RC< RawSyntax> & Raw) {
226
+ static AbsoluteRawSyntax forRoot (const RawSyntax * Raw) {
227
227
return AbsoluteRawSyntax (Raw, AbsoluteSyntaxInfo::forRoot ());
228
228
}
229
229
230
- const RC< RawSyntax> & getRaw () const { return Raw; }
230
+ const RawSyntax * getRaw () const { return Raw; }
231
231
232
232
AbsoluteSyntaxInfo getInfo () const { return Info; }
233
233
@@ -245,7 +245,7 @@ struct AbsoluteRawSyntax {
245
245
// / - the \p NewRaw as the backing storage
246
246
// / - the \p NewRootId as the RootId
247
247
AbsoluteRawSyntax
248
- replacingSelf (const RC< RawSyntax> & NewRaw,
248
+ replacingSelf (const RawSyntax * NewRaw,
249
249
SyntaxIdentifier::RootIdType NewRootId) const {
250
250
SyntaxIdentifier NewNodeId (NewRootId, Info.getNodeId ().getIndexInTree ());
251
251
AbsoluteSyntaxInfo NewInfo (Info.getPosition (), NewNodeId);
0 commit comments