pub struct RenameTable {
pub(crate) parent: Option<Box<RenameTable>>,
names: IndexMap<Symbol, Symbol>,
ids: IndexMap<Symbol, NodeID>,
}
Expand description
RenameTable
tracks the names assigned by static single assignment in a single scope.
Fields§
§parent: Option<Box<RenameTable>>
The RenameTable
of the parent scope.
names: IndexMap<Symbol, Symbol>
The mapping from names in the original AST to new names in the renamed AST.
ids: IndexMap<Symbol, NodeID>
The mapping from symbols to node IDs.
These are used to ensure that newly introduced symbols reference the appropriate information
that has been previously indexed by node ID. e,g. TypeTable
.
Implementations§
Source§impl RenameTable
impl RenameTable
Sourcepub(crate) fn new(parent: Option<Box<RenameTable>>) -> Self
pub(crate) fn new(parent: Option<Box<RenameTable>>) -> Self
Create a new RenameTable
with the given parent.
Sourcepub(crate) fn local_names(&self) -> impl Iterator<Item = &Symbol>
pub(crate) fn local_names(&self) -> impl Iterator<Item = &Symbol>
Returns the symbols that were renamed in the current scope.
Sourcepub(crate) fn update(&mut self, symbol: Symbol, new_symbol: Symbol, id: NodeID)
pub(crate) fn update(&mut self, symbol: Symbol, new_symbol: Symbol, id: NodeID)
Updates self.mapping
with the desired entry.
Creates a new entry if symbol
is not already in self.mapping
.
Trait Implementations§
Source§impl Clone for RenameTable
impl Clone for RenameTable
Source§fn clone(&self) -> RenameTable
fn clone(&self) -> RenameTable
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for RenameTable
impl Debug for RenameTable
Source§impl Default for RenameTable
impl Default for RenameTable
Source§fn default() -> RenameTable
fn default() -> RenameTable
Returns the “default value” for a type. Read more
Source§impl PartialEq for RenameTable
impl PartialEq for RenameTable
impl Eq for RenameTable
impl StructuralPartialEq for RenameTable
Auto Trait Implementations§
impl Freeze for RenameTable
impl RefUnwindSafe for RenameTable
impl Send for RenameTable
impl Sync for RenameTable
impl Unpin for RenameTable
impl UnwindSafe for RenameTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more