feat: Token::syntax

This commit is contained in:
PoiScript 2024-01-10 04:35:51 +08:00
parent 714f878ec9
commit ae7589fd61
No known key found for this signature in database
GPG key ID: 22C2B1249D99985E

View file

@ -76,6 +76,12 @@ pub fn filter_token(
#[derive(Default, Eq)]
pub struct Token(pub(crate) Option<SyntaxToken>);
impl Token {
pub fn syntax(&self) -> Option<&SyntaxToken> {
self.0.as_ref()
}
}
impl Token {
pub fn start(&self) -> u32 {
match &self.0 {