Update lexer.h

This commit is contained in:
BLUELOVETH 2023-04-30 00:24:20 +08:00 committed by GitHub
parent 084725e2b3
commit e33d9fe595
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -38,7 +38,13 @@ constexpr TokenIndex TK(const char token[]) {
while(*i && *j && *i == *j) { i++; j++;}
if(*i == *j) return k;
}
#ifdef __GNUC__
// for old version of gcc, it is not smart enough to ignore FATAL_ERROR()
// so we must do a normal return
return 255;
#else
FATAL_ERROR();
#endif
}
#define TK_STR(t) kTokens[t]