Skip to content

Commit

Permalink
Start multi-line comments
Browse files Browse the repository at this point in the history
  • Loading branch information
vcfxb committed Feb 23, 2024
1 parent 70fbeb5 commit 48a96e2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion wright/src/parser/lexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ impl<'src> Lexer<'src> {
}

// Discard any single-line comment at the start of this lexer and then re-run this function if there was one.
// Note that this will not detect doc comments or multi-line comments.
// Note that this will not detect/discard doc comments or multi-line comments.
{
if let Some(without_comment_prefix) = self.remaining.inner.strip_prefix("//") {
// If the next character is not a slash or exclamation, indicating a doc comment.
Expand Down Expand Up @@ -370,6 +370,11 @@ impl<'src> Lexer<'src> {
}
}

// Discard any multi-line comments we encounter, sparing doc comments.
{

}

// To attempt to match a token from the prefix table, make a char iterator
// and get two chars from it to test equality. None of the tokens start with a
// null character so use that as a single of an unavailable char.
Expand Down

0 comments on commit 48a96e2

Please sign in to comment.