Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fixes #310: properly recognize class methods

  • Loading branch information...
commit 3646ff2eb77eed8e30ac34e78e5e541c584044f0 1 parent 3377667
@incanus incanus authored
Showing with 2 additions and 1 deletion.
  1. +2 −1  Parsing/GBObjectiveCParser.m
View
3  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:@"("]) {
Please sign in to comment.
Something went wrong with that request. Please try again.