ccls/tests/objective-c/class.m

164 lines
4.1 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-22 16:46:22 +00:00
+ (void)test {}
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",
2017-12-22 16:46:22 +00:00
"definition_extent": "7:1-10:2",
2017-12-18 20:06:13 +00:00
"parents": [],
"derived": [],
"types": [],
"funcs": [],
"vars": [],
"instances": [],
2017-12-22 16:46:22 +00:00
"uses": ["1:12-1:18", "7:17-7:23", "14:3-14:9", "14:23-14: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",
2017-12-23 15:36:08 +00:00
"detailed_name": " AClass::test",
2017-12-19 04:39:45 +00:00
"declarations": [{
"spelling": "2:11-2:15",
"extent": "2:3-2:16",
"content": "+ (void)test;",
"param_spellings": []
}],
2017-12-22 16:46:22 +00:00
"definition_spelling": "8:9-8:13",
"definition_extent": "8:1-8:16",
2017-12-19 06:15:46 +00:00
"base": [],
2017-12-19 04:39:45 +00:00
"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",
2017-12-23 15:36:08 +00:00
"detailed_name": " AClass::anInstanceMethod",
2017-12-18 20:06:13 +00:00
"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-22 16:46:22 +00:00
"definition_spelling": "9:9-9:25",
"definition_extent": "9:1-9:28",
2017-12-19 06:15:46 +00:00
"base": [],
2017-12-18 20:06:13 +00:00
"derived": [],
"locals": [],
2017-12-22 16:46:22 +00:00
"callers": ["4@15:13-15: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",
2017-12-23 15:36:08 +00:00
"detailed_name": " AClass::aProp",
2017-12-18 20:06:13 +00:00
"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": []
}],
2017-12-19 06:15:46 +00:00
"base": [],
2017-12-18 20:06:13 +00:00
"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:",
2017-12-23 15:36:08 +00:00
"detailed_name": " AClass::setAProp:",
2017-12-18 20:06:13 +00:00
"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
}],
2017-12-19 06:15:46 +00:00
"base": [],
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-22 16:46:22 +00:00
"definition_spelling": "12:5-12:9",
"definition_extent": "12:1-17:2",
2017-12-19 06:15:46 +00:00
"base": [],
2017-12-18 20:06:13 +00:00
"derived": [],
"locals": [],
"callers": [],
2017-12-22 16:46:22 +00:00
"callees": ["1@15:13-15: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",
2017-12-23 15:36:08 +00:00
"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-23 02:10:23 +00:00
"is_global": false,
"is_member": false,
2017-12-22 16:46:22 +00:00
"uses": ["4:29-4:34", "16:12-16:17"]
2017-12-18 20:06:13 +00:00
}, {
"id": 1,
2017-12-22 16:46:22 +00:00
"usr": "c:objc(cs)AClass@_aProp",
"short_name": "_aProp",
2017-12-23 15:36:08 +00:00
"detailed_name": "int AClass::_aProp",
2017-12-22 16:46:22 +00:00
"definition_spelling": "4:29-4:34",
"definition_extent": "4:29-4:34",
"is_local": true,
"is_macro": false,
2017-12-23 02:10:23 +00:00
"is_global": false,
"is_member": false,
2017-12-22 16:46:22 +00:00
"uses": ["4:29-4:34"]
}, {
"id": 2,
2017-12-23 15:36:08 +00:00
"usr": "c:class.m@208@F@main#@instance",
2017-12-18 20:06:13 +00:00
"short_name": "instance",
"detailed_name": "AClass * instance",
2017-12-22 16:46:22 +00:00
"definition_spelling": "14:11-14:19",
"definition_extent": "14:3-14:35",
2017-12-18 20:06:13 +00:00
"is_local": true,
"is_macro": false,
2017-12-23 02:10:23 +00:00
"is_global": false,
"is_member": false,
2017-12-22 16:46:22 +00:00
"uses": ["14:11-14:19", "15:4-15:12", "16:3-16:11"]
2017-12-18 20:06:13 +00:00
}]
}
*/