aboutsummaryrefslogtreecommitdiff
path: root/Parse/Parser.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2007-12-27 19:57:00 +0000
committerChris Lattner <sabre@nondot.org>2007-12-27 19:57:00 +0000
commitcb53b361bce341c8591333c6997f62e480acc0b4 (patch)
tree8104eda3fa8e7f8364dbd0acc39d2724361c015e /Parse/Parser.cpp
parentb5ce097bb741733e24efd7803f29849be227f8ce (diff)
- Use Tok.isObjCAtKeyword instead of Tok.getIdentifierInfo()->getObjCKeywordID().
The later fails if the token is not an identifier. - Replace tabs with spaces. - Various other cleanups. Patch by Nico Weber! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@45368 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'Parse/Parser.cpp')
-rw-r--r--Parse/Parser.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/Parse/Parser.cpp b/Parse/Parser.cpp
index 732311d6c2..2e15cbde04 100644
--- a/Parse/Parser.cpp
+++ b/Parse/Parser.cpp
@@ -374,8 +374,12 @@ Parser::DeclTy *Parser::ParseDeclarationOrFunctionDefinition() {
// ObjC2 allows prefix attributes on class interfaces.
if (getLang().ObjC2 && Tok.is(tok::at)) {
SourceLocation AtLoc = ConsumeToken(); // the "@"
- if (Tok.getIdentifierInfo()->getObjCKeywordID() == tok::objc_interface)
- return ParseObjCAtInterfaceDeclaration(AtLoc, DS.getAttributes());
+ if (!Tok.isObjCAtKeyword(tok::objc_interface)) {
+ Diag(Tok, diag::err_objc_expected_property_attr);//FIXME:better diagnostic
+ SkipUntil(tok::semi); // FIXME: better skip?
+ return 0;
+ }
+ return ParseObjCAtInterfaceDeclaration(AtLoc, DS.getAttributes());
}
// Parse the first declarator.