[cfe-commits] r57804 - /cfe/trunk/lib/Parse/ParseObjc.cpp

Chris Lattner sabre at nondot.org
Sun Oct 19 23:15:14 PDT 2008


Author: lattner
Date: Mon Oct 20 01:15:13 2008
New Revision: 57804

URL: http://llvm.org/viewvc/llvm-project?rev=57804&view=rev
Log:
simplify some code by using ExpectAndConsume.  When an error
occurs, skip to an @ or ; instead of to a } or ;.  Properties
don't necessarily live in {}'s.

Modified:
    cfe/trunk/lib/Parse/ParseObjc.cpp

Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=57804&r1=57803&r2=57804&view=diff

==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Mon Oct 20 01:15:13 2008
@@ -310,20 +310,17 @@
       llvm::SmallVector<FieldDeclarator, 8> FieldDeclarators;
       ParseStructDeclaration(DS, FieldDeclarators);
       
-      if (Tok.is(tok::semi)) 
-        ConsumeToken();
-      else {
-        Diag(Tok, diag::err_expected_semi_decl_list);
-        SkipUntil(tok::r_brace, true, true);
-      }
+      ExpectAndConsume(tok::semi, diag::err_expected_semi_decl_list, "",
+                       tok::at);
+      
       // Convert them all to property declarations.
       for (unsigned i = 0, e = FieldDeclarators.size(); i != e; ++i) {
         FieldDeclarator &FD = FieldDeclarators[i];
         // Install the property declarator into interfaceDecl.
         Selector GetterSel = 
-        PP.getSelectorTable().getNullarySelector(OCDS.getGetterName() 
-                                                 ? OCDS.getGetterName() 
-                                                 : FD.D.getIdentifier());
+          PP.getSelectorTable().getNullarySelector(OCDS.getGetterName() 
+                                                   ? OCDS.getGetterName() 
+                                                   : FD.D.getIdentifier());
         IdentifierInfo *SetterName = OCDS.getSetterName();
         if (!SetterName)
           SetterName = constructSetterName(PP.getIdentifierTable(),





More information about the cfe-commits mailing list