Skip to content

Commit

Permalink
feat: add more TokenKind variants
Browse files Browse the repository at this point in the history
  • Loading branch information
nfejzic committed Mar 28, 2022
1 parent 593a456 commit 578a5ed
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 @@ -104,6 +104,13 @@ impl Token {
pub enum TokenKind {
Bold,
Italic,
ItalicBold,
Underline,
Subscript,
UnderlineCombo,
Superscript,
Overline,
Strikethrough,
Newline,
Whitespace,
Plain,
Expand All @@ -113,10 +120,17 @@ impl TokenKind {
fn as_str(&self) -> &str {
match *self {
TokenKind::Bold => "**",
TokenKind::ItalicBold => "***",
TokenKind::Italic => "*",
TokenKind::Newline => "\n",
TokenKind::Plain => "",
TokenKind::Whitespace => " ",
TokenKind::Underline => "__",
TokenKind::Subscript => "_",
TokenKind::Superscript => "^",
TokenKind::UnderlineCombo => "___",
TokenKind::Overline => "‾",
TokenKind::Strikethrough => "~~",
}
}
}
Expand Down

0 comments on commit 578a5ed

Please sign in to comment.