Commit debe2a0d authored by Roberto Raggi's avatar Roberto Raggi
Browse files

Fixes: Parsing of objc protocol expressions.

parent 26560ca9
......@@ -2583,7 +2583,7 @@ bool Parser::parseObjCExpression(ExpressionAST *&node)
return parseObjCEncodeExpression(node);
case T_AT_PROTOCOL:
break;
return parseObjCProtocolExpression(node);
case T_AT_SELECTOR:
break;
......@@ -2610,6 +2610,19 @@ bool Parser::parseObjCEncodeExpression(ExpressionAST *&)
return true;
}
bool Parser::parseObjCProtocolExpression(ExpressionAST *&)
{
if (LA() != T_AT_PROTOCOL)
return false;
/*unsigned protocol_token = */ consumeToken();
unsigned lparen_token = 0, identifier_token = 0, rparen_token = 0;
match(T_LPAREN, &lparen_token);
match(T_IDENTIFIER, &identifier_token);
match(T_RPAREN, &rparen_token);
return true;
}
bool Parser::parseNameId(NameAST *&name)
{
unsigned start = cursor();
......
......@@ -219,6 +219,7 @@ public:
SpecifierAST *attributes = 0);
bool parseObjCEncodeExpression(ExpressionAST *&node);
bool parseObjCProtocolExpression(ExpressionAST *&node);
bool parseObjCProtocolRefs();
bool parseObjClassInstanceVariables();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment