forked from OSchip/llvm-project
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:
parent
e01493d47b
commit
cb8f832c26
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue