tamer: xir::flat: Remove closing tag name from label

This is now visible in the diagnostic output.  Example at this point in
time, on an xmlo file for one of our smallest systems:

error: expected closing tag for `preproc:symtable`
  --> /home/.../foo.xmlo:16:4
   |
   |    <preproc:symtable xmlns:map="http://www.w3.org/2005/xpath-functions/map">
   |    -----------------
   = note: element `preproc:symtable` is opened here

  --> /home/.../foo.xmlo:11326:4
   |
   |    </preproc:wrong>
   |    ^^^^^^^^^^^^^^^^
   = error: expected `</preproc:symtable>`

DEV-12151
main
Mike Gerwitz 2022-04-28 15:47:34 -04:00
parent 33baca113a
commit a197267a2d
1 changed files with 4 additions and 5 deletions

View File

@ -438,7 +438,7 @@ impl Diagnostic for StateError {
UnbalancedTag {
open: (open_name, open_span),
close: (close_name, close_span),
close: (_close_name, close_span),
} => {
// TODO: hint saying that the nesting could be wrong, etc;
// we can't just suggest a replacement,
@ -446,10 +446,9 @@ impl Diagnostic for StateError {
vec![
open_span
.note(format!("element `{open_name}` is opened here")),
close_span.error(format!(
"expected `</{open_name}>`, \
but found closing tag for `{close_name}`"
)),
// No need to state the close name since the source line
// will be highlighted by the diagnostic message.
close_span.error(format!("expected `</{open_name}>`")),
]
}