Skip to content

Commit

Permalink
fix(lexer): include \t characters in the Whitespace token
Browse files Browse the repository at this point in the history
  • Loading branch information
KieranKaelin committed Dec 21, 2022
1 parent 736dbde commit 10a42f3
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lexer/token.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use std::fmt;
/// Use to tokenize the input text
#[derive(logos::Logos, Debug, Copy, Clone, PartialEq, Eq)]
pub enum TokenKind {
#[regex("[ \n\r]+")]
#[regex("[ \t\n\r]+")]
Whitespace,

#[token("create", ignore(case))]
Expand Down Expand Up @@ -189,8 +189,8 @@ mod tests {
}

#[test]
fn lex_spaces_and_newlines() {
check(" \n", TokenKind::Whitespace);
fn lex_spaces_tabs_and_newlines() {
check(" \t \n", TokenKind::Whitespace);
}

#[test]
Expand Down

0 comments on commit 10a42f3

Please sign in to comment.