From 49005e59a53640f50c36ffcbb0810495d313d6b0 Mon Sep 17 00:00:00 2001 From: alexion Date: Sat, 19 Sep 2026 17:49:51 -0400 Subject: [PATCH] refactor(xatu): name unquoted URI tokens explicitly --- src/xatu/ast.rs | 2 +- src/xatu/parser.rs | 2 +- src/xatu/rules/unquoted_uri.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/xatu/ast.rs b/src/xatu/ast.rs index ff3d8ae..220f61b 100644 --- a/src/xatu/ast.rs +++ b/src/xatu/ast.rs @@ -67,7 +67,7 @@ pub struct Token { #[derive(Debug, Clone, PartialEq, Eq)] pub enum TokenData { - Uri(String), + UnquotedUri(String), } #[derive(Debug, Clone, PartialEq, Eq)] diff --git a/src/xatu/parser.rs b/src/xatu/parser.rs index b8ed0a5..97a7ccb 100644 --- a/src/xatu/parser.rs +++ b/src/xatu/parser.rs @@ -123,7 +123,7 @@ fn convert_token(token: rnix::SyntaxToken) -> Option { match token.kind() { rnix::SyntaxKind::TOKEN_URI => Some(ast::Token { range: token.text_range().into(), - data: ast::TokenData::Uri(token.text().to_string()), + data: ast::TokenData::UnquotedUri(token.text().to_string()), }), _ => None, } diff --git a/src/xatu/rules/unquoted_uri.rs b/src/xatu/rules/unquoted_uri.rs index 22170f9..cb7410e 100644 --- a/src/xatu/rules/unquoted_uri.rs +++ b/src/xatu/rules/unquoted_uri.rs @@ -9,7 +9,7 @@ impl TokenRule for UnquotedUri { fn select(data: &ast::TokenData) -> Option<&Self::Token> { match data { - ast::TokenData::Uri(uri) => Some(uri), + ast::TokenData::UnquotedUri(uri) => Some(uri), } }