summaryrefslogtreecommitdiff
path: root/src/diagnostics
diff options
context:
space:
mode:
Diffstat (limited to 'src/diagnostics')
-rw-r--r--src/diagnostics/non_alphabetic_tag_name.rs38
1 files changed, 0 insertions, 38 deletions
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<Self> {
- 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 })
- }
-}