Permalink
Browse files

Parsing for objc shortcuts is not less strict. Closes #194.

The problem was in appledoc expecting to have either both or neither of variable name and type keywords for a method argument. So this would pass `-(void)method:`, but this not `-(void)method:var`. The fix is simple: just assume the argument is `id`. So later example would transform internally to `-(void)method:(id)var`. Which is probably what Objective C compiler does too.

Have no idea why I didn't think of this before, it's much less restricting (although probably not the recommended way of doing things in ObjC, but that's whole other topic I guess :)
  • Loading branch information...
1 parent 1cff516 commit d0b2c173877a7cf4436d1e897620d00aa3a335ce @tomaz committed Feb 28, 2012
Showing with 3 additions and 3 deletions.
  1. +1 −1 AppledocTests-Info.plist
  2. +1 −1 Application/GBApplicationStringsProvider.m
  3. +1 −1 Model/GBMethodArgument.m
View
@@ -17,6 +17,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>774</string>
+ <string>775</string>
</dict>
</plist>
@@ -139,7 +139,7 @@ - (NSDictionary *)appledocData {
result = [[NSMutableDictionary alloc] init];
[result setObject:@"appledoc" forKey:@"tool"];
[result setObject:@"2.0.5" forKey:@"version"];
- [result setObject:@"774" forKey:@"build"];
+ [result setObject:@"775" forKey:@"build"];
[result setObject:@"http://appledoc.gentlebytes.com" forKey:@"homepage"];
}
return result;
View
@@ -26,7 +26,7 @@ + (id)methodArgumentWithName:(NSString *)name {
- (id)initWithName:(NSString *)name types:(NSArray *)types var:(NSString *)var variableArg:(BOOL)variableArg terminationMacros:(NSArray *)macros {
NSParameterAssert(name != nil);
- NSParameterAssert(([types count] == 0 && var == nil) || ([types count] > 0 && var != nil));
+ if ([types count] == 0 && var != nil) types = [NSArray arrayWithObject:@"id"];
self = [super init];
if (self) {
_argumentName = [name copy];

0 comments on commit d0b2c17

Please sign in to comment.