X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Ftokenizer.cpp;h=0b18245f0e323e66c9c2eef6fb40ff19ba8307dc;hb=cc5483cc709fdf7b6966a3e69dabfcafebaaffa0;hp=b7efb8f8f9414d759c3cce3843593e14ae2a72e5;hpb=1083ad150c902bd153f88f7fb28660b4f31cf9fe;p=libs%2Fgl.git diff --git a/source/glsl/tokenizer.cpp b/source/glsl/tokenizer.cpp index b7efb8f8..0b18245f 100644 --- a/source/glsl/tokenizer.cpp +++ b/source/glsl/tokenizer.cpp @@ -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_()