pedant_core/ir/sites/scope.rs
1//! One lexical module scope inside a single source.
2
3/// A source's own scope, or one an inline `mod` item opens.
4///
5/// Index zero of a file's scope table is the source itself; every inline `mod`
6/// item adds one more. A resolution unit instantiates each scope separately,
7/// so the same source may hold two live copies of one scope.
8#[derive(Debug)]
9pub struct ModuleScope {
10 /// The declared module name; empty for the source's own scope.
11 pub name: Box<str>,
12 /// The scope this one is nested in; absent for the source's own scope.
13 pub parent: Option<usize>,
14}