Permalink
Browse files

Merge pull request #314 from incanus/master

fixed #310: properly recognize class methods
  • Loading branch information...
2 parents 3377667 + 3646ff2 commit 30a0119ebfc2c134a256bad0b3c3ecba58e41ab7 @tomaz committed Feb 17, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 Parsing/GBObjectiveCParser.m
@@ -459,13 +459,14 @@ - (BOOL)matchMethodDataForProvider:(GBMethodsProvider *)provider from:(NSString
__block BOOL assertMethod = YES;
__block BOOL result = NO;
__block GBSourceInfo *filedata = nil;
- GBMethodType methodType = [start isEqualToString:@"-"] ? GBMethodTypeInstance : GBMethodTypeClass;
+ __block GBMethodType methodType = [start isEqualToString:@"-"] ? GBMethodTypeInstance : GBMethodTypeClass;
[self updateLastComment:&comment sectionComment:&sectionComment sectionName:&sectionName];
[self.tokenizer consumeFrom:start to:end usingBlock:^(PKToken *token, BOOL *consume, BOOL *stop) {
// In order to provide at least some assurance the minus or plus actually starts the method, we validate next token is opening parenthesis. Very simple so might need some refinement... Note that we skip subsequent - or + tokens so that we can handle stuff like '#pragma mark -' gracefully (note that we also do it for + although that shouldn't be necessary, but feels safer).
if (assertMethod) {
if ([token matches:@"-"] || [token matches:@"+"]) {
[self updateLastComment:&comment sectionComment:&sectionComment sectionName:&sectionName];
+ methodType = [token matches:@"-"] ? GBMethodTypeInstance : GBMethodTypeClass;
return;
}
if (![token matches:@"("]) {

0 comments on commit 30a0119

Please sign in to comment.