Attach TokenStream to ast::Path

This commit is contained in:
Aaron Hill 2020-08-21 18:51:23 -04:00
parent 3815e91ccd
commit 55082ce413
No known key found for this signature in database
GPG key ID: B4087E510E98B164
15 changed files with 41 additions and 21 deletions

View file

@ -64,7 +64,7 @@ impl<'a> Parser<'a> {
path_span = path_lo.to(self.prev_token.span);
} else {
path_span = self.token.span.to(self.token.span);
path = ast::Path { segments: Vec::new(), span: path_span };
path = ast::Path { segments: Vec::new(), span: path_span, tokens: None };
}
// See doc comment for `unmatched_angle_bracket_count`.
@ -81,7 +81,10 @@ impl<'a> Parser<'a> {
let qself = QSelf { ty, path_span, position: path.segments.len() };
self.parse_path_segments(&mut path.segments, style)?;
Ok((qself, Path { segments: path.segments, span: lo.to(self.prev_token.span) }))
Ok((
qself,
Path { segments: path.segments, span: lo.to(self.prev_token.span), tokens: None },
))
}
/// Recover from an invalid single colon, when the user likely meant a qualified path.
@ -144,7 +147,7 @@ impl<'a> Parser<'a> {
}
self.parse_path_segments(&mut segments, style)?;
Ok(Path { segments, span: lo.to(self.prev_token.span) })
Ok(Path { segments, span: lo.to(self.prev_token.span), tokens: None })
}
pub(super) fn parse_path_segments(