]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/parser.h
Make the GLSL parser resilient against common errors
[libs/gl.git] / source / glsl / parser.h
index 9ab1232aaa0d9ad7aec82b24ee873b8b4e998e16..acfb7d9eed9a8cc857becf5436e59a92bac522ba 100644 (file)
@@ -24,6 +24,7 @@ private:
        Module *module;
        Stage *cur_stage;
        std::set<std::string> declared_types;
+       std::vector<std::string> errors;
 
 public:
        Parser();
@@ -60,6 +61,8 @@ private:
        void preprocess_stage();
 
        RefPtr<Statement> parse_global_declaration();
+       template<typename T>
+       RefPtr<T> parse_with_recovery(RefPtr<T> (Parser::*)());
        RefPtr<Statement> parse_statement();
        RefPtr<Import> parse_import();
        RefPtr<Precision> parse_precision();