LibWeb: Make BEGIN_STATE and END_STATE include some {{{ and }}}

This makes it a compile error to omit the END_STATE. Also add some more
missing END_STATE's exposed by this (nice!)

Thanks to @predmond for suggesting the multi-pair trick! :^)
This commit is contained in:
Andreas Kling 2020-05-23 14:04:53 +02:00
parent d63b6287f5
commit 45450c7edc
Notes: sideshowbarker 2024-07-19 06:13:06 +09:00

View file

@ -66,11 +66,16 @@
#define BEGIN_STATE(state) \ #define BEGIN_STATE(state) \
state: \ state: \
case State::state: case State::state: { \
{ \
{
#define END_STATE \ #define END_STATE \
ASSERT_NOT_REACHED(); \ ASSERT_NOT_REACHED(); \
break; break; \
} \
} \
}
namespace Web { namespace Web {
@ -494,6 +499,7 @@ void HTMLTokenizer::run()
continue; continue;
} }
} }
END_STATE
BEGIN_STATE(CommentEnd) BEGIN_STATE(CommentEnd)
{ {
@ -562,6 +568,7 @@ void HTMLTokenizer::run()
RECONSUME_IN(Comment); RECONSUME_IN(Comment);
} }
} }
END_STATE
BEGIN_STATE(CommentLessThanSign) BEGIN_STATE(CommentLessThanSign)
{ {