tamer: xir::attr::parse: Better parser state descriptions

The attribute name was neither quoted nor `@`-prefixed.  (I noticed this in
the traces.)

DEV-7145
main
Mike Gerwitz 2022-08-01 13:41:21 -04:00
parent 2d117a4864
commit 77efefe680
1 changed files with 8 additions and 3 deletions

View File

@ -21,9 +21,10 @@
use crate::{
diagnose::{Annotate, AnnotatedSpan, Diagnostic},
fmt::{DisplayWrapper, Tt},
parse::{NoContext, ParseState, Token, Transition, TransitionResult},
span::Span,
xir::{QName, Token as XirToken},
xir::{fmt::XmlAttr, QName, Token as XirToken},
};
use std::{error::Error, fmt::Display};
@ -92,9 +93,13 @@ impl Display for AttrParseState {
use AttrParseState::*;
match self {
Empty => write!(f, "expecting an attribute"),
Empty => write!(f, "expecting an attribute name"),
Name(name, _) => {
write!(f, "expecting an attribute value for {name}")
write!(
f,
"expecting an attribute value for {}",
Tt::<XmlAttr>::wrap(name),
)
}
}
}