mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-04 10:48:32 +00:00
Preserve trailing statement semicolons when using fmt: skip
(#8273)
This commit is contained in:
parent
e799f90782
commit
2c84f911c4
5 changed files with 85 additions and 3 deletions
|
@ -473,7 +473,7 @@ pub enum SimpleTokenKind {
|
|||
}
|
||||
|
||||
impl SimpleTokenKind {
|
||||
const fn is_trivia(self) -> bool {
|
||||
pub const fn is_trivia(self) -> bool {
|
||||
matches!(
|
||||
self,
|
||||
SimpleTokenKind::Whitespace
|
||||
|
@ -482,6 +482,10 @@ impl SimpleTokenKind {
|
|||
| SimpleTokenKind::Continuation
|
||||
)
|
||||
}
|
||||
|
||||
pub const fn is_comment(self) -> bool {
|
||||
matches!(self, SimpleTokenKind::Comment)
|
||||
}
|
||||
}
|
||||
|
||||
/// Simple zero allocation tokenizer handling most tokens.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue