llcppsigfetch:dump node type for unmarshal

This commit is contained in:
luoliwoshang
2024-08-28 18:50:05 +08:00
parent 7d0b47c5cb
commit 021ddefb10
11 changed files with 761 additions and 1 deletions

View File

@@ -2,50 +2,67 @@
TestClassDecl Case 1:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "A"
},
"Type": {
"_Type": "RecordType",
"Tag": 3,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "b"
}]
}]
@@ -61,104 +78,139 @@ TestClassDecl Case 1:
TestClassDecl Case 2:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "A"
},
"Type": {
"_Type": "RecordType",
"Tag": 3,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": true,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "b"
}]
}]
},
"Methods": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "A"
},
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 8,
"Flags": 16
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"_Type": "Ident",
"Name": "b"
}]
}]
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 8,
"Flags": 0
}
@@ -182,40 +234,55 @@ TestClassDecl Case 2:
TestClassDecl Case 3:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "A"
},
"Type": {
"_Type": "RecordType",
"Tag": 3,
"Fields": {
"_Type": "FieldList",
"List": []
},
"Methods": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "A"
},
"Name": {
"_Type": "Ident",
"Name": "A"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -229,23 +296,31 @@ TestClassDecl Case 3:
"IsVirtual": false,
"IsOverride": false
}, {
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "A"
},
"Name": {
"_Type": "Ident",
"Name": "A"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -259,23 +334,31 @@ TestClassDecl Case 3:
"IsVirtual": false,
"IsOverride": false
}, {
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "A"
},
"Name": {
"_Type": "Ident",
"Name": "~A"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -289,23 +372,31 @@ TestClassDecl Case 3:
"IsVirtual": false,
"IsOverride": false
}, {
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "A"
},
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -329,40 +420,55 @@ TestClassDecl Case 3:
TestClassDecl Case 4:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "Base"
},
"Type": {
"_Type": "RecordType",
"Tag": 3,
"Fields": {
"_Type": "FieldList",
"List": []
},
"Methods": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "Base"
},
"Name": {
"_Type": "Ident",
"Name": "Base"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -376,23 +482,31 @@ TestClassDecl Case 4:
"IsVirtual": false,
"IsOverride": false
}, {
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "Base"
},
"Name": {
"_Type": "Ident",
"Name": "~Base"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -406,23 +520,31 @@ TestClassDecl Case 4:
"IsVirtual": true,
"IsOverride": false
}, {
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "Base"
},
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -438,39 +560,53 @@ TestClassDecl Case 4:
}]
}
}, {
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "Derived"
},
"Type": {
"_Type": "RecordType",
"Tag": 3,
"Fields": {
"_Type": "FieldList",
"List": []
},
"Methods": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "Derived"
},
"Name": {
"_Type": "Ident",
"Name": "Derived"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -484,23 +620,31 @@ TestClassDecl Case 4:
"IsVirtual": false,
"IsOverride": false
}, {
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "Derived"
},
"Name": {
"_Type": "Ident",
"Name": "~Derived"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -514,23 +658,31 @@ TestClassDecl Case 4:
"IsVirtual": true,
"IsOverride": true
}, {
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "Derived"
},
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -554,49 +706,67 @@ TestClassDecl Case 4:
TestClassDecl Case 5:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "A"
},
"Name": {
"_Type": "Ident",
"Name": "Foo"
},
"Type": {
"_Type": "RecordType",
"Tag": 3,
"Fields": {
"_Type": "FieldList",
"List": []
},
"Methods": []
}
}, {
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "ScopingExpr",
"X": {
"_Type": "Ident",
"Name": "Foo"
},
"Parent": {
"_Type": "Ident",
"Name": "A"
}
},
"Name": {
"_Type": "Ident",
"Name": "bar"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}

View File

@@ -2,22 +2,30 @@
TestDoc Case 1:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -39,22 +47,30 @@ TestDoc Case 1:
TestDoc Case 2:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -76,24 +92,33 @@ TestDoc Case 2:
TestDoc Case 3:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": [{
"_Type": "Comment",
"Text": "/// doc"
}]
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -115,24 +140,33 @@ TestDoc Case 3:
TestDoc Case 4:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": [{
"_Type": "Comment",
"Text": "/** doc */"
}]
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -154,24 +188,33 @@ TestDoc Case 4:
TestDoc Case 5:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": [{
"_Type": "Comment",
"Text": "/*! doc */"
}]
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -193,26 +236,36 @@ TestDoc Case 5:
TestDoc Case 6:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": [{
"_Type": "Comment",
"Text": "/// doc 1"
}, {
"_Type": "Comment",
"Text": "/// doc 2"
}]
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -234,26 +287,36 @@ TestDoc Case 6:
TestDoc Case 7:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": [{
"_Type": "Comment",
"Text": "/*! doc 1 */"
}, {
"_Type": "Comment",
"Text": "/*! doc 2 */"
}]
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -275,26 +338,36 @@ TestDoc Case 7:
TestDoc Case 8:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": [{
"_Type": "Comment",
"Text": "/** doc 1 */"
}, {
"_Type": "Comment",
"Text": "/** doc 1 */"
}]
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -316,30 +389,42 @@ TestDoc Case 8:
TestDoc Case 9:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": [{
"_Type": "Comment",
"Text": "/**"
}, {
"_Type": "Comment",
"Text": " * doc 1"
}, {
"_Type": "Comment",
"Text": " * doc 2"
}, {
"_Type": "Comment",
"Text": " */"
}]
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}

View File

@@ -2,39 +2,54 @@
TestEnumDecl Case 1:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "EnumTypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "Foo"
},
"Type": {
"_Type": "EnumType",
"Items": [{
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "a"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "0"
}
}, {
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "b"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "1"
}
}, {
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "c"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "2"
}
@@ -49,39 +64,54 @@ TestEnumDecl Case 1:
TestEnumDecl Case 2:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "EnumTypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "Foo"
},
"Type": {
"_Type": "EnumType",
"Items": [{
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "a"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "1"
}
}, {
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "b"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "2"
}
}, {
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "c"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "4"
}
@@ -96,39 +126,54 @@ TestEnumDecl Case 2:
TestEnumDecl Case 3:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "EnumTypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "Foo"
},
"Type": {
"_Type": "EnumType",
"Items": [{
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "a"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "1"
}
}, {
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "b"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "2"
}
}, {
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "c"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "3"
}

View File

@@ -2,22 +2,30 @@
TestFuncDecl Case 1:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -39,38 +47,51 @@ TestFuncDecl Case 1:
TestFuncDecl Case 2:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}]
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -92,21 +113,30 @@ TestFuncDecl Case 2:
TestFuncDecl Case 3:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "Variadic"
},
"Doc": null,
"Comment": null,
@@ -114,24 +144,30 @@ TestFuncDecl Case 3:
"Access": 0,
"Names": []
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}]
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -153,55 +189,74 @@ TestFuncDecl Case 3:
TestFuncDecl Case 4:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 8,
"Flags": 16
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"_Type": "Ident",
"Name": "b"
}]
}]
},
"Ret": {
"_Type": "PointerType",
"X": {
"_Type": "BuiltinType",
"Kind": 8,
"Flags": 0
}
@@ -224,54 +279,72 @@ TestFuncDecl Case 4:
TestFuncDecl Case 5:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "add"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 0,
"Names": [{
"_Type": "Ident",
"Name": "b"
}]
}]
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
}

View File

@@ -2,22 +2,30 @@
TestScope Case 1:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -39,24 +47,33 @@ TestScope Case 1:
TestScope Case 2:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "a"
},
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -78,29 +95,40 @@ TestScope Case 2:
TestScope Case 3:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "ScopingExpr",
"X": {
"_Type": "Ident",
"Name": "b"
},
"Parent": {
"_Type": "Ident",
"Name": "a"
}
},
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -122,40 +150,55 @@ TestScope Case 3:
TestScope Case 4:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "a"
},
"Type": {
"_Type": "RecordType",
"Tag": 3,
"Fields": {
"_Type": "FieldList",
"List": []
},
"Methods": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "a"
},
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}
@@ -179,47 +222,65 @@ TestScope Case 4:
TestScope Case 5:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "Ident",
"Name": "a"
},
"Name": {
"_Type": "Ident",
"Name": "b"
},
"Type": {
"_Type": "RecordType",
"Tag": 3,
"Fields": {
"_Type": "FieldList",
"List": []
},
"Methods": [{
"_Type": "FuncDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": {
"_Type": "ScopingExpr",
"X": {
"_Type": "Ident",
"Name": "b"
},
"Parent": {
"_Type": "Ident",
"Name": "a"
}
},
"Name": {
"_Type": "Ident",
"Name": "foo"
},
"Type": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": []
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 0,
"Flags": 0
}

View File

@@ -2,32 +2,43 @@
TestStructDecl Case 1:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": null,
"Type": {
"_Type": "RecordType",
"Tag": 0,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}]
@@ -43,50 +54,67 @@ TestStructDecl Case 1:
TestStructDecl Case 2:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "A"
},
"Type": {
"_Type": "RecordType",
"Tag": 0,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "b"
}]
}]
@@ -102,50 +130,67 @@ TestStructDecl Case 2:
TestStructDecl Case 3:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "A"
},
"Type": {
"_Type": "RecordType",
"Tag": 0,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "b"
}]
}]
@@ -161,42 +206,60 @@ TestStructDecl Case 3:
TestStructDecl Case 4:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "A"
},
"Type": {
"_Type": "RecordType",
"Tag": 0,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "PointerType",
"X": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
@@ -206,7 +269,9 @@ TestStructDecl Case 4:
"Access": 0,
"Names": []
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
@@ -218,20 +283,24 @@ TestStructDecl Case 4:
}]
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
}
}
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "Foo"
}]
}]
@@ -247,86 +316,116 @@ TestStructDecl Case 4:
TestStructDecl Case 5:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "Person"
},
"Type": {
"_Type": "RecordType",
"Tag": 0,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "age"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "RecordType",
"Tag": 0,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "year"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "day"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "month"
}]
}]
@@ -334,14 +433,17 @@ TestStructDecl Case 5:
"Methods": []
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "birthday"
}]
}]

View File

@@ -2,18 +2,24 @@
TestTypeDefDecl Case 1:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypedefDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "INT"
},
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
}
@@ -26,33 +32,44 @@ TestTypeDefDecl Case 1:
TestTypeDefDecl Case 2:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypedefDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "INT"
},
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
}
}, {
"_Type": "TypedefDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "STANDARD_INT"
},
"Type": {
"_Type": "Ident",
"Name": "INT"
}
}],
@@ -64,22 +81,32 @@ TestTypeDefDecl Case 2:
TestTypeDefDecl Case 3:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypedefDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "Foo"
},
"Type": {
"_Type": "PointerType",
"X": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
@@ -89,7 +116,9 @@ TestTypeDefDecl Case 3:
"Access": 0,
"Names": []
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
@@ -99,7 +128,9 @@ TestTypeDefDecl Case 3:
"Access": 0,
"Names": []
}, {
"_Type": "Field",
"Type": {
"_Type": "Variadic"
},
"Doc": null,
"Comment": null,
@@ -109,6 +140,7 @@ TestTypeDefDecl Case 3:
}]
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
}

View File

@@ -2,48 +2,64 @@
TestUnionDecl Case 1:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": null,
"Type": {
"_Type": "RecordType",
"Tag": 1,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "b"
}]
}]
@@ -59,50 +75,67 @@ TestUnionDecl Case 1:
TestUnionDecl Case 2:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "A"
},
"Type": {
"_Type": "RecordType",
"Tag": 1,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "a"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "b"
}]
}]
@@ -118,86 +151,116 @@ TestUnionDecl Case 2:
TestUnionDecl Case 3:
{
"temp.h": {
"_Type": "File",
"decls": [{
"_Type": "TypeDecl",
"Loc": {
"_Type": "Location",
"File": "temp.h"
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Parent": null,
"Name": {
"_Type": "Ident",
"Name": "OuterUnion"
},
"Type": {
"_Type": "RecordType",
"Tag": 1,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "i"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 8,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "f"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "RecordType",
"Tag": 1,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 2,
"Flags": 1
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "c"
}]
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 32
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "s"
}]
}]
@@ -205,14 +268,17 @@ TestUnionDecl Case 3:
"Methods": []
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "inner"
}]
}]

