diff options
Diffstat (limited to 'src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l')
-rw-r--r-- | src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l b/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l index fc81d84f37..01f0177b6c 100644 --- a/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l +++ b/src/3rdparty/angle/src/compiler/preprocessor/Tokenizer.l @@ -267,11 +267,9 @@ FRACTIONAL_CONSTANT ({DIGIT}*"."{DIGIT}+)|({DIGIT}+".") namespace pp { -// TODO(alokp): Maximum token length should ideally be specified by -// the preprocessor client, i.e., the compiler. -const size_t Tokenizer::kMaxTokenLength = 256; - -Tokenizer::Tokenizer(Diagnostics* diagnostics) : mHandle(0) +Tokenizer::Tokenizer(Diagnostics* diagnostics) + : mHandle(0), + mMaxTokenLength(256) { mContext.diagnostics = diagnostics; } @@ -304,11 +302,11 @@ void Tokenizer::setLineNumber(int line) void Tokenizer::lex(Token* token) { token->type = yylex(&token->text, &token->location, mHandle); - if (token->text.size() > kMaxTokenLength) + if (token->text.size() > mMaxTokenLength) { mContext.diagnostics->report(Diagnostics::TOKEN_TOO_LONG, token->location, token->text); - token->text.erase(kMaxTokenLength); + token->text.erase(mMaxTokenLength); } token->flags = 0; |