From 35f6fc17d0c98f424e01904b8856cf42c80bcfd3 Mon Sep 17 00:00:00 2001 From: Mica White Date: Sun, 27 Sep 2026 15:48:03 -0400 Subject: Add buggy diagnostics --- src/diagnostics/non_alphabetic_tag_name.rs | 38 ------------------------------ 1 file changed, 38 deletions(-) delete mode 100644 src/diagnostics/non_alphabetic_tag_name.rs (limited to 'src/diagnostics') diff --git a/src/diagnostics/non_alphabetic_tag_name.rs b/src/diagnostics/non_alphabetic_tag_name.rs deleted file mode 100644 index b36cb75..0000000 --- a/src/diagnostics/non_alphabetic_tag_name.rs +++ /dev/null @@ -1,38 +0,0 @@ -use miette::Diagnostic; -use thiserror::Error; - -use crate::{ - diagnostics::TokenDiagnostic, - tokenize::{Span, Token, TokenType}, -}; - -#[derive(Error, Debug, Diagnostic)] -#[error("Tag names must be alphabetic")] -#[diagnostic(code(NonAlphabeticTagName), severity(Error))] -pub struct NonAlphabeticTagName { - #[label(primary, "tag names must only contain uppercase and lowercase letters")] - tag: Span, -} - -impl TokenDiagnostic for NonAlphabeticTagName { - fn handle_token(token: &Token<'_>) -> Option { - let TokenType::Tag { - is_end, - lowercase_tag_name, - .. - } = token.ty - else { - return None; - }; - - if is_end - || lowercase_tag_name - .chars() - .all(|char| char.is_ascii_alphabetic()) - { - return None; - } - - Some(Self { tag: token.span }) - } -} -- cgit v1.3.1