feat(xatu): report unquoted URI literals

This commit is contained in:
2026-09-19 17:27:43 -04:00
parent 87dc93513b
commit c2c441ced6
7 changed files with 120 additions and 9 deletions

View File

@@ -0,0 +1,19 @@
use crate::{ast, rules::TokenRule};
pub struct UnquotedUri;
impl TokenRule for UnquotedUri {
type Token = String;
const ID: &'static str = "unquoted_uri";
fn select(data: &ast::TokenData) -> Option<&Self::Token> {
match data {
ast::TokenData::Uri(uri) => Some(uri),
}
}
fn check(_token: &Self::Token) -> Option<&'static str> {
Some("URI literals should be quoted")
}
}