Skip to content

Commit

Permalink
Add a closing parenthesis to the span of Visibility::Crate
Browse files Browse the repository at this point in the history
  • Loading branch information
topecongiro committed Feb 17, 2018
1 parent b298607 commit 01a70c6
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/libsyntax/parse/parser.rs
Expand Up @@ -5702,8 +5702,8 @@ impl<'a> Parser<'a> {
// `pub(crate)`
self.bump(); // `(`
self.bump(); // `crate`
let vis = Visibility::Crate(self.prev_span, CrateSugar::PubCrate);
self.expect(&token::CloseDelim(token::Paren))?; // `)`
let vis = Visibility::Crate(self.prev_span, CrateSugar::PubCrate);
return Ok(vis)
} else if self.look_ahead(1, |t| t.is_keyword(keywords::In)) {
// `pub(in path)`
Expand All @@ -5715,7 +5715,8 @@ impl<'a> Parser<'a> {
return Ok(vis)
} else if self.look_ahead(2, |t| t == &token::CloseDelim(token::Paren)) &&
self.look_ahead(1, |t| t.is_keyword(keywords::Super) ||
t.is_keyword(keywords::SelfValue)) {
t.is_keyword(keywords::SelfValue))
{
// `pub(self)` or `pub(super)`
self.bump(); // `(`
let path = self.parse_path(PathStyle::Mod)?.default_to_global(); // `super`/`self`
Expand Down

0 comments on commit 01a70c6

Please sign in to comment.