Replace parents statement stack with a Nodes abstraction (#4233)

This commit is contained in:
Charlie Marsh 2023-05-06 12:12:41 -04:00 committed by GitHub
parent 2c91412321
commit c1f0661225
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 362 additions and 279 deletions

View file

@ -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)>,