Split Objective-C keyword parsing to handle the '@' separately.

Because apparently, while designing the Objective-C language, somebody
thought it was a world-class idea to allow any white-space between the
'@' character and the subsequent keyword. With this fix, we now
correctly parse:
    @  dynamic
and:
    @
      selector
and:
    @"foo"
     "bar"
    @"mooze"
(This last one is 1 single string split over multiple lines.)
Wonderful, isn't it?

What we (and Clang) do not support, but what GCC supports is something
like:
   @"foo"@@  "bar"  @"mooze"  @@
which is equivalent to @"foobarmooze".
This commit is contained in:
Erik Verbruggen
2010-02-14 14:41:51 +01:00
parent abdd404ff5
commit 2a59d2ae0c
14 changed files with 410 additions and 367 deletions

View File

@@ -71,7 +71,7 @@ bool SimpleToken::isComment() const
bool SimpleToken::isObjCAtKeyword() const
{
return _kind >= T_FIRST_OBJC_AT_KEYWORD && _kind <= T_LAST_OBJC_AT_KEYWORD;
return _kind >= T_FIRST_OBJC_KEYWORD && _kind <= T_LAST_OBJC_KEYWORD;
}
const char *SimpleToken::name() const