From: Mikko Rasa Date: Thu, 4 Mar 2021 12:17:04 +0000 (+0200) Subject: Flip the parameters of Tokenizer::begin X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=e195322eb1251f2eb0d6dfb8c2dc0fff02e5fcfc;p=libs%2Fgl.git Flip the parameters of Tokenizer::begin Everything else has the filename as the last parameter, so let's be consistent here. --- diff --git a/source/glsl/parser.cpp b/source/glsl/parser.cpp index c6f3f5be..b09d2b55 100644 --- a/source/glsl/parser.cpp +++ b/source/glsl/parser.cpp @@ -58,7 +58,7 @@ void Parser::parse_source(const string &name, int index) source_index = index; if(index>=0) source_reference(1, name); - tokenizer.begin(name, source); + tokenizer.begin(source, name); allow_stage_change = true; while(!tokenizer.peek_token().empty()) if(RefPtr statement = parse_with_recovery(&Parser::parse_global_declaration)) diff --git a/source/glsl/tokenizer.cpp b/source/glsl/tokenizer.cpp index 057aa342..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(); diff --git a/tests/glsl/glslcompiler.cpp b/tests/glsl/glslcompiler.cpp index 57911cca..f38db45c 100644 --- a/tests/glsl/glslcompiler.cpp +++ b/tests/glsl/glslcompiler.cpp @@ -105,10 +105,10 @@ void GlslCompilerTest::run_test_case(const TestCase *test_case) debug(format("%3d: %s", j+1, lines[j])); GL::SL::Tokenizer tokenizer; - tokenizer.begin("", output); + tokenizer.begin(output, ""); GL::SL::Tokenizer expected_tkn; - expected_tkn.begin("", i->second); + expected_tkn.begin(i->second, ""); while(1) {