Lines Matching refs:lookahead
956 let lookahead = ahead.lookahead1(); in parse_rest_of_item() localVariable
958 let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead, allow_safe) { in parse_rest_of_item()
967 } else if lookahead.peek(Token![extern]) { in parse_rest_of_item()
969 let lookahead = ahead.lookahead1(); in parse_rest_of_item() localVariable
970 if lookahead.peek(Token![crate]) { in parse_rest_of_item()
972 } else if lookahead.peek(token::Brace) { in parse_rest_of_item()
974 } else if lookahead.peek(LitStr) { in parse_rest_of_item()
976 let lookahead = ahead.lookahead1(); in parse_rest_of_item() localVariable
977 if lookahead.peek(token::Brace) { in parse_rest_of_item()
980 Err(lookahead.error()) in parse_rest_of_item()
983 Err(lookahead.error()) in parse_rest_of_item()
985 } else if lookahead.peek(Token![use]) { in parse_rest_of_item()
991 } else if lookahead.peek(Token![static]) { in parse_rest_of_item()
1022 } else if lookahead.peek(Token![const]) { in parse_rest_of_item()
1025 let lookahead = input.lookahead1(); in parse_rest_of_item() localVariable
1026 let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) { in parse_rest_of_item()
1029 return Err(lookahead.error()); in parse_rest_of_item()
1061 } else if lookahead.peek(Token![unsafe]) { in parse_rest_of_item()
1063 let lookahead = ahead.lookahead1(); in parse_rest_of_item() localVariable
1064 if lookahead.peek(Token![trait]) in parse_rest_of_item()
1065 || lookahead.peek(Token![auto]) && ahead.peek2(Token![trait]) in parse_rest_of_item()
1068 } else if lookahead.peek(Token![impl]) { in parse_rest_of_item()
1075 } else if lookahead.peek(Token![extern]) { in parse_rest_of_item()
1077 } else if lookahead.peek(Token![mod]) { in parse_rest_of_item()
1080 Err(lookahead.error()) in parse_rest_of_item()
1082 } else if lookahead.peek(Token![mod]) { in parse_rest_of_item()
1084 } else if lookahead.peek(Token![type]) { in parse_rest_of_item()
1086 } else if lookahead.peek(Token![struct]) { in parse_rest_of_item()
1088 } else if lookahead.peek(Token![enum]) { in parse_rest_of_item()
1090 } else if lookahead.peek(Token![union]) && ahead.peek2(Ident) { in parse_rest_of_item()
1092 } else if lookahead.peek(Token![trait]) { in parse_rest_of_item()
1094 } else if lookahead.peek(Token![auto]) && ahead.peek2(Token![trait]) { in parse_rest_of_item()
1096 } else if lookahead.peek(Token![impl]) in parse_rest_of_item()
1097 || lookahead.peek(Token![default]) && !ahead.peek2(Token![!]) in parse_rest_of_item()
1105 } else if lookahead.peek(Token![macro]) { in parse_rest_of_item()
1109 && (lookahead.peek(Ident) in parse_rest_of_item()
1110 || lookahead.peek(Token![self]) in parse_rest_of_item()
1111 || lookahead.peek(Token![super]) in parse_rest_of_item()
1112 || lookahead.peek(Token![crate]) in parse_rest_of_item()
1113 || lookahead.peek(Token![::])) in parse_rest_of_item()
1117 Err(lookahead.error()) in parse_rest_of_item()
1272 let mut lookahead = input.lookahead1(); in parse_macro2() localVariable
1273 if lookahead.peek(token::Paren) { in parse_macro2()
1277 lookahead = input.lookahead1(); in parse_macro2()
1280 if lookahead.peek(token::Brace) { in parse_macro2()
1285 return Err(lookahead.error()); in parse_macro2()
1370 let lookahead = input.lookahead1(); in parse_use_tree() localVariable
1371 if lookahead.peek(Ident) in parse_use_tree()
1372 || lookahead.peek(Token![self]) in parse_use_tree()
1373 || lookahead.peek(Token![super]) in parse_use_tree()
1374 || lookahead.peek(Token![crate]) in parse_use_tree()
1375 || lookahead.peek(Token![try]) in parse_use_tree()
1401 } else if lookahead.peek(Token![*]) { in parse_use_tree()
1405 } else if lookahead.peek(token::Brace) { in parse_use_tree()
1438 Err(lookahead.error()) in parse_use_tree()
1467 let lookahead = input.lookahead1(); in parse() localVariable
1468 let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) { in parse()
1471 return Err(lookahead.error()); in parse()
1779 let lookahead = input.lookahead1(); in parse() localVariable
1780 if lookahead.peek(Token![;]) { in parse()
1790 } else if lookahead.peek(token::Brace) { in parse()
1810 Err(lookahead.error()) in parse()
1848 let lookahead = ahead.lookahead1(); in parse() localVariable
1850 let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead, allow_safe) { in parse()
1874 } else if lookahead.peek(Token![static]) in parse()
1911 } else if lookahead.peek(Token![type]) { in parse()
1914 && (lookahead.peek(Ident) in parse()
1915 || lookahead.peek(Token![self]) in parse()
1916 || lookahead.peek(Token![super]) in parse()
1917 || lookahead.peek(Token![crate]) in parse()
1918 || lookahead.peek(Token![::])) in parse()
1922 Err(lookahead.error()) in parse()
2165 let lookahead = input.lookahead1(); in parse_trait_or_trait_alias() localVariable
2166 if lookahead.peek(token::Brace) in parse_trait_or_trait_alias()
2167 || lookahead.peek(Token![:]) in parse_trait_or_trait_alias()
2168 || lookahead.peek(Token![where]) in parse_trait_or_trait_alias()
2183 } else if lookahead.peek(Token![=]) { in parse_trait_or_trait_alias()
2187 Err(lookahead.error()) in parse_trait_or_trait_alias()
2339 let lookahead = ahead.lookahead1(); in parse() localVariable
2341 let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead, allow_safe) { in parse()
2343 } else if lookahead.peek(Token![const]) { in parse()
2345 let lookahead = ahead.lookahead1(); in parse() localVariable
2346 if lookahead.peek(Ident) || lookahead.peek(Token![_]) { in parse()
2374 } else if lookahead.peek(Token![async]) in parse()
2375 || lookahead.peek(Token![unsafe]) in parse()
2376 || lookahead.peek(Token![extern]) in parse()
2377 || lookahead.peek(Token![fn]) in parse()
2381 Err(lookahead.error()) in parse()
2383 } else if lookahead.peek(Token![type]) { in parse()
2387 && (lookahead.peek(Ident) in parse()
2388 || lookahead.peek(Token![self]) in parse()
2389 || lookahead.peek(Token![super]) in parse()
2390 || lookahead.peek(Token![crate]) in parse()
2391 || lookahead.peek(Token![::])) in parse()
2395 Err(lookahead.error()) in parse()
2422 let lookahead = input.lookahead1(); in parse() localVariable
2423 let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) { in parse()
2426 return Err(lookahead.error()); in parse()
2459 let lookahead = input.lookahead1(); in parse() localVariable
2460 let (brace_token, stmts, semi_token) = if lookahead.peek(token::Brace) { in parse()
2466 } else if lookahead.peek(Token![;]) { in parse()
2470 return Err(lookahead.error()); in parse()
2669 let mut lookahead = ahead.lookahead1(); in parse() localVariable
2670 let defaultness = if lookahead.peek(Token![default]) && !ahead.peek2(Token![!]) { in parse()
2672 lookahead = ahead.lookahead1(); in parse()
2679 let mut item = if lookahead.peek(Token![fn]) || peek_signature(&ahead, allow_safe) { in parse()
2686 } else if lookahead.peek(Token![const]) { in parse()
2689 let lookahead = input.lookahead1(); in parse() localVariable
2690 let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) { in parse()
2693 return Err(lookahead.error()); in parse()
2726 } else if lookahead.peek(Token![type]) { in parse()
2730 && (lookahead.peek(Ident) in parse()
2731 || lookahead.peek(Token![self]) in parse()
2732 || lookahead.peek(Token![super]) in parse()
2733 || lookahead.peek(Token![crate]) in parse()
2734 || lookahead.peek(Token![::])) in parse()
2738 Err(lookahead.error()) in parse()
2765 let lookahead = input.lookahead1(); in parse() localVariable
2766 let ident = if lookahead.peek(Ident) || lookahead.peek(Token![_]) { in parse()
2769 return Err(lookahead.error()); in parse()