pub struct Scopes { /* private fields */ }Expand description
Every scope, binding and reference in a program. See the module docs.
Implementations§
Source§impl Scopes
impl Scopes
pub fn scope(&self, id: ScopeId) -> &Scope
pub fn binding(&self, id: BindingId) -> &Binding
pub fn bindings(&self) -> &[Binding]
Sourcepub fn references(&self) -> &[Reference]
pub fn references(&self) -> &[Reference]
Every reference, in source order.
Sourcepub fn reference(&self, node: NodeId) -> Option<&Reference>
pub fn reference(&self, node: NodeId) -> Option<&Reference>
The reference node is, if it’s an IdentifierReference.
Sourcepub fn declaration(&self, node: NodeId) -> Option<BindingId>
pub fn declaration(&self, node: NodeId) -> Option<BindingId>
The binding node declares, if it’s a binding identifier.
Sourcepub fn lookup(&self, scope: ScopeId, name: &str) -> Option<BindingId>
pub fn lookup(&self, scope: ScopeId, name: &str) -> Option<BindingId>
The binding a reference to name in scope would resolve to.
Sourcepub fn free_names(&self) -> &[String]
pub fn free_names(&self) -> &[String]
The names references use that nothing in the program declares, each once, in the order they first appear.
Sourcepub fn diagnostics(&self) -> &[Diagnostic]
pub fn diagnostics(&self) -> &[Diagnostic]
Names declared twice, or both lexically and with var, where the
spec makes that an early error.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Scopes
impl Freeze for Scopes
impl Move for Scopes
impl RefUnwindSafe for Scopes
impl Send for Scopes
impl Sync for Scopes
impl Unpin for Scopes
impl UnsafeUnpin for Scopes
impl UnwindSafe for Scopes
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