Liberalize attributes.

This commit is contained in:
Jeffrey Seyfried 2017-03-08 23:13:35 +00:00
parent 68c1cc68b4
commit 839c2860cc
17 changed files with 257 additions and 172 deletions

View file

@ -2644,6 +2644,17 @@ impl<'a> Parser<'a> {
Ok(tts)
}
pub fn parse_tokens(&mut self) -> TokenStream {
let mut result = Vec::new();
loop {
match self.token {
token::Eof | token::CloseDelim(..) => break,
_ => result.push(self.parse_token_tree().into()),
}
}
TokenStream::concat(result)
}
/// Parse a prefix-unary-operator expr
pub fn parse_prefix_expr(&mut self,
already_parsed_attrs: Option<ThinVec<Attribute>>)