1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-22 08:55:10 +00:00

LibJS: Fix some coding style mistakes in Lexer

This commit is contained in:
Andreas Kling 2020-03-12 13:52:54 +01:00
parent 023d121e05
commit 4781e3fb72

View file

@ -214,10 +214,10 @@ Token Lexer::next()
} else { } else {
bool found_three_char_token = false; bool found_three_char_token = false;
if (m_position + 1 < m_source.length()) { if (m_position + 1 < m_source.length()) {
char secondChar = m_source[m_position]; char second_char = m_source[m_position];
char thirdChar = m_source[m_position+1]; char third_char = m_source[m_position + 1];
char threeChars[] { (char)m_current_char, secondChar, thirdChar, 0 }; char three_chars[] { (char)m_current_char, second_char, third_char, 0 };
auto it = s_three_char_tokens.find(threeChars); auto it = s_three_char_tokens.find(three_chars);
if (it != s_three_char_tokens.end()) { if (it != s_three_char_tokens.end()) {
found_three_char_token = true; found_three_char_token = true;
consume(); consume();
@ -229,9 +229,9 @@ Token Lexer::next()
bool found_two_char_token = false; bool found_two_char_token = false;
if (!found_three_char_token && !is_eof()) { if (!found_three_char_token && !is_eof()) {
char secondChar = m_source[m_position]; char second_char = m_source[m_position];
char twoChars[] { (char)m_current_char, secondChar, 0 }; char two_chars[] { (char)m_current_char, second_char, 0 };
auto it = s_two_char_tokens.find(twoChars); auto it = s_two_char_tokens.find(two_chars);
if (it != s_two_char_tokens.end()) { if (it != s_two_char_tokens.end()) {
found_two_char_token = true; found_two_char_token = true;
consume(); consume();