Edit

kc3-lang/angle/src/compiler/translator/Diagnostics.h

Branch :

  • Show log

    Commit

  • Author : Jamie Madill
    Date : 2014-02-19 10:27:53
    Hash : 88f6e946
    Message : Proper support for token max size in WebGL+ES3. WebGL specifies a maximum token size of 256 characters, while ES3 specifies 1024 characters. We can determine the proper max size to support from the spec. BUG=angle:550 Change-Id: I6aeabe8af3b6184a27b456248ce2f84f361b76e4 Reviewed-on: https://chromium-review.googlesource.com/186973 Reviewed-by: Shannon Woods <shannonwoods@chromium.org> Tested-by: Jamie Madill <jmadill@chromium.org>

  • src/compiler/translator/Diagnostics.h
  • //
    // Copyright (c) 2012-2013 The ANGLE Project Authors. All rights reserved.
    // Use of this source code is governed by a BSD-style license that can be
    // found in the LICENSE file.
    //
    
    #ifndef COMPILER_DIAGNOSTICS_H_
    #define COMPILER_DIAGNOSTICS_H_
    
    #include "compiler/preprocessor/DiagnosticsBase.h"
    
    class TInfoSink;
    
    class TDiagnostics : public pp::Diagnostics
    {
      public:
        TDiagnostics(TInfoSink& infoSink);
        virtual ~TDiagnostics();
    
        TInfoSink& infoSink() { return mInfoSink; }
    
        int numErrors() const { return mNumErrors; }
        int numWarnings() const { return mNumWarnings; }
    
        void writeInfo(Severity severity,
                       const pp::SourceLocation& loc,
                       const std::string& reason,
                       const std::string& token,
                       const std::string& extra);
    
        void writeDebug(const std::string& str);
    
      protected:
        virtual void print(ID id,
                           const pp::SourceLocation& loc,
                           const std::string& text);
    
      private:
        TInfoSink& mInfoSink;
        int mNumErrors;
        int mNumWarnings;
    };
    
    #endif  // COMPILER_DIAGNOSTICS_H_