commit | 3a515a0f91d8afb4b6cb5459ab4a906e16f1990b | [log] [tgz] |
---|---|---|
author | David Tolnay <dtolnay@gmail.com> | Sat Aug 25 21:08:27 2018 -0400 |
committer | David Tolnay <dtolnay@gmail.com> | Sat Aug 25 21:13:24 2018 -0400 |
tree | a12cb70fc4a0a96ba62c36b0f428d19df5acc824 | |
parent | 898bb7466394636226d8c1a522bc1f8a181a35a1 [diff] [blame] |
Implement syn::Variant
diff --git a/src/parse.rs b/src/parse.rs index 2525d8f..cfc0817 100644 --- a/src/parse.rs +++ b/src/parse.rs
@@ -115,6 +115,10 @@ T::parse(self) } + pub fn call<T>(&self, function: fn(ParseStream) -> Result<T>) -> Result<T> { + function(self) + } + pub fn peek<T: Peek>(&self, token: T) -> bool { self.lookahead1().peek(token) }