mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-22 16:33:29 +00:00
NS_OPTIONS support
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@40407 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
871b9059ef
commit
02688abdb6
1 changed files with 12 additions and 10 deletions
|
@ -1402,26 +1402,28 @@ recheck:
|
|||
if ([s isEqualToString: @"struct"] == YES
|
||||
|| [s isEqualToString: @"union"] == YES
|
||||
|| [s isEqualToString: @"enum"] == YES
|
||||
|| [s isEqualToString: @"NS_ENUM"] == YES)
|
||||
|| [s isEqualToString: @"NS_ENUM"] == YES
|
||||
|| [s isEqualToString: @"NS_OPTIONS"] == YES)
|
||||
{
|
||||
BOOL isEnum = NO;
|
||||
NSString *tmp = s;
|
||||
|
||||
if ([s isEqualToString: @"NS_ENUM"])
|
||||
if ([s isEqualToString: @"NS_ENUM"]
|
||||
|| [s isEqualToString: @"NS_OPTIONS"])
|
||||
{
|
||||
if ([self skipSpaces] < length && buffer[pos] == '(')
|
||||
if ([self parseSpace] < length && buffer[pos] == '(')
|
||||
{
|
||||
pos++;
|
||||
[self skipSpaces];
|
||||
[self parseSpace];
|
||||
s = [self parseIdentifier];
|
||||
if (nil != s && [self skipSpaces] < length
|
||||
if (nil != s && [self parseSpace] < length
|
||||
&& buffer[pos] == ',')
|
||||
{
|
||||
tmp = [@"NS_ENUM" stringByAppendingFormat: @"(%@)", s];
|
||||
tmp = [tmp stringByAppendingFormat: @"(%@)", s];
|
||||
pos++;
|
||||
[self skipSpaces];
|
||||
[self parseSpace];
|
||||
s = [self parseIdentifier];
|
||||
if (nil != s && [self skipSpaces] < length
|
||||
if (nil != s && [self parseSpace] < length
|
||||
&& buffer[pos] == ')')
|
||||
{
|
||||
isEnum = YES;
|
||||
|
@ -1433,7 +1435,7 @@ recheck:
|
|||
}
|
||||
if (NO == isEnum)
|
||||
{
|
||||
[self log: @"messed up NS_ENUM declaration"];
|
||||
[self log: @"messed up NS_ENUM/NS_OPTIONS declaration"];
|
||||
[arp drain];
|
||||
return nil;
|
||||
}
|
||||
|
@ -1459,7 +1461,7 @@ recheck:
|
|||
}
|
||||
}
|
||||
|
||||
/* We parse enum comment of the form:
|
||||
/* We parse enum and options comment of the form:
|
||||
* <introComment> enum { <comment1> field1, <comment2> field2 } bla;
|
||||
*/
|
||||
if (isEnum && [self parseSpace] < length && buffer[pos] == '{')
|
||||
|
|
Loading…
Reference in a new issue