diff --git a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/class_test/llgo.expect b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/class_test/llgo.expect index f7435e0b..bf967035 100644 --- a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/class_test/llgo.expect +++ b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/class_test/llgo.expect @@ -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 } diff --git a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/comment_test/llgo.expect b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/comment_test/llgo.expect index 1ba87aff..8b1e0216 100644 --- a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/comment_test/llgo.expect +++ b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/comment_test/llgo.expect @@ -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 } diff --git a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/enum_test/llgo.expect b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/enum_test/llgo.expect index 55ae0666..9ce9dd51 100644 --- a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/enum_test/llgo.expect +++ b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/enum_test/llgo.expect @@ -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" } diff --git a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/func_test/llgo.expect b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/func_test/llgo.expect index 454819d7..27471a41 100644 --- a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/func_test/llgo.expect +++ b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/func_test/llgo.expect @@ -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 } diff --git a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/scope_test/llgo.expect b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/scope_test/llgo.expect index 91e06267..ae68923b 100644 --- a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/scope_test/llgo.expect +++ b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/scope_test/llgo.expect @@ -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 } diff --git a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/struct_test/llgo.expect b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/struct_test/llgo.expect index ec15acd8..9c724cd1 100644 --- a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/struct_test/llgo.expect +++ b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/struct_test/llgo.expect @@ -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" }] }] diff --git a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/typedef_test/llgo.expect b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/typedef_test/llgo.expect index 5e32efa0..3a769e03 100644 --- a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/typedef_test/llgo.expect +++ b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/typedef_test/llgo.expect @@ -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 } diff --git a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/union_test/llgo.expect b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/union_test/llgo.expect index cc620177..798fb796 100644 --- a/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/union_test/llgo.expect +++ b/chore/_xtool/llcppsigfetch/parse/cvt_test/decl_test/union_test/llgo.expect @@ -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" }] }] diff --git a/chore/_xtool/llcppsigfetch/parse/cvt_test/preprocess_test/llgo.expect b/chore/_xtool/llcppsigfetch/parse/cvt_test/preprocess_test/llgo.expect index 9e9f5b3d..ac0d4605 100644 --- a/chore/_xtool/llcppsigfetch/parse/cvt_test/preprocess_test/llgo.expect +++ b/chore/_xtool/llcppsigfetch/parse/cvt_test/preprocess_test/llgo.expect @@ -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": [] diff --git a/chore/_xtool/llcppsigfetch/parse/cvt_test/type_test/llgo.expect b/chore/_xtool/llcppsigfetch/parse/cvt_test/type_test/llgo.expect index 3afa06d7..a7445c9a 100644 --- a/chore/_xtool/llcppsigfetch/parse/cvt_test/type_test/llgo.expect +++ b/chore/_xtool/llcppsigfetch/parse/cvt_test/type_test/llgo.expect @@ -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 } diff --git a/chore/_xtool/llcppsigfetch/parse/dump.go b/chore/_xtool/llcppsigfetch/parse/dump.go index c3e0a187..0b771fb7 100644 --- a/chore/_xtool/llcppsigfetch/parse/dump.go +++ b/chore/_xtool/llcppsigfetch/parse/dump.go @@ -21,7 +21,7 @@ func MarshalASTFile(file *ast.File) *cjson.JSON { for _, decl := range file.Decls { decls.AddItem(MarshalASTDecl(decl)) } - + root.SetItem(c.Str("_Type"), stringField("File")) root.SetItem(c.Str("decls"), decls) // json:includes,omitempty @@ -29,6 +29,7 @@ func MarshalASTFile(file *ast.File) *cjson.JSON { includes := cjson.Array() for _, i := range file.Includes { include := cjson.Object() + include.SetItem(c.Str("_Type"), stringField("Include")) include.SetItem(c.Str("Path"), stringField(i.Path)) includes.AddItem(include) } @@ -40,6 +41,7 @@ func MarshalASTFile(file *ast.File) *cjson.JSON { macros := cjson.Array() for _, m := range file.Macros { marco := cjson.Object() + marco.SetItem(c.Str("_Type"), stringField("Macro")) marco.SetItem(c.Str("Name"), stringField(m.Name)) tokens := cjson.Array() for _, tok := range m.Tokens { @@ -54,6 +56,7 @@ func MarshalASTFile(file *ast.File) *cjson.JSON { } func Token(tok *ast.Token) *cjson.JSON { root := cjson.Object() + root.SetItem(c.Str("_Type"), stringField("Token")) root.SetItem(c.Str("Token"), numberField(uint(tok.Token))) root.SetItem(c.Str("Lit"), stringField(tok.Lit)) return root @@ -66,14 +69,17 @@ func MarshalASTDecl(decl ast.Decl) *cjson.JSON { root := cjson.Object() switch d := decl.(type) { case *ast.EnumTypeDecl: + root.SetItem(c.Str("_Type"), stringField("EnumTypeDecl")) MarshalASTDeclBase(d.DeclBase, root) root.SetItem(c.Str("Name"), MarshalASTExpr(d.Name)) root.SetItem(c.Str("Type"), MarshalASTExpr(d.Type)) case *ast.TypedefDecl: + root.SetItem(c.Str("_Type"), stringField("TypedefDecl")) MarshalASTDeclBase(d.DeclBase, root) root.SetItem(c.Str("Name"), MarshalASTExpr(d.Name)) root.SetItem(c.Str("Type"), MarshalASTExpr(d.Type)) case *ast.FuncDecl: + root.SetItem(c.Str("_Type"), stringField("FuncDecl")) MarshalASTDeclBase(d.DeclBase, root) root.SetItem(c.Str("Name"), MarshalASTExpr(d.Name)) root.SetItem(c.Str("Type"), MarshalASTExpr(d.Type)) @@ -86,6 +92,7 @@ func MarshalASTDecl(decl ast.Decl) *cjson.JSON { root.SetItem(c.Str("IsVirtual"), boolField(d.IsVirtual)) root.SetItem(c.Str("IsOverride"), boolField(d.IsOverride)) case *ast.TypeDecl: + root.SetItem(c.Str("_Type"), stringField("TypeDecl")) MarshalASTDeclBase(d.DeclBase, root) root.SetItem(c.Str("Name"), MarshalASTExpr(d.Name)) root.SetItem(c.Str("Type"), MarshalASTExpr(d.Type)) @@ -95,6 +102,7 @@ func MarshalASTDecl(decl ast.Decl) *cjson.JSON { func MarshalASTDeclBase(decl ast.DeclBase, root *cjson.JSON) { loc := cjson.Object() + loc.SetItem(c.Str("_Type"), stringField("Location")) loc.SetItem(c.Str("File"), stringField(decl.Loc.File)) root.SetItem(c.Str("Loc"), loc) @@ -111,15 +119,18 @@ func MarshalASTExpr(t ast.Expr) *cjson.JSON { switch d := t.(type) { case *ast.EnumType: + root.SetItem(c.Str("_Type"), stringField("EnumType")) items := cjson.Array() for _, e := range d.Items { items.AddItem(MarshalASTExpr(e)) } root.SetItem(c.Str("Items"), items) case *ast.EnumItem: + root.SetItem(c.Str("_Type"), stringField("EnumItem")) root.SetItem(c.Str("Name"), MarshalASTExpr(d.Name)) root.SetItem(c.Str("Value"), MarshalASTExpr(d.Value)) case *ast.RecordType: + root.SetItem(c.Str("_Type"), stringField("RecordType")) root.SetItem(c.Str("Tag"), numberField(uint(d.Tag))) root.SetItem(c.Str("Fields"), MarshalASTExpr(d.Fields)) methods := cjson.Array() @@ -128,9 +139,11 @@ func MarshalASTExpr(t ast.Expr) *cjson.JSON { } root.SetItem(c.Str("Methods"), methods) case *ast.FuncType: + root.SetItem(c.Str("_Type"), stringField("FuncType")) root.SetItem(c.Str("Params"), MarshalASTExpr(d.Params)) root.SetItem(c.Str("Ret"), MarshalASTExpr(d.Ret)) case *ast.FieldList: + root.SetItem(c.Str("_Type"), stringField("FieldList")) if d == nil { return cjson.Null() } @@ -140,6 +153,7 @@ func MarshalASTExpr(t ast.Expr) *cjson.JSON { } root.SetItem(c.Str("List"), list) case *ast.Field: + root.SetItem(c.Str("_Type"), stringField("Field")) root.SetItem(c.Str("Type"), MarshalASTExpr(d.Type)) root.SetItem(c.Str("Doc"), MarshalASTExpr(d.Doc)) root.SetItem(c.Str("Comment"), MarshalASTExpr(d.Comment)) @@ -151,35 +165,46 @@ func MarshalASTExpr(t ast.Expr) *cjson.JSON { } root.SetItem(c.Str("Names"), names) case *ast.Variadic: + root.SetItem(c.Str("_Type"), stringField("Variadic")) case *ast.Ident: + root.SetItem(c.Str("_Type"), stringField("Ident")) if d == nil { return cjson.Null() } root.SetItem(c.Str("Name"), stringField(d.Name)) case *ast.TagExpr: + root.SetItem(c.Str("_Type"), stringField("TagExpr")) root.SetItem(c.Str("Name"), MarshalASTExpr(d.Name)) root.SetItem(c.Str("Tag"), numberField(uint(d.Tag))) case *ast.BasicLit: + root.SetItem(c.Str("_Type"), stringField("BasicLit")) root.SetItem(c.Str("Kind"), numberField(uint(d.Kind))) root.SetItem(c.Str("Value"), stringField(d.Value)) case *ast.LvalueRefType: + root.SetItem(c.Str("_Type"), stringField("LvalueRefType")) root.SetItem(c.Str("X"), MarshalASTExpr(d.X)) case *ast.RvalueRefType: + root.SetItem(c.Str("_Type"), stringField("RvalueRefType")) root.SetItem(c.Str("X"), MarshalASTExpr(d.X)) case *ast.PointerType: + root.SetItem(c.Str("_Type"), stringField("PointerType")) root.SetItem(c.Str("X"), MarshalASTExpr(d.X)) case *ast.ArrayType: + root.SetItem(c.Str("_Type"), stringField("ArrayType")) root.SetItem(c.Str("Elt"), MarshalASTExpr(d.Elt)) root.SetItem(c.Str("Len"), MarshalASTExpr(d.Len)) case *ast.BuiltinType: + root.SetItem(c.Str("_Type"), stringField("BuiltinType")) root.SetItem(c.Str("Kind"), numberField(uint(d.Kind))) root.SetItem(c.Str("Flags"), numberField(uint(d.Flags))) case *ast.Comment: + root.SetItem(c.Str("_Type"), stringField("Comment")) if d == nil { return cjson.Null() } root.SetItem(c.Str("Text"), stringField(d.Text)) case *ast.CommentGroup: + root.SetItem(c.Str("_Type"), stringField("CommentGroup")) if d == nil { return cjson.Null() } @@ -189,6 +214,7 @@ func MarshalASTExpr(t ast.Expr) *cjson.JSON { } root.SetItem(c.Str("List"), list) case *ast.ScopingExpr: + root.SetItem(c.Str("_Type"), stringField("ScopingExpr")) root.SetItem(c.Str("X"), MarshalASTExpr(d.X)) root.SetItem(c.Str("Parent"), MarshalASTExpr(d.Parent)) default: