mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-22 03:14:41 +00:00
Misc. small tweaks from perusing modules (#9383)
This commit is contained in:
parent
7b6baff734
commit
0e202718fd
4 changed files with 10 additions and 5 deletions
|
@ -1,7 +1,9 @@
|
|||
use crate::{ElifElseClause, Expr, Stmt, StmtIf};
|
||||
use std::iter;
|
||||
|
||||
use ruff_python_trivia::{SimpleTokenKind, SimpleTokenizer};
|
||||
use ruff_text_size::{Ranged, TextRange};
|
||||
use std::iter;
|
||||
|
||||
use crate::{ElifElseClause, Expr, Stmt, StmtIf};
|
||||
|
||||
/// Return the `Range` of the first `Elif` or `Else` token in an `If` statement.
|
||||
pub fn elif_else_range(clause: &ElifElseClause, contents: &str) -> Option<TextRange> {
|
||||
|
@ -17,11 +19,12 @@ pub enum BranchKind {
|
|||
Elif,
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
pub struct IfElifBranch<'a> {
|
||||
pub kind: BranchKind,
|
||||
pub test: &'a Expr,
|
||||
pub body: &'a [Stmt],
|
||||
pub range: TextRange,
|
||||
range: TextRange,
|
||||
}
|
||||
|
||||
impl Ranged for IfElifBranch<'_> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue