Permalink
Browse files

Added basic support for headerdoc comments. Closes #95.

Note that this only adds support for headerdoc style comments (`/*! */`) and `@result` for return value. The tool could be further improved by ignoring unsupported headerdoc tags (like `@abstract`, `@class`, `@method` and similar), but I don't have time for that right now. Will close the issue for now as headerdoc comments can be extracted, and if there will be a lot of demand for this feature in the future, either this issue can be reopened or a new one created.

Also increased build number to 697.
  • Loading branch information...
1 parent b1a8bd0 commit 05b2e460a4aef7fb328502b3d10b99c8012a7726 @tomaz committed May 11, 2011
View
@@ -17,6 +17,6 @@
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
- <string>694</string>
+ <string>697</string>
</dict>
</plist>
@@ -138,7 +138,7 @@ - (NSDictionary *)appledocData {
result = [[NSMutableDictionary alloc] init];
[result setObject:@"appledoc" forKey:@"tool"];
[result setObject:@"2.0.3" forKey:@"version"];
- [result setObject:@"694" forKey:@"build"];
+ [result setObject:@"697" forKey:@"build"];
[result setObject:@"http://appledoc.gentlebytes.com" forKey:@"homepage"];
}
return result;
@@ -63,7 +63,7 @@ - (NSString *)parameterDescriptionRegex {
}
- (NSString *)returnDescriptionRegex {
- GBRETURN_ON_DEMAND([self descriptionCaptureRegexForKeyword:@"(?:return|returns)"]);
+ GBRETURN_ON_DEMAND([self descriptionCaptureRegexForKeyword:@"(?:return|returns|result)"]);
}
- (NSString *)exceptionDescriptionRegex {
View
@@ -56,7 +56,7 @@ - (id)initWithSourceTokenizer:(PKTokenizer *)tokenizer filename:(NSString *)file
if (self) {
self.settings = settings;
self.singleLineCommentRegex = @"(?m-s:\\s*///(.*)$)";
- self.multiLineCommentRegex = @"(?s:/\\*\\*(.*)\\*/)";
+ self.multiLineCommentRegex = @"(?s:/\\*[*!](.*)\\*/)";
self.commentDelimiterRegex = @"^[!@#$%^&*()_=+`~,<.>/?;:'\"-]{3,}$";
self.tokenIndex = 0;
self.lastCommentBuilder = [NSMutableString string];
@@ -22,6 +22,7 @@ - (BOOL)isAppledocComment {
if ([self isComment]) {
if ([[self stringValue] hasPrefix:@"///"]) return YES;
if ([[self stringValue] hasPrefix:@"/**"]) return YES;
+ if ([[self stringValue] hasPrefix:@"/*!"]) return YES;
}
return NO;
}

0 comments on commit 05b2e46

Please sign in to comment.