]> git.tdb.fi Git - libs/gl.git/blobdiff - source/glsl/tokenizer.cpp
Require initializers on constant variables
[libs/gl.git] / source / glsl / tokenizer.cpp
index b7efb8f8f9414d759c3cce3843593e14ae2a72e5..0b18245f0e323e66c9c2eef6fb40ff19ba8307dc 100644 (file)
@@ -19,7 +19,7 @@ Tokenizer::Tokenizer():
        source_end = empty.end();
 }
 
-void Tokenizer::begin(const string &name, const string &src)
+void Tokenizer::begin(const string &src, const string &name)
 {
        iter = src.begin();
        source_end = src.end();
@@ -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();
@@ -59,6 +61,7 @@ void Tokenizer::expect(const string &token)
 void Tokenizer::set_location(const Location &loc)
 {
        location = loc;
+       suppress_line_advance = true;
 }
 
 string Tokenizer::parse_token_()