mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:58:11 +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:
parent
b33a6a443e
commit
5d180d1f99
725 changed files with 3448 additions and 3448 deletions
|
@ -33,11 +33,11 @@
|
|||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#define PARSE_ASSERT(x) \
|
||||
#define PARSE_VERIFY(x) \
|
||||
if (!(x)) { \
|
||||
dbgln("CSS PARSER ASSERTION FAILED: {}", #x); \
|
||||
dbgln("At character# {} in CSS: _{}_", index, css); \
|
||||
ASSERT_NOT_REACHED(); \
|
||||
VERIFY_NOT_REACHED(); \
|
||||
}
|
||||
|
||||
#define PARSE_ERROR() \
|
||||
|
@ -344,7 +344,7 @@ public:
|
|||
|
||||
char consume_one()
|
||||
{
|
||||
PARSE_ASSERT(index < css.length());
|
||||
PARSE_VERIFY(index < css.length());
|
||||
return css[index++];
|
||||
};
|
||||
|
||||
|
@ -424,7 +424,7 @@ public:
|
|||
if (type != CSS::Selector::SimpleSelector::Type::Universal) {
|
||||
while (is_valid_selector_char(peek()))
|
||||
buffer.append(consume_one());
|
||||
PARSE_ASSERT(!buffer.is_null());
|
||||
PARSE_VERIFY(!buffer.is_null());
|
||||
}
|
||||
|
||||
auto value = String::copy(buffer);
|
||||
|
@ -593,7 +593,7 @@ public:
|
|||
break;
|
||||
simple_selectors.append(component.value());
|
||||
// If this assert triggers, we're most likely up to no good.
|
||||
PARSE_ASSERT(simple_selectors.size() < 100);
|
||||
PARSE_VERIFY(simple_selectors.size() < 100);
|
||||
}
|
||||
|
||||
if (simple_selectors.is_empty())
|
||||
|
@ -682,7 +682,7 @@ public:
|
|||
continue;
|
||||
}
|
||||
if (ch == ')') {
|
||||
PARSE_ASSERT(paren_nesting_level > 0);
|
||||
PARSE_VERIFY(paren_nesting_level > 0);
|
||||
--paren_nesting_level;
|
||||
buffer.append(consume_one());
|
||||
continue;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue