mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-13 09:05:00 +00:00
fix: add USE_TREE_LIST_FIRST_SET
This commit is contained in:
parent
45eea57115
commit
d0b310fc93
@ -78,7 +78,9 @@ fn use_tree(p: &mut Parser<'_>, top_level: bool) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(super) const USE_TREE_LIST_RECOVERY_SET: TokenSet =
|
pub(super) const USE_TREE_LIST_RECOVERY_SET: TokenSet =
|
||||||
TokenSet::new(&[T![;], T![,], T![.], T![ident]]);
|
TokenSet::new(&[T![;], T![,], T![.], T![ident]]).union(ITEM_RECOVERY_SET);
|
||||||
|
|
||||||
|
pub(super) const USE_TREE_LIST_FIRST_SET: TokenSet = TokenSet::new(&[T!['{'], T![ident]]);
|
||||||
|
|
||||||
// test use_tree_list
|
// test use_tree_list
|
||||||
// use {a, b, c};
|
// use {a, b, c};
|
||||||
@ -91,7 +93,7 @@ pub(crate) fn use_tree_list(p: &mut Parser<'_>) {
|
|||||||
// use b;
|
// use b;
|
||||||
// struct T;
|
// struct T;
|
||||||
// fn test() {}
|
// fn test() {}
|
||||||
delimited(p, T!['{'], T!['}'], T![,], USE_TREE_LIST_RECOVERY_SET, |p: &mut Parser<'_>| {
|
delimited(p, T!['{'], T!['}'], T![,], USE_TREE_LIST_FIRST_SET, |p: &mut Parser<'_>| {
|
||||||
use_tree(p, false) || p.at_ts(USE_TREE_LIST_RECOVERY_SET)
|
use_tree(p, false) || p.at_ts(USE_TREE_LIST_RECOVERY_SET)
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user