From a197267a2dda1d25245314939b5cede97465d6f6 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 28 Apr 2022 15:47:34 -0400 Subject: [PATCH] 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 | | | ----------------- = note: element `preproc:symtable` is opened here --> /home/.../foo.xmlo:11326:4 | | | ^^^^^^^^^^^^^^^^ = error: expected `` DEV-12151 --- tamer/src/xir/flat.rs | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tamer/src/xir/flat.rs b/tamer/src/xir/flat.rs index c35ce021..567d720d 100644 --- a/tamer/src/xir/flat.rs +++ b/tamer/src/xir/flat.rs @@ -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 ``, \ - 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 ``")), ] }