1
Fork 0

Support nested use closures

This commit is contained in:
Santiago Pastorino 2025-02-10 18:09:31 -03:00
parent 4cbca777ea
commit 38b4746d82
No known key found for this signature in database
GPG key ID: 8131A24E0C79EFAF
2 changed files with 23 additions and 1 deletions

View file

@ -209,7 +209,9 @@ impl<'a> Parser<'a> {
let check_pub = def == &Defaultness::Final;
let mut def_ = || mem::replace(def, Defaultness::Final);
let info = if self.eat_keyword_case(exp!(Use), case) {
let info = if !self.look_ahead(1, |t| [token::OrOr, token::Or].contains(&t.kind))
&& self.eat_keyword_case(exp!(Use), case)
{
self.parse_use_item()?
} else if self.check_fn_front_matter(check_pub, case) {
// FUNCTION ITEM