mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-16 16:40:36 +00:00
Avoid emitting empty logical lines (#4452)
This commit is contained in:
parent
4b05ca1198
commit
7e0d018b35
4 changed files with 45 additions and 5 deletions
|
@ -167,6 +167,11 @@ pub enum TokenKind {
|
|||
}
|
||||
|
||||
impl TokenKind {
|
||||
#[inline]
|
||||
pub const fn is_newline(&self) -> bool {
|
||||
matches!(self, TokenKind::Newline | TokenKind::NonLogicalNewline)
|
||||
}
|
||||
|
||||
#[inline]
|
||||
pub const fn is_unary(&self) -> bool {
|
||||
matches!(self, TokenKind::Plus | TokenKind::Minus | TokenKind::Star)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue