Skip to content

Commit

Permalink
feat: add getters for TokenDelimiters tags
Browse files Browse the repository at this point in the history
  • Loading branch information
nfejzic committed Jul 31, 2022
1 parent f3e4e33 commit a95cba8
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions inline/src/lexer/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -687,6 +687,20 @@ impl TokenDelimiters {
self.close.as_ref().map(TokenKind::as_str),
)
}

/// Returns the opening [`TokenKind`]
///
/// [`TokenKind`]: self::TokenKind
pub fn open(&self) -> TokenKind {
self.open
}

/// Returns the opening [`TokenKind`] if available.
///
/// [`TokenKind`]: self::TokenKind
pub fn close(&self) -> Option<TokenKind> {
self.close
}
}

/// Enum representing the spacing surrounding a particular token in Unimarkup document.
Expand Down

0 comments on commit a95cba8

Please sign in to comment.