]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/tokenizer.cpp
Make the GLSL parser resilient against common errors
[libs/gl.git] / source / glsl / tokenizer.cpp
index b7efb8f8f9414d759c3cce3843593e14ae2a72e5..6ba139ff9fd92b37a459fc619e79088902d2bea2 100644 (file)
@@ -34,11 +34,13 @@ const string &Tokenizer::peek_token(unsigned index)
 {
        while(next_tokens.size()<=index)
                next_tokens.push_back(parse_token_());
-       return (last_token = next_tokens[index]);
+       return next_tokens[index];
 }
 
 const string &Tokenizer::parse_token()
 {
+       progress_mark = true;
+
        if(!next_tokens.empty())
        {
                last_token = next_tokens.front();