Skip to content

Commit

Permalink
feat: Token::syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
PoiScript committed Jan 9, 2024
1 parent 714f878 commit ae7589f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions orgize/src/ast/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit ae7589f

Please sign in to comment.