mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibJS: Don't store current token in both Lexer and Parser
Just give Parser a way to access the one stored in Lexer.
This commit is contained in:
parent
d3e8fbd9cd
commit
841fe0b51c
Notes:
github-actions[bot]
2025-11-09 11:15:45 +00:00
Author: https://github.com/awesomekling
Commit: 841fe0b51c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6764
4 changed files with 100 additions and 98 deletions
|
|
@ -636,7 +636,7 @@ bool Lexer::slash_means_division() const
|
|||
|| type == TokenType::TemplateLiteralEnd;
|
||||
}
|
||||
|
||||
Token Lexer::next()
|
||||
Token const& Lexer::next()
|
||||
{
|
||||
auto trivia_start = m_position;
|
||||
auto in_template = !m_template_states.is_empty();
|
||||
|
|
@ -970,7 +970,7 @@ Token Lexer::next()
|
|||
return m_current_token;
|
||||
}
|
||||
|
||||
Token Lexer::force_slash_as_regex()
|
||||
Token const& Lexer::force_slash_as_regex()
|
||||
{
|
||||
VERIFY(m_current_token.type() == TokenType::Slash || m_current_token.type() == TokenType::SlashEquals);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue