2017-04-03 01:34:15 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "../../third_party/doctest/doctest/doctest.h"
|
|
|
|
#include "../../third_party/macro_map.h"
|
|
|
|
#include "../../third_party/optional.h"
|
|
|
|
#include <rapidjson/rapidjson.h>
|
|
|
|
#include <rapidjson/document.h>
|
|
|
|
#include <rapidjson/prettywriter.h>
|
|
|
|
|
|
|
|
struct Base {};
|
|
|
|
|
|
|
|
struct SameFileDerived : Base {};
|
|
|
|
|
|
|
|
using Foo0 = SameFileDerived;
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
void Foo1() {}
|
|
|
|
|
|
|
|
template <typename T>
|
|
|
|
struct Foo2 {};
|
|
|
|
|
|
|
|
enum Foo3 { A, B, C };
|
|
|
|
|
|
|
|
int Foo4;
|
|
|
|
static int Foo5;
|
|
|
|
|
|
|
|
/*
|
|
|
|
OUTPUT:
|
|
|
|
{
|
|
|
|
"types": [{
|
|
|
|
"id": 0,
|
|
|
|
"usr": "c:@S@Base",
|
|
|
|
"short_name": "Base",
|
|
|
|
"qualified_name": "Base",
|
2017-04-05 08:29:15 +00:00
|
|
|
"definition_spelling": "10:8-10:12",
|
|
|
|
"definition_extent": "10:1-10:15",
|
2017-04-03 01:34:15 +00:00
|
|
|
"derived": [1],
|
2017-04-05 08:29:15 +00:00
|
|
|
"uses": ["*10:8-10:12", "*12:26-12:30"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 1,
|
|
|
|
"usr": "c:@S@SameFileDerived",
|
|
|
|
"short_name": "SameFileDerived",
|
|
|
|
"qualified_name": "SameFileDerived",
|
2017-04-05 08:29:15 +00:00
|
|
|
"definition_spelling": "12:8-12:23",
|
|
|
|
"definition_extent": "12:1-12:33",
|
2017-04-03 01:34:15 +00:00
|
|
|
"parents": [0],
|
2017-04-05 08:29:15 +00:00
|
|
|
"uses": ["*12:8-12:23", "*14:14-14:29"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 2,
|
|
|
|
"usr": "c:@Foo0",
|
|
|
|
"short_name": "Foo0",
|
|
|
|
"qualified_name": "Foo0",
|
2017-04-05 08:29:15 +00:00
|
|
|
"definition_spelling": "14:7-14:11",
|
|
|
|
"definition_extent": "14:1-14:29",
|
2017-04-03 01:34:15 +00:00
|
|
|
"alias_of": 1,
|
2017-04-05 08:29:15 +00:00
|
|
|
"uses": ["*14:7-14:11"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 3,
|
|
|
|
"usr": "c:@ST>1#T@Foo2",
|
|
|
|
"short_name": "Foo2",
|
|
|
|
"qualified_name": "Foo2",
|
2017-04-05 08:29:15 +00:00
|
|
|
"definition_spelling": "20:8-20:12",
|
|
|
|
"definition_extent": "20:1-20:15",
|
|
|
|
"uses": ["*20:8-20:12"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 4,
|
|
|
|
"usr": "c:@E@Foo3",
|
|
|
|
"short_name": "Foo3",
|
|
|
|
"qualified_name": "Foo3",
|
2017-04-05 08:29:15 +00:00
|
|
|
"definition_spelling": "22:6-22:10",
|
|
|
|
"definition_extent": "22:1-22:22",
|
2017-04-03 01:34:15 +00:00
|
|
|
"vars": [0, 1, 2],
|
2017-04-05 08:29:15 +00:00
|
|
|
"uses": ["*22:6-22:10"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}],
|
|
|
|
"funcs": [{
|
|
|
|
"id": 0,
|
|
|
|
"usr": "c:@FT@>1#TFoo1#v#",
|
|
|
|
"short_name": "Foo1",
|
|
|
|
"qualified_name": "Foo1",
|
2017-04-05 08:29:15 +00:00
|
|
|
"definition_spelling": "17:6-17:10",
|
|
|
|
"definition_extent": "17:1-17:12",
|
|
|
|
"uses": ["17:6-17:10"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}],
|
|
|
|
"vars": [{
|
|
|
|
"id": 0,
|
|
|
|
"usr": "c:@E@Foo3@A",
|
|
|
|
"short_name": "A",
|
|
|
|
"qualified_name": "Foo3::A",
|
2017-04-05 08:29:15 +00:00
|
|
|
"definition_spelling": "22:13-22:14",
|
|
|
|
"definition_extent": "22:13-22:14",
|
2017-04-03 01:34:15 +00:00
|
|
|
"variable_type": 4,
|
|
|
|
"declaring_type": 4,
|
2017-04-05 08:29:15 +00:00
|
|
|
"uses": ["22:13-22:14"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 1,
|
|
|
|
"usr": "c:@E@Foo3@B",
|
|
|
|
"short_name": "B",
|
|
|
|
"qualified_name": "Foo3::B",
|
2017-04-05 08:29:15 +00:00
|
|
|
"definition_spelling": "22:16-22:17",
|
|
|
|
"definition_extent": "22:16-22:17",
|
2017-04-03 01:34:15 +00:00
|
|
|
"variable_type": 4,
|
|
|
|
"declaring_type": 4,
|
2017-04-05 08:29:15 +00:00
|
|
|
"uses": ["22:16-22:17"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 2,
|
|
|
|
"usr": "c:@E@Foo3@C",
|
|
|
|
"short_name": "C",
|
|
|
|
"qualified_name": "Foo3::C",
|
2017-04-05 08:29:15 +00:00
|
|
|
"definition_spelling": "22:19-22:20",
|
|
|
|
"definition_extent": "22:19-22:20",
|
2017-04-03 01:34:15 +00:00
|
|
|
"variable_type": 4,
|
|
|
|
"declaring_type": 4,
|
2017-04-05 08:29:15 +00:00
|
|
|
"uses": ["22:19-22:20"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 3,
|
|
|
|
"usr": "c:@Foo4",
|
|
|
|
"short_name": "Foo4",
|
|
|
|
"qualified_name": "Foo4",
|
2017-04-05 08:29:15 +00:00
|
|
|
"definition_spelling": "24:5-24:9",
|
|
|
|
"definition_extent": "24:1-24:9",
|
|
|
|
"uses": ["24:5-24:9"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}, {
|
|
|
|
"id": 4,
|
|
|
|
"usr": "c:header.h@Foo5",
|
|
|
|
"short_name": "Foo5",
|
|
|
|
"qualified_name": "Foo5",
|
2017-04-05 08:29:15 +00:00
|
|
|
"definition_spelling": "25:12-25:16",
|
|
|
|
"definition_extent": "25:1-25:16",
|
|
|
|
"uses": ["25:12-25:16"]
|
2017-04-03 01:34:15 +00:00
|
|
|
}]
|
|
|
|
}
|
|
|
|
*/
|