20 lines
442 B
Rust
20 lines
442 B
Rust
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::UnquotedUri(uri) => Some(uri),
|
|
}
|
|
}
|
|
|
|
fn check(_token: &Self::Token) -> Option<&'static str> {
|
|
Some("URI literals should be quoted")
|
|
}
|
|
}
|