refactor(xatu): name unquoted URI tokens explicitly

This commit is contained in:
2026-09-19 17:49:51 -04:00
parent 6d9cc20e4a
commit 49005e59a5
3 changed files with 3 additions and 3 deletions

View File

@@ -67,7 +67,7 @@ pub struct Token {
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, PartialEq, Eq)]
pub enum TokenData { pub enum TokenData {
Uri(String), UnquotedUri(String),
} }
#[derive(Debug, Clone, PartialEq, Eq)] #[derive(Debug, Clone, PartialEq, Eq)]

View File

@@ -123,7 +123,7 @@ fn convert_token(token: rnix::SyntaxToken) -> Option<ast::Token> {
match token.kind() { match token.kind() {
rnix::SyntaxKind::TOKEN_URI => Some(ast::Token { rnix::SyntaxKind::TOKEN_URI => Some(ast::Token {
range: token.text_range().into(), range: token.text_range().into(),
data: ast::TokenData::Uri(token.text().to_string()), data: ast::TokenData::UnquotedUri(token.text().to_string()),
}), }),
_ => None, _ => None,
} }

View File

@@ -9,7 +9,7 @@ impl TokenRule for UnquotedUri {
fn select(data: &ast::TokenData) -> Option<&Self::Token> { fn select(data: &ast::TokenData) -> Option<&Self::Token> {
match data { match data {
ast::TokenData::Uri(uri) => Some(uri), ast::TokenData::UnquotedUri(uri) => Some(uri),
} }
} }