X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fglsl%2Fparser.cpp;h=fd782648083bdb05a1aa700ca65d4ab8f15aa926;hb=041ba4b1acd55337239c5ce24cc310118c621206;hp=c924606f09c018c33388b020ec23100aa5a291f4;hpb=fd44325059d59d32d47ef3feb6d41d846f7f36f0;p=libs%2Fgl.git diff --git a/source/glsl/parser.cpp b/source/glsl/parser.cpp index c924606f..fd782648 100644 --- a/source/glsl/parser.cpp +++ b/source/glsl/parser.cpp @@ -447,7 +447,8 @@ RefPtr Parser::parse_expression(unsigned precedence) if(token==i->token && (!left || i->type!=Operator::PREFIX) && (left || i->type!=Operator::POSTFIX)) oper = i; - if(token==";" || token==")" || token=="]" || token=="," || (oper && precedence && oper->precedence>=precedence)) + bool lower_precedence = (oper && oper->type!=Operator::PREFIX && precedence && oper->precedence>=precedence); + if(token==";" || token==")" || token=="]" || token=="," || lower_precedence) { if(left) return left; @@ -775,7 +776,8 @@ RefPtr Parser::parse_interface_block() throw parse_error(tokenizer.get_location(), iface->interface, "an interface qualifier"); iface->name = expect_identifier(); - parse_block(iface->members, true, &Parser::parse_variable_declaration_with_layout); + iface->members = new Block; + parse_block(*iface->members, true, &Parser::parse_variable_declaration_with_layout); if(!check(";")) { iface->instance_name = expect_identifier();