Skip to content

Commit

Permalink
fix: the age old comment bug is squashed
Browse files Browse the repository at this point in the history
  • Loading branch information
HavenSelph authored and slbsh committed Aug 5, 2024
1 parent fd6da43 commit 1df513e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,9 @@ impl<'source> Lexer<'source> {
while Some('\n') == self.current {
self.advance();
}
self.push_token(TokenKind::NewLine, span_to!(start_index), "");
if self.tokens.last().is_some_and(|token| token.kind != TokenKind::NewLine) {
self.push_token(TokenKind::NewLine, span_to!(start_index), "");
}
continue;
},
char if char.is_whitespace() => {
Expand Down

0 comments on commit 1df513e

Please sign in to comment.