objective-c-parser
objective-c-parser copied to clipboard
Parse properties, superclass and conforming protocols
This PR aims to implement support for parsing @\property declarations, an interface’s superclass and conforming protocols.
The following header-file:
@interface BasicName : NSObject <Ponies, Foo>
// Another comment
@property(nonatomic, readonly) NSArray<NSString *> titles;
// This is the comment of basic method one
- (NSInteger)basicMethodOne;
@end
…will be parsed into:
{
"name": "BasicName",
"superclass": "NSObject",
"protocols": ["Ponies", "Foo"],
"properties": [
{
"attributes": ["nonatomic", "readonly"],
"name": "titles",
"type": "NSArray<NSString *>"
}
],
"methods": [
{
"args": [],
"comment": "This is the comment of basic method one",
"name": "basicMethodOne",
"returnType": "NSInteger"
}
]
}
Please let me know if there is anything you would like to change or supplement.