]> git.tdb.fi Git - libs/gl.git/blob - source/glsl/glsl_error.cpp
Refactor error reporting in SL::Parser
[libs/gl.git] / source / glsl / glsl_error.cpp
1 #include "glsl_error.h"
2 #include "parser.h"
3
4 using namespace std;
5
6 namespace Msp {
7 namespace GL {
8 namespace SL {
9
10 invalid_shader_source::invalid_shader_source(const Location &loc, const string &message):
11         runtime_error(format("%s:%d: %s", loc.name, loc.line, message))
12 { }
13
14 parse_error::parse_error(const Location &loc, const string &token, const string &expected):
15         invalid_shader_source(loc, "Parse error at '%s': expected %s", token, expected)
16 { }
17
18 } // namespace SL
19 } // namespace GL
20 } // namespace Msp