Use NodeId for Binding source (#4234)

This commit is contained in:
Charlie Marsh 2023-05-06 12:20:08 -04:00 committed by GitHub
parent c1f0661225
commit a9fc648faf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 97 additions and 96 deletions

View file

@ -3,8 +3,8 @@ use std::ops::{Deref, Index, IndexMut};
use bitflags::bitflags;
use ruff_text_size::TextRange;
use rustpython_parser::ast::Stmt;
use crate::node::NodeId;
use crate::scope::ScopeId;
#[derive(Debug, Clone)]
@ -14,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<&'a Stmt>,
pub source: Option<NodeId>,
/// 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)>,