Increase the maximum token length in the preprocessor to be 1024, to comply with…

Increase the maximum token length in the preprocessor to be 1024, to comply with the GLSL ES 3 specification. TRAC #23077 Signed-off-by: Shannon Woods Signed-off-by: Geoff Lang Author: Jamie Madill git-svn-id: https://angleproject.googlecode.com/svn/branches/es3proto@2349 736b8ea6-26fd-11df-bfd4-992fa37f6226
parent 4b8a3115
#line 16 "./Tokenizer.l" #line 16 "preprocessor/Tokenizer.l"
// //
// Copyright (c) 2011-2013 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2011-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#line 13 "./Tokenizer.cpp" #line 13 "preprocessor/Tokenizer.cpp"
#define YY_INT_ALIGNED short int #define YY_INT_ALIGNED short int
...@@ -519,6 +519,7 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh. ...@@ -519,6 +519,7 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
*/ */
#include "Tokenizer.h" #include "Tokenizer.h"
#include "length_limits.h"
#include "DiagnosticsBase.h" #include "DiagnosticsBase.h"
#include "Token.h" #include "Token.h"
...@@ -2292,7 +2293,7 @@ namespace pp { ...@@ -2292,7 +2293,7 @@ namespace pp {
// TODO(alokp): Maximum token length should ideally be specified by // TODO(alokp): Maximum token length should ideally be specified by
// the preprocessor client, i.e., the compiler. // the preprocessor client, i.e., the compiler.
const size_t Tokenizer::kMaxTokenLength = 256; const size_t Tokenizer::kMaxTokenLength = MAX_SYMBOL_NAME_LEN;
Tokenizer::Tokenizer(Diagnostics* diagnostics) : mHandle(0) Tokenizer::Tokenizer(Diagnostics* diagnostics) : mHandle(0)
{ {
......
...@@ -24,6 +24,7 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh. ...@@ -24,6 +24,7 @@ IF YOU MODIFY THIS FILE YOU ALSO NEED TO RUN generate_parser.sh.
%{ %{
#include "Tokenizer.h" #include "Tokenizer.h"
#include "length_limits.h"
#include "DiagnosticsBase.h" #include "DiagnosticsBase.h"
#include "Token.h" #include "Token.h"
...@@ -269,7 +270,7 @@ namespace pp { ...@@ -269,7 +270,7 @@ namespace pp {
// TODO(alokp): Maximum token length should ideally be specified by // TODO(alokp): Maximum token length should ideally be specified by
// the preprocessor client, i.e., the compiler. // the preprocessor client, i.e., the compiler.
const size_t Tokenizer::kMaxTokenLength = 256; const size_t Tokenizer::kMaxTokenLength = MAX_SYMBOL_NAME_LEN;
Tokenizer::Tokenizer(Diagnostics* diagnostics) : mHandle(0) Tokenizer::Tokenizer(Diagnostics* diagnostics) : mHandle(0)
{ {
......
// //
// Copyright (c) 2011 The ANGLE Project Authors. All rights reserved. // Copyright (c) 2011-2013 The ANGLE Project Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
// //
...@@ -15,7 +15,6 @@ ...@@ -15,7 +15,6 @@
// make it easier to reference them from the compiler sources. // make it easier to reference them from the compiler sources.
// These lengths do not include the NULL terminator. // These lengths do not include the NULL terminator.
#define MAX_SYMBOL_NAME_LEN 256 #define MAX_SYMBOL_NAME_LEN 1024
#define MAX_STRING_LEN 511
#endif // !(defined(__LENGTH_LIMITS_H) #endif // !(defined(__LENGTH_LIMITS_H)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment