Please sign in to comment.
Fixed comments parsing for non-trivial sources. Closes #43.
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...
- Loading branch information...
Showing with 160 additions and 10 deletions.
- +1 −1 Model/GBMethodsProvider.h
- +1 −0 Model/GBMethodsProvider.m
- +6 −1 Parsing/GBObjectiveCParser.m
- +15 −2 Parsing/GBTokenizer.h
- +5 −2 Parsing/GBTokenizer.m
- +8 −0 Testing/GBMethodsProviderTesting.m
- +32 −0 Testing/GBObjectiveCParser-CategoryParsingTesting.m
- +32 −0 Testing/GBObjectiveCParser-ClassParsingTesting.m
- +13 −0 Testing/GBObjectiveCParser-MethodsParsingTesting.m
- +32 −1 Testing/GBObjectiveCParser-ProtocolParsingTesting.m
- +15 −3 Testing/GBTokenizerTesting.m