Author: rfm
Date: Tue Mar 21 10:28:45 2017
New Revision: 40407
URL: http://svn.gna.org/viewcvs/gnustep?rev=40407&view=rev
Log:
NS_OPTIONS support
Modified:
libs/base/trunk/Tools/AGSParser.m
Modified: libs/base/trunk/Tools/AGSParser.m
URL:
http://svn.gna.org/viewcvs/gnustep/libs/base/trunk/Tools/AGSParser.m?rev=40407&r1=40406&r2=40407&view=diff
==============================================================================
--- libs/base/trunk/Tools/AGSParser.m (original)
+++ libs/base/trunk/Tools/AGSParser.m Tue Mar 21 10:28:45 2017
@@ -1402,26 +1402,28 @@
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 @@
}
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 @@
}
}
- /* 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] == '{')
_______________________________________________
Gnustep-cvs mailing list
[email protected]
https://mail.gna.org/listinfo/gnustep-cvs