[cfe-commits] r41321 - /cfe/trunk/Parse/ParseObjc.cpp
Anders Carlsson
andersca at mac.com
Thu Aug 23 08:31:37 PDT 2007
Author: andersca
Date: Thu Aug 23 10:31:37 2007
New Revision: 41321
URL: http://llvm.org/viewvc/llvm-project?rev=41321&view=rev
Log:
As suggested by Chris, use MatchRHSPunctuation instead of manually looking for a right parenthesis when parsing @encode() and @protocol().
Modified:
cfe/trunk/Parse/ParseObjc.cpp
Modified: cfe/trunk/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Parse/ParseObjc.cpp?rev=41321&r1=41320&r2=41321&view=diff
==============================================================================
--- cfe/trunk/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/Parse/ParseObjc.cpp Thu Aug 23 10:31:37 2007
@@ -677,13 +677,10 @@
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 @@
// 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;
More information about the cfe-commits
mailing list