This changeset implements postfix comments "///<" for most elements: * @property * -/+ method declaration * -/+ method definition * NS_ENUM/NS_OPTION typedef * NE_ENUM/NS_OPTION keys Multi line postfix comments are supported within above elements. Postfix comments are ignored for classes, interfaces, protocols, etc. If both, a normal (prefix) and a postfix comment is available, the postfix comment is ignored.
The -[GBObjectiveCParser consumeMacro] method calls `[self.tokenizer consumeTo:@")" usingBlock:nil]` which eventually leads to a crash when calling the nil block. This behavior can be triggered with the `DEPRECATED_MSG_ATTRIBUTE` macro inside an enum, e.g. `UIBarStyleBlackOpaque DEPRECATED_MSG_ATTRIBUTE("Use UIBarStyleBlack") = 1`
…they have the same indentation.
…ives: to compile on 10.6 since NSRegularExpression is 10.7+ We default to processHeaderDoc disabled.
…and #163. As comment preprocessing method in `GBTokenizer` became quite large, I divided it into separate methods by taking out header doc preprocessing. Also made header doc preprocessing optional and disabled by default (except the bare minimum covered by #95). To enable it, use `--preprocess-headerdoc` command line switch. The reason for opting it out by default is amount of preprocessing that could break things for existing appledoc users. Probably just me being paranoid, but better safe than sorry :)
Added a few string manipulations that bring HeaderDoc comments closer in line with AppleDoc: 1. Makes sure that @param and @result are at the end of a comment before parsing. 2. Removes lines starting with @class, @method, @property, @protocol 3. Removes keywords that are not supported by AppleDoc such as @abstract and @discussion 4. Replaces @methodgroup and @group with @name
…#105. To allow Xcode properly open the file after selecting the warning in build list, it requires full path to it in the output, so I had to add full path to GBSourceInfo and use that when generating Xcode compatible log. Note that I had appledoc crashed inside `[GBLog logFormatterForLogFormat]` when using standard log formats. The problem was with sending the given format instance `lowercaseString` however in case numerical value was used, the actual instance was `NSNumber`. To compensate, additional check was added to make sure the instance is indeed a `NSString`. Strange no one reported this as I didn't touch this code since last pushing to GitHub (or everyone was hardly waiting for Xcode compatibility and are now using that mode :). Also added `xcode` log format option to help output and increased build number to 701.
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.
…tances. Method group sections are now properly detected even when followed by uncommented method. Previously we just assigned last found comment to the method, but now we check if the comment contains method group description and use it to create a new task section. This is more expected. Note that group matching regex was changed also to match only when found at the start of the comment. This is important as previously and word ending with `name` would be matched as group section...
The problem was in cases like this: /** comment */ @property (attributes) id commentedProperty; - (void)uncommentedMethod; After working on workaround for #43 (commit 4262bb8) forgot to reset comments when parsing methods and properties. Although above case worked properly in case of two methods (in fact there was a unit test specific for that situation and it passed), it didn't work if uncommented method (or property) followed commented property. This is correctly handled now, so it should work for both cases (added another unit test to cover above situation). Thanks to "BloodDragon" for pointing this one out.
The problem was two fold: template engine is specifically instructed to prevent any HTML escaping (otherwise using custom HTML tags within comment code wouldn't be possible), but this renders example blocks containing XML or HTML useless. To overcome this, example blocks are manually escaped by appledoc. Note that this required updating example blocks unit tests - changing to real settings provider as mock didn't do escaping... Second: GBTokenizer marked HTML/XML opening comment marker `<!--` as a delimiter and removed it from the string, leaving only the remaining text. This interfered with example blocks processing later on. This was actually a bug as delimiter should only be considered a line containing ONLY delimiter chars (at present the regex used was matching only from start of line)! Also added few more unit tests for validating example blocks prefixed with spaces are detected. Increased build number to 525.
Considering this example (provided by "PrimaryFeather", appledoc would fail assigning the comment to the class: /** Class description */ #ifdef __IPHONE_4_0 @interface SPBitmapFont : NSObject <NSXMLParserDelegate> #else @interface SPBitmapFont : NSObject #endif With this update, parses is able to attach the comment although with a twist by always assuming the first declaration as the valid one and ignoring all others. In other words: when using such solutions, make sure the first @interface (or @protocol) is the one you'd like to see in the generated documentation. For above example this means that documented class will list NSXMLParserDelegate as adopted protocol. Note that to properly handle this the solution was to persist any encountered comments during parsing and only update them when new comments are detected. However this lead to situations that any found comment would be used for all subsequent objects in the same file. Therefore I had to add manual resetting of comments after assigning them to an object. *Important:* Although all unit tests pass and generated documentation looks ok, this might require additional tweaking. Let's see if some more bug reports come...
Something broke while copying the project over from the old computer, so the simplest way to fix this was to pull from GitHub and copy all the files from the local backup...
…found (i.e. previous and last comment).
Comment delimiter regex included a hyphen at the middle inside char class. This was interpreted as a range of chars. Hyphen is now properly written at the end of character class declaration... Couldn't write a unit test to catch this!
…cription with full debug information, updated log messages to include more information about source and fixed appledoc target to make it compile. Note that at this point debug information simply returns description.
…hat can have comments attached.
…ll higher level parsing classes.
…entString: and instead requiring clients to pass in the "whole" GBComment object instead.
…se of the class.
This makes it accessible for all higher level parsing classes.