mirror of
https://github.com/astral-sh/ruff.git
synced 2025-08-24 04:14:22 +00:00
Replace parents
statement stack with a Nodes
abstraction (#4233)
This commit is contained in:
parent
2c91412321
commit
c1f0661225
22 changed files with 362 additions and 279 deletions
|
@ -5,8 +5,6 @@ use bitflags::bitflags;
|
|||
use ruff_text_size::TextRange;
|
||||
use rustpython_parser::ast::Stmt;
|
||||
|
||||
use ruff_python_ast::types::RefEquality;
|
||||
|
||||
use crate::scope::ScopeId;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
|
@ -16,7 +14,7 @@ pub struct Binding<'a> {
|
|||
/// The context in which the binding was created.
|
||||
pub context: ExecutionContext,
|
||||
/// The statement in which the [`Binding`] was defined.
|
||||
pub source: Option<RefEquality<'a, Stmt>>,
|
||||
pub source: Option<&'a Stmt>,
|
||||
/// Tuple of (scope index, range) indicating the scope and range at which
|
||||
/// the binding was last used in a runtime context.
|
||||
pub runtime_usage: Option<(ScopeId, TextRange)>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue