mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 17:47:44 +00:00
LibJS: Make new lines in block comments reset line has token
Before this a closing html comment would not be treated as a comment if directly following a block comment which was not the first token of its first line.
This commit is contained in:
parent
45578f58dc
commit
a1308bfc60
2 changed files with 13 additions and 0 deletions
|
@ -530,6 +530,7 @@ Token Lexer::next()
|
|||
consume();
|
||||
} while (!is_eof() && !is_line_terminator());
|
||||
} else if (is_block_comment_start()) {
|
||||
size_t start_line_number = m_line_number;
|
||||
consume();
|
||||
do {
|
||||
consume();
|
||||
|
@ -540,6 +541,9 @@ Token Lexer::next()
|
|||
if (is_eof())
|
||||
unterminated_comment = true;
|
||||
consume(); // consume /
|
||||
|
||||
if (start_line_number != m_line_number)
|
||||
line_has_token_yet = false;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue