]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/parser.h
Refactor error reporting in SL::Parser
[libs/gl.git] / source / glsl / parser.h
index c9588bfbdd99486a0e759df55ebd7c520ebeefb0..743149d83362a84be8b91e5b13dad8789e90bede 100644 (file)
@@ -12,6 +12,12 @@ namespace Msp {
 namespace GL {
 namespace SL {
 
+struct Location
+{
+       std::string name;
+       unsigned line;
+};
+
 class Parser
 {
 private:
@@ -38,9 +44,8 @@ private:
        };
 
        std::string source;
-       std::string source_name;
        unsigned source_index;
-       unsigned current_line;
+       Location location;
        std::string::const_iterator iter;
        std::string::const_iterator source_end;
        bool allow_preprocess;
@@ -63,9 +68,6 @@ public:
 private:
        void parse_source();
 
-       std::string format_error(const std::string &);
-       std::string format_syntax_error(const std::string &);
-
        const std::string &peek_token(unsigned = 0);
        const std::string &parse_token();
        std::string parse_token_();