tamer: xir::parse::attr: Display: element name
This resolves a TODO by including the name of the element whose attributes are currently being parsed. This also frees a parent from having to provide additional context, allowing Display to be fully delegated when stitching. DEV-7145main
parent
2f4c20dac8
commit
f462c7daec
|
@ -303,8 +303,17 @@ macro_rules! attr_parse {
|
|||
/// Additional error context shown in diagnostic messages for
|
||||
/// certain variants of [`ParseError`].
|
||||
fn fmt(&self, f: &mut std::fmt::Formatter) -> std::fmt::Result {
|
||||
// TODO
|
||||
write!(f, "parsing attributes")
|
||||
use crate::fmt::{DisplayWrapper, TtQuote};
|
||||
|
||||
match self {
|
||||
Self { ___ctx: (ele, _), .. } => {
|
||||
write!(
|
||||
f,
|
||||
"parsing attributes for element {}",
|
||||
TtQuote::wrap(ele)
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue