]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/glsl_error.h
Record information of the provoking location of a diagnostic
[libs/gl.git] / source / glsl / glsl_error.h
index 1ae521cae8b05a9085a5195ab2182104e28ffe3f..84aa2f52a60a45c42f6bdbe30a5fbc676e418d25 100644 (file)
@@ -13,6 +13,7 @@ struct Location;
 class invalid_shader_source: public std::runtime_error
 {
 public:
+       invalid_shader_source(const std::string &w): runtime_error(w) { }
        invalid_shader_source(const Location &, const std::string &);
 #if __cplusplus>=201103L
        template<typename... Args>
@@ -37,6 +38,25 @@ public:
        virtual ~parse_error() throw() { }
 };
 
+struct Diagnostic
+{
+       enum Severity
+       {
+               INFO,
+               WARN,
+               ERR
+       };
+
+       Severity severity;
+       int source;
+       unsigned line;
+       int provoking_source;
+       unsigned provoking_line;
+       std::string message;
+
+       Diagnostic(): severity(INFO), source(-2), line(0) { }
+};
+
 } // namespace SL
 } // namespace GL
 } // namespace Msp