X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fparser.cpp;h=7b034a4c671f1d854a06cfabcaad83d94859aa88;hb=911c6c4acc8218bc40d93917207f9dc32e9f2596;hp=0c3a5e35a57a35033024989aa96076b06bd141cd;hpb=3a1fe833ea04df75449706f1d773f6e65521a392;p=libs%2Fgl.git diff --git a/source/glsl/parser.cpp b/source/glsl/parser.cpp index 0c3a5e35..7b034a4c 100644 --- a/source/glsl/parser.cpp +++ b/source/glsl/parser.cpp @@ -294,6 +294,8 @@ RefPtr Parser::parse_global_declaration() } else if(is_qualifier(token)) return parse_variable_declaration(); + else if(token=="virtual") + return parse_function_declaration(); else if(is_type(token)) { if(tokenizer.peek_token(2)=="(") @@ -549,10 +551,10 @@ RefPtr Parser::parse_binary(const RefPtr &left, co binary->left = left; binary->oper = &oper; tokenizer.expect(oper.token); - if(oper.token[0]=='[') + if(oper.token2[0]) { binary->right = parse_expression(); - tokenizer.expect("]"); + tokenizer.expect(oper.token2); } else binary->right = parse_expression(&oper); @@ -750,6 +752,7 @@ RefPtr Parser::parse_function_declaration() { RefPtr func = create_node(); + func->virtua = check("virtual"); func->return_type = expect_type(); func->name = expect_identifier(); tokenizer.expect("("); @@ -768,6 +771,8 @@ RefPtr Parser::parse_function_declaration() } tokenizer.expect(")"); + func->overrd = check("override"); + string token = tokenizer.peek_token(); if(token=="{") {