add is_blocklike func on BlockLike

This commit is contained in:
XFFXFF 2023-03-07 08:24:05 +08:00
parent 98990affe5
commit 6e97527eae
3 changed files with 14 additions and 17 deletions

View file

@ -198,6 +198,10 @@ impl BlockLike {
fn is_block(self) -> bool {
self == BlockLike::Block
}
fn is_blocklike(kind: SyntaxKind) -> bool {
matches!(kind, BLOCK_EXPR | IF_EXPR | WHILE_EXPR | FOR_EXPR | LOOP_EXPR | MATCH_EXPR)
}
}
const VISIBILITY_FIRST: TokenSet = TokenSet::new(&[T![pub], T![crate]]);