about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser.rs
diff options
context:
space:
mode:
authorJeffrey Seyfried <jeffrey.seyfried@gmail.com>2017-03-08 23:13:35 +0000
committerJeffrey Seyfried <jeffrey.seyfried@gmail.com>2017-03-14 04:39:21 +0000
commit839c2860ccb7cd3d381abf2838dfba566f52618e (patch)
treede9b57f15703328322a174cb820ba1e97bd29bba /src/libsyntax/parse/parser.rs
parent68c1cc68b44bb987ec57251bc457a55292515d1d (diff)
downloadrust-839c2860ccb7cd3d381abf2838dfba566f52618e.tar.gz
rust-839c2860ccb7cd3d381abf2838dfba566f52618e.zip
Liberalize attributes.
Diffstat (limited to 'src/libsyntax/parse/parser.rs')
-rw-r--r--src/libsyntax/parse/parser.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs
index ed512b89987..308876fed56 100644
--- a/src/libsyntax/parse/parser.rs
+++ b/src/libsyntax/parse/parser.rs
@@ -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>>)