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