Recognize in and out qualifiers for function parameters
authorMikko Rasa <tdb@tdb.fi>
Sun, 1 Jul 2018 07:55:31 +0000 (10:55 +0300)
committerMikko Rasa <tdb@tdb.fi>
Sun, 1 Jul 2018 07:57:08 +0000 (10:57 +0300)
source/programparser.cpp

index e7343547da1f5f736da555d68a1f4edeeef76a42..f38f39097615c94185c0d4bf7504d70e0dc7d646 100644 (file)
@@ -770,6 +770,9 @@ RefPtr<FunctionDeclaration> ProgramParser::parse_function_declaration()
                        expect(",");
 
                RefPtr<VariableDeclaration> var = new VariableDeclaration;
+               string token = peek_token();
+               if(token=="in" || token=="out" || token=="inout")
+                       var->interface = parse_token();
                var->type = expect_type();
                var->name = expect_identifier();
                func->parameters.push_back(var);