diff options
| author | Mica White <botahamec@outlook.com> | 2026-07-12 19:49:14 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-07-12 19:49:14 -0400 |
| commit | 8399983fd45bc0f11eac9def280c0833ffb93c04 (patch) | |
| tree | f84173ca30a3c62db7abb92a0d869ff5d5199c51 /src/diagnostics/stray_end_tag.rs | |
Diffstat (limited to 'src/diagnostics/stray_end_tag.rs')
| -rw-r--r-- | src/diagnostics/stray_end_tag.rs | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/diagnostics/stray_end_tag.rs b/src/diagnostics/stray_end_tag.rs new file mode 100644 index 0000000..fa4ca07 --- /dev/null +++ b/src/diagnostics/stray_end_tag.rs @@ -0,0 +1,22 @@ +use miette::Diagnostic; +use thiserror::Error; + +use crate::{diagnostics::AstDiagnostic, parse::Node, tokenize::Span}; + +#[derive(Error, Debug, Diagnostic)] +#[error("Stray end tag")] +#[diagnostic(code(StrayEndTag), severity(Error))] +pub struct StrayEndTag { + #[label(primary)] + token: Span, +} + +impl AstDiagnostic for StrayEndTag { + fn handle_node(node: &Node<'_>) -> Option<Self> { + let Node::StrayEndTag(token) = node else { + return None; + }; + + Some(Self { token: token.span }) + } +} |