View File

@@ -2,11 +2,14 @@
TestDefine Case 1:
{
"temp.h": {
"_Type": "File",
"decls": [],
"includes": [],
"macros": [{
"_Type": "Macro",
"Name": "DEBUG",
"Tokens": [{
"_Type": "Token",
"Token": 3,
"Lit": "DEBUG"
}]
@@ -17,14 +20,18 @@ TestDefine Case 1:
TestDefine Case 2:
{
"temp.h": {
"_Type": "File",
"decls": [],
"includes": [],
"macros": [{
"_Type": "Macro",
"Name": "OK",
"Tokens": [{
"_Type": "Token",
"Token": 3,
"Lit": "OK"
}, {
"_Type": "Token",
"Token": 4,
"Lit": "1"
}]
@@ -35,47 +42,62 @@ TestDefine Case 2:
TestDefine Case 3:
{
"temp.h": {
"_Type": "File",
"decls": [],
"includes": [],
"macros": [{
"_Type": "Macro",
"Name": "SQUARE",
"Tokens": [{
"_Type": "Token",
"Token": 3,
"Lit": "SQUARE"
}, {
"_Type": "Token",
"Token": 1,
"Lit": "("
}, {
"_Type": "Token",
"Token": 3,
"Lit": "x"
}, {
"_Type": "Token",
"Token": 1,
"Lit": ")"
}, {
"_Type": "Token",
"Token": 1,
"Lit": "("
}, {
"_Type": "Token",
"Token": 1,
"Lit": "("
}, {
"_Type": "Token",
"Token": 3,
"Lit": "x"
}, {
"_Type": "Token",
"Token": 1,
"Lit": ")"
}, {
"_Type": "Token",
"Token": 1,
"Lit": "*"
}, {
"_Type": "Token",
"Token": 1,
"Lit": "("
}, {
"_Type": "Token",
"Token": 3,
"Lit": "x"
}, {
"_Type": "Token",
"Token": 1,
"Lit": ")"
}, {
"_Type": "Token",
"Token": 1,
"Lit": ")"
}]
@@ -86,8 +108,10 @@ TestDefine Case 3:
TestInclude Case 1:
{
"temp.h": {
"_Type": "File",
"decls": [],
"includes": [{
"_Type": "Include",
"Path": "foo.h"
}],
"macros": []

View File

@@ -28,16 +28,22 @@ Complex:flags:20 kind:11
Unknown:flags:0 kind:0
Type: char *:
{
"_Type": "PointerType",
"X": {
"_Type": "BuiltinType",
"Kind": 2,
"Flags": 1
}
}
Type: char ***:
{
"_Type": "PointerType",
"X": {
"_Type": "PointerType",
"X": {
"_Type": "PointerType",
"X": {
"_Type": "BuiltinType",
"Kind": 2,
"Flags": 1
}
@@ -46,7 +52,9 @@ Type: char ***:
}
Type: char[]:
{
"_Type": "ArrayType",
"Elt": {
"_Type": "BuiltinType",
"Kind": 2,
"Flags": 1
},
@@ -54,75 +62,97 @@ Type: char[]:
}
Type: char[10]:
{
"_Type": "ArrayType",
"Elt": {
"_Type": "BuiltinType",
"Kind": 2,
"Flags": 1
},
"Len": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "10"
}
}
Type: char[3][4]:
{
"_Type": "ArrayType",
"Elt": {
"_Type": "ArrayType",
"Elt": {
"_Type": "BuiltinType",
"Kind": 2,
"Flags": 1
},
"Len": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "4"
}
},
"Len": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "3"
}
}
Type: int &:
{
"_Type": "LvalueRefType",
"X": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
}
}
Type: int &&:
{
"_Type": "LvalueRefType",
"X": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
}
}
Type: Foo:
{
"_Type": "Ident",
"Name": "Foo"
}
Type: struct Foo:
{
"_Type": "TagExpr",
"Name": {
"_Type": "Ident",
"Name": "Foo"
},
"Tag": 0
}
Type: struct (unnamed struct at temp.h:1:1):
{
"_Type": "RecordType",
"Tag": 0,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "x"
}]
}]
@@ -131,33 +161,43 @@ Type: struct (unnamed struct at temp.h:1:1):
}
Type: Foo:
{
"_Type": "Ident",
"Name": "Foo"
}
Type: union Foo:
{
"_Type": "TagExpr",
"Name": {
"_Type": "Ident",
"Name": "Foo"
},
"Tag": 1
}
Type: union (unnamed union at temp.h:1:1):
{
"_Type": "RecordType",
"Tag": 1,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 1,
"Names": [{
"_Type": "Ident",
"Name": "x"
}]
}]
@@ -166,22 +206,29 @@ Type: union (unnamed union at temp.h:1:1):
}
Type: Foo:
{
"_Type": "Ident",
"Name": "Foo"
}
Type: enum Foo:
{
"_Type": "TagExpr",
"Name": {
"_Type": "Ident",
"Name": "Foo"
},
"Tag": 2
}
Type: enum (unnamed enum at temp.h:1:1):
{
"_Type": "EnumType",
"Items": [{
"_Type": "EnumItem",
"Name": {
"_Type": "Ident",
"Name": "x"
},
"Value": {
"_Type": "BasicLit",
"Kind": 0,
"Value": "42"
}
@@ -189,33 +236,43 @@ Type: enum (unnamed enum at temp.h:1:1):
}
Type: Foo:
{
"_Type": "Ident",
"Name": "Foo"
}
Type: class Foo:
{
"_Type": "TagExpr",
"Name": {
"_Type": "Ident",
"Name": "Foo"
},
"Tag": 3
}
Type: class (unnamed class at temp.h:1:1):
{
"_Type": "RecordType",
"Tag": 3,
"Fields": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
"Doc": {
"_Type": "CommentGroup",
"List": []
},
"Comment": {
"_Type": "CommentGroup",
"List": []
},
"IsStatic": false,
"Access": 3,
"Names": [{
"_Type": "Ident",
"Name": "x"
}]
}]
@@ -224,29 +281,40 @@ Type: class (unnamed class at temp.h:1:1):
}
Type: a::b::c:
{
"_Type": "ScopingExpr",
"X": {
"_Type": "Ident",
"Name": "c"
},
"Parent": {
"_Type": "ScopingExpr",
"X": {
"_Type": "Ident",
"Name": "b"
},
"Parent": {
"_Type": "Ident",
"Name": "a"
}
}
}
Type: class a::b::c:
{
"_Type": "TagExpr",
"Name": {
"_Type": "ScopingExpr",
"X": {
"_Type": "Ident",
"Name": "c"
},
"Parent": {
"_Type": "ScopingExpr",
"X": {
"_Type": "Ident",
"Name": "b"
},
"Parent": {
"_Type": "Ident",
"Name": "a"
}
}
@@ -255,10 +323,15 @@ Type: class a::b::c:
}
Type: int (*)(int, char):
{
"_Type": "PointerType",
"X": {
"_Type": "FuncType",
"Params": {
"_Type": "FieldList",
"List": [{
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
},
@@ -268,7 +341,9 @@ Type: int (*)(int, char):
"Access": 0,
"Names": []
}, {
"_Type": "Field",
"Type": {
"_Type": "BuiltinType",
"Kind": 2,
"Flags": 1
},
@@ -280,6 +355,7 @@ Type: int (*)(int, char):
}]
},
"Ret": {
"_Type": "BuiltinType",
"Kind": 6,
"Flags": 0
}