#pragma mark causing parsing errors #156

djehring opened this Issue Dec 4, 2011 · 2 comments

2 participants


Using the #pragma mark - directive will causes parsing errors in the file containing the directive. Will email you file demonstrating this.


Thanks, found the file, will check it when I get the time.


Tried your file and I can confirm the problem. This is a duplicate of #140 (probably, the report there is about assertion failure, which in your case doesn't happen, it's just a method is ommited in output), so I'm closing this ticket - am looking at the issue right now, if it turns out a simple fix will do it, otherwise it'll have to wait... Add a comment to #140 to be notified about progress.

@tomaz tomaz closed this Dec 9, 2011
@tomaz tomaz added a commit that referenced this issue Dec 9, 2011
@tomaz Implemented `#pragma mark -` handling. Closes #140 and #156.
The problem was in appledoc interpreting `-` after `#pragma mark` as start of instance method definiton/declaration and as it failed to match open parenthesis after, it skipped the rest of unmatched symbols until next match was found. This effectively resulted in first method or property after the pragma being skipped. The fix herein should handle these situations...

**Implementation note:** Note that the code first goes on and tries to match a method (due to minus sign). Method matching code was updated so that it skips repeating minus and plus until followed by an open parenthesis. This covered methods after pragma, but property definition still remained problematic. Although method matching properly exits once it finds `@property` token, the token is consumed before giving a chance of matching a property. Hence the code had to be updated to prevent consuming. This successfully parsed the property, however property matching code reset comments. So a class level flag was introduced that is set inside method matching code and is checked before resetting comment when parsing property; if flag is set, comments are not reset, otherwise they are. Not the prettiest solution, but (seems) to work...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment