Lines Matching refs:peek
52 //! if lookahead.peek(Token![struct]) {
54 //! } else if lookahead.peek(Token![enum]) {
511 /// Note that this method does not use turbofish syntax. Pass the peek type
514 /// - `input.peek(Token![struct])`
515 /// - `input.peek(Token![==])`
516 /// - `input.peek(syn::Ident)` *(does not accept keywords)*
517 /// - `input.peek(syn::Ident::peek_any)`
518 /// - `input.peek(Lifetime)`
519 /// - `input.peek(token::Brace)`
554 /// if input.peek(Token![where]) || input.peek(token::Brace) {
576 pub fn peek<T: Peek>(&self, token: T) -> bool {
578 T::Token::peek(self.cursor())
588 /// keyword in Rust. We can't use just `peek` and decide to parse a union if
607 /// if input.peek(Token![union]) && input.peek2(Ident) {
616 fn peek2(buffer: &ParseBuffer, peek: fn(Cursor) -> bool) -> bool {
618 if group.0.skip().map_or(false, peek) {
622 buffer.cursor().skip().map_or(false, peek)
626 peek2(self, T::Token::peek)
631 fn peek3(buffer: &ParseBuffer, peek: fn(Cursor) -> bool) -> bool {
633 if group.0.skip().and_then(Cursor::skip).map_or(false, peek) {
641 .map_or(false, peek)
645 peek3(self, T::Token::peek)
822 /// if lookahead.peek(Ident) {
824 /// } else if lookahead.peek(Lifetime) {
826 /// } else if lookahead.peek(Token![const]) {
928 /// if input.peek(token::Paren) {
933 /// if content.peek(Token![crate])
934 /// || content.peek(Token![self])
935 /// || content.peek(Token![super])
945 /// } else if content.peek(Token![in]) {
990 /// if input.peek(Token![while])
991 /// || input.peek(Token![for])
992 /// || input.peek(Token![loop])
1173 if T::peek(input.cursor()) {