]> git.tdb.fi Git - libs/gl.git/commitdiff
Flip the parameters of Tokenizer::begin
authorMikko Rasa <tdb@tdb.fi>
Thu, 4 Mar 2021 12:17:04 +0000 (14:17 +0200)
committerMikko Rasa <tdb@tdb.fi>
Thu, 4 Mar 2021 15:32:05 +0000 (17:32 +0200)
Everything else has the filename as the last parameter, so let's be
consistent here.

source/glsl/parser.cpp
source/glsl/tokenizer.cpp
tests/glsl/glslcompiler.cpp

index c6f3f5be3cdd186818cbee6322ad966dff46181d..b09d2b5550b47c321fba2a69feedc4d7c36f0293 100644 (file)
@@ -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> statement = parse_with_recovery(&Parser::parse_global_declaration))
index 057aa34219873970412e578a0bc7ae2dc36a4793..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();
index 57911ccaaccbbfe778744b86d3fc170d6fd5a7ec..f38db45caa6c5638e06044a624055ef2f0e63ed4 100644 (file)
@@ -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>", output);
+               tokenizer.begin(output, "<output>");
 
                GL::SL::Tokenizer expected_tkn;
-               expected_tkn.begin("<expected>", i->second);
+               expected_tkn.begin(i->second, "<expected>");
 
                while(1)
                {