As suggested by Chris, use MatchRHSPunctuation instead of manually looking for a right parenthesis when parsing @encode() and @protocol().

llvm-svn: 41321
This commit is contained in:
Anders Carlsson 2007-08-23 15:31:37 +00:00
parent e01493d47b
commit cb8f832c26
1 changed files with 3 additions and 11 deletions

View File

@ -677,13 +677,10 @@ Parser::ExprResult Parser::ParseObjCEncodeExpression() {
TypeTy *Ty = ParseTypeName();
if (Tok.getKind() != tok::r_paren) {
Diag(Tok, diag::err_expected_rparen);
return true;
}
SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
return Actions.ParseObjCEncodeExpression(EncLoc, LParenLoc, Ty,
ConsumeParen());
RParenLoc);
}
/// objc-protocol-expression
@ -708,12 +705,7 @@ Parser::ExprResult Parser::ParseObjCProtocolExpression()
// FIXME: Do something with the protocol name
ConsumeToken();
if (Tok.getKind() != tok::r_paren) {
Diag(Tok, diag::err_expected_rparen);
return true;
}
ConsumeParen();
SourceLocation RParenLoc = MatchRHSPunctuation(tok::r_paren, LParenLoc);
// FIXME
return 0;