1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

Everywhere: Rename ASSERT => VERIFY

(...and ASSERT_NOT_REACHED => VERIFY_NOT_REACHED)

Since all of these checks are done in release builds as well,
let's rename them to VERIFY to prevent confusion, as everyone is
used to assertions being compiled out in release.

We can introduce a new ASSERT macro that is specifically for debug
checks, but I'm doing this wholesale conversion first since we've
accumulated thousands of these already, and it's not immediately
obvious which ones are suitable for ASSERT.
This commit is contained in:
Andreas Kling 2021-02-23 20:42:32 +01:00
parent b33a6a443e
commit 5d180d1f99
725 changed files with 3448 additions and 3448 deletions

View file

@ -41,7 +41,7 @@ const char* Token::name(const TokenType type)
ENUMERATE_REGEX_TOKENS
#undef __ENUMERATE_REGEX_TOKEN
default:
ASSERT_NOT_REACHED();
VERIFY_NOT_REACHED();
return "<Unknown>";
}
}
@ -68,7 +68,7 @@ void Lexer::back(size_t offset)
if (offset == m_position + 1)
offset = m_position; // 'position == 0' occurs twice.
ASSERT(offset <= m_position);
VERIFY(offset <= m_position);
if (!offset)
return;
m_position -= offset;
@ -122,7 +122,7 @@ Token Lexer::next()
};
auto commit_token = [&](auto type) -> Token& {
ASSERT(token_start_position + m_previous_position - token_start_position + 1 <= m_source.length());
VERIFY(token_start_position + m_previous_position - token_start_position + 1 <= m_source.length());
auto substring = m_source.substring_view(token_start_position, m_previous_position - token_start_position + 1);
m_current_token = Token(type, token_start_position, substring);
return m_current_token;