mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 23:04:49 +00:00
Add Interns::module_name and use it.
This commit is contained in:
parent
62c7a7c3e2
commit
555528c483
2 changed files with 11 additions and 2 deletions
|
@ -180,6 +180,15 @@ pub struct Interns {
|
|||
}
|
||||
|
||||
impl Interns {
|
||||
pub fn module_name(&self, module_id: ModuleId) -> &InlinableString {
|
||||
self.module_ids.get_name(module_id).unwrap_or_else(|| {
|
||||
panic!(
|
||||
"Unable to find interns entry for module_id {:?} in Interns {:?}",
|
||||
module_id, self
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
pub fn symbol(&self, module_id: ModuleId, ident: InlinableString) -> Symbol {
|
||||
match self.all_ident_ids.get(&module_id) {
|
||||
Some(ident_ids) => match ident_ids.get_id(&ident) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue