]> git.tdb.fi Git - libs/gl.git/blob - source/glsl/glsl_error.cpp
aff897ca012c73b249bd63fc12fe5e3e9cfa9299
[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 syntax_error::syntax_error(const Location &loc, const string &token, const string &message):
15         invalid_shader_source(loc, "Syntax error near '%s': %s", token, message)
16 { }
17
18 parse_error::parse_error(const Location &loc, const string &token, const string &expected):
19         invalid_shader_source(loc, "Parse error at '%s': expected %s", token, expected)
20 { }
21
22 } // namespace SL
23 } // namespace GL
24 } // namespace Msp