more lowering

This commit is contained in:
nora 2023-05-22 22:14:53 +02:00
parent e68ec920f5
commit 8bf9849641
7 changed files with 295 additions and 17 deletions

View file

@ -1,4 +1,8 @@
use std::{cell::RefCell, fmt::Debug, marker::PhantomData};
use std::{
cell::RefCell,
fmt::{Debug, Display},
marker::PhantomData,
};
use dbg_pls::DebugPls;
use lasso::Spur;
@ -37,3 +41,9 @@ impl DebugPls for Symbol {
self.as_str(|s| f.debug_ident(s))
}
}
impl Display for Symbol {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
INTERNER.with(|i| f.write_str(i.borrow_mut().resolve(&self.spur)))
}
}