ccls/tests/objective-c/class.m

140 lines
3.5 KiB
Mathematica
Raw Normal View History

2017-12-19 04:39:45 +00:00
@interface AClass
+ (void)test;
2017-12-18 20:06:13 +00:00
- (void)anInstanceMethod;
@property (nonatomic) int aProp;
@end
@implementation AClass
2017-12-19 04:39:45 +00:00
- (void)anInstanceMethod {}
2017-12-18 20:06:13 +00:00
@end
int main(void)
{
AClass *instance = [AClass init];
[instance anInstanceMethod];
instance.aProp = 12;
}
/*
OUTPUT:
{
2017-12-19 04:39:45 +00:00
"includes": [],
2017-12-18 20:06:13 +00:00
"skipped_by_preprocessor": [],
"types": [{
"id": 0,
"usr": "c:objc(cs)AClass",
"short_name": "AClass",
"detailed_name": "AClass",
2017-12-19 04:39:45 +00:00
"definition_spelling": "7:17-7:23",
"definition_extent": "7:1-9:2",
2017-12-18 20:06:13 +00:00
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
2017-12-19 04:39:45 +00:00
"uses": ["1:12-1:18", "7:17-7:23", "13:3-13:9", "13:23-13:29"]
2017-12-18 20:06:13 +00:00
}],
"funcs": [{
"id": 0,
"is_operator": false,
2017-12-19 04:39:45 +00:00
"usr": "c:objc(cs)AClass(cm)test",
"short_name": "test",
"detailed_name": " AClass::test",
"declarations": [{
"spelling": "2:11-2:15",
"extent": "2:3-2:16",
"content": "+ (void)test;",
"param_spellings": []
}],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
"id": 1,
"is_operator": false,
2017-12-18 20:06:13 +00:00
"usr": "c:objc(cs)AClass(im)anInstanceMethod",
"short_name": "anInstanceMethod",
"detailed_name": " AClass::anInstanceMethod",
"declarations": [{
2017-12-19 04:39:45 +00:00
"spelling": "3:11-3:27",
"extent": "3:3-3:28",
2017-12-18 20:06:13 +00:00
"content": "- (void)anInstanceMethod;",
"param_spellings": []
}],
2017-12-19 04:39:45 +00:00
"definition_spelling": "8:9-8:25",
"definition_extent": "8:1-8:28",
2017-12-18 20:06:13 +00:00
"derived": [],
"locals": [],
2017-12-19 04:39:45 +00:00
"callers": ["4@14:13-14:29"],
2017-12-18 20:06:13 +00:00
"callees": []
}, {
2017-12-19 04:39:45 +00:00
"id": 2,
2017-12-18 20:06:13 +00:00
"is_operator": false,
"usr": "c:objc(cs)AClass(im)aProp",
"short_name": "aProp",
"detailed_name": " AClass::aProp",
"declarations": [{
"spelling": "0:0-0:0",
2017-12-19 04:39:45 +00:00
"extent": "4:29-4:34",
2017-12-18 20:06:13 +00:00
"content": "aProp",
"param_spellings": []
}],
"derived": [],
"locals": [],
"callers": [],
"callees": []
}, {
2017-12-19 04:39:45 +00:00
"id": 3,
2017-12-18 20:06:13 +00:00
"is_operator": false,
"usr": "c:objc(cs)AClass(im)setAProp:",
"short_name": "setAProp:",
"detailed_name": " AClass::setAProp:",
"declarations": [{
"spelling": "0:0-0:0",
2017-12-19 04:39:45 +00:00
"extent": "4:29-4:34",
2017-12-18 20:06:13 +00:00
"content": "aProp",
2017-12-19 04:39:45 +00:00
"param_spellings": ["4:29-4:34"]
2017-12-18 20:06:13 +00:00
}],
"derived": [],
"locals": [],
"callers": ["4@0:0-0:0"],
"callees": []
}, {
"id": 4,
"is_operator": false,
"usr": "c:@F@main#",
"short_name": "main",
"detailed_name": "int main()",
"declarations": [],
2017-12-19 04:39:45 +00:00
"definition_spelling": "11:5-11:9",
"definition_extent": "11:1-16:2",
2017-12-18 20:06:13 +00:00
"derived": [],
"locals": [],
"callers": [],
2017-12-19 04:39:45 +00:00
"callees": ["1@14:13-14:29", "3@0:0-0:0"]
2017-12-18 20:06:13 +00:00
}],
"vars": [{
"id": 0,
"usr": "c:objc(cs)AClass(py)aProp",
"short_name": "aProp",
"detailed_name": "int AClass::aProp",
2017-12-19 04:39:45 +00:00
"declaration": "4:29-4:34",
2017-12-18 20:06:13 +00:00
"is_local": true,
"is_macro": false,
2017-12-19 04:39:45 +00:00
"uses": ["4:29-4:34", "15:12-15:17"]
2017-12-18 20:06:13 +00:00
}, {
"id": 1,
2017-12-19 04:39:45 +00:00
"usr": "c:class.m@191@F@main#@instance",
2017-12-18 20:06:13 +00:00
"short_name": "instance",
"detailed_name": "AClass * instance",
2017-12-19 04:39:45 +00:00
"definition_spelling": "13:11-13:19",
"definition_extent": "13:3-13:35",
2017-12-18 20:06:13 +00:00
"is_local": true,
"is_macro": false,
2017-12-19 04:39:45 +00:00
"uses": ["13:11-13:19", "14:4-14:12", "15:3-15:11"]
2017-12-18 20:06:13 +00:00
}]
}
*/