llcppsigfetch:field access & static field
This commit is contained in:
@@ -437,11 +437,11 @@ type visitFieldContext struct {
|
|||||||
|
|
||||||
func visitFieldList(cursor, parent clang.Cursor, clientData unsafe.Pointer) clang.ChildVisitResult {
|
func visitFieldList(cursor, parent clang.Cursor, clientData unsafe.Pointer) clang.ChildVisitResult {
|
||||||
ctx := (*visitFieldContext)(clientData)
|
ctx := (*visitFieldContext)(clientData)
|
||||||
if cursor.Kind == clang.CursorParmDecl || cursor.Kind == clang.CursorFieldDecl {
|
|
||||||
|
switch cursor.Kind {
|
||||||
|
case clang.CursorParmDecl, clang.CursorFieldDecl:
|
||||||
paramName := cursor.String()
|
paramName := cursor.String()
|
||||||
defer paramName.Dispose()
|
defer paramName.Dispose()
|
||||||
argType := ctx.converter.ProcessType(cursor.Type())
|
|
||||||
|
|
||||||
// In C language, parameter lists do not have similar parameter grouping in Go.
|
// In C language, parameter lists do not have similar parameter grouping in Go.
|
||||||
// func foo(a, b int)
|
// func foo(a, b int)
|
||||||
|
|
||||||
@@ -449,17 +449,36 @@ func visitFieldList(cursor, parent clang.Cursor, clientData unsafe.Pointer) clan
|
|||||||
// struct A {
|
// struct A {
|
||||||
// int a, b;
|
// int a, b;
|
||||||
// };
|
// };
|
||||||
ctx.params.List = append(ctx.params.List,
|
field := &ast.Field{
|
||||||
&ast.Field{
|
Doc: &ast.CommentGroup{},
|
||||||
//todo(zzy): comment & doc
|
Comment: &ast.CommentGroup{},
|
||||||
Doc: &ast.CommentGroup{},
|
Type: ctx.converter.ProcessType(cursor.Type()),
|
||||||
Comment: &ast.CommentGroup{},
|
Names: []*ast.Ident{{Name: c.GoString(paramName.CStr())}},
|
||||||
Type: argType,
|
}
|
||||||
Names: []*ast.Ident{
|
|
||||||
{Name: c.GoString(paramName.CStr())},
|
if cursor.Kind == clang.CursorFieldDecl {
|
||||||
},
|
field.Access = ast.AccessSpecifier(cursor.CXXAccessSpecifier())
|
||||||
|
}
|
||||||
|
|
||||||
|
ctx.params.List = append(ctx.params.List, field)
|
||||||
|
|
||||||
|
case clang.CursorVarDecl:
|
||||||
|
if cursor.StorageClass() == clang.SCStatic {
|
||||||
|
// static member variable
|
||||||
|
fieldname := cursor.String()
|
||||||
|
defer fieldname.Dispose()
|
||||||
|
//todo(zzy): comment & doc
|
||||||
|
ctx.params.List = append(ctx.params.List, &ast.Field{
|
||||||
|
Doc: &ast.CommentGroup{},
|
||||||
|
Comment: &ast.CommentGroup{},
|
||||||
|
Type: ctx.converter.ProcessType(cursor.Type()),
|
||||||
|
Access: ast.AccessSpecifier(cursor.CXXAccessSpecifier()),
|
||||||
|
IsStatic: true,
|
||||||
|
Names: []*ast.Ident{{Name: c.GoString(fieldname.CStr())}},
|
||||||
})
|
})
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return clang.ChildVisit_Continue
|
return clang.ChildVisit_Continue
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -486,7 +505,7 @@ type visitMethodsContext struct {
|
|||||||
|
|
||||||
func visitMethods(cursor, parent clang.Cursor, clientData unsafe.Pointer) clang.ChildVisitResult {
|
func visitMethods(cursor, parent clang.Cursor, clientData unsafe.Pointer) clang.ChildVisitResult {
|
||||||
ctx := (*visitMethodsContext)(clientData)
|
ctx := (*visitMethodsContext)(clientData)
|
||||||
if isMethod(cursor) && cursor.CXXAccessSpecifier() != clang.CXXPrivate {
|
if isMethod(cursor) && cursor.CXXAccessSpecifier() == clang.CXXPublic {
|
||||||
method := ctx.converter.ProcessFuncDecl(cursor)
|
method := ctx.converter.ProcessFuncDecl(cursor)
|
||||||
if method != nil {
|
if method != nil {
|
||||||
*ctx.methods = append(*ctx.methods, method)
|
*ctx.methods = append(*ctx.methods, method)
|
||||||
@@ -495,6 +514,7 @@ func visitMethods(cursor, parent clang.Cursor, clientData unsafe.Pointer) clang.
|
|||||||
return clang.ChildVisit_Continue
|
return clang.ChildVisit_Continue
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Note:Public Method is considered
|
||||||
func (ct *Converter) ProcessMethods(cursor clang.Cursor) []*ast.FuncDecl {
|
func (ct *Converter) ProcessMethods(cursor clang.Cursor) []*ast.FuncDecl {
|
||||||
methods := make([]*ast.FuncDecl, 0)
|
methods := make([]*ast.FuncDecl, 0)
|
||||||
ctx := &visitMethodsContext{
|
ctx := &visitMethodsContext{
|
||||||
|
|||||||
@@ -15,11 +15,13 @@ func TestClassDecl() {
|
|||||||
};`,
|
};`,
|
||||||
`class A {
|
`class A {
|
||||||
public:
|
public:
|
||||||
int a;
|
static int a;
|
||||||
int b;
|
int b;
|
||||||
float foo(int a,double b);
|
float foo(int a,double b);
|
||||||
private:
|
private:
|
||||||
void bar();
|
static void bar();
|
||||||
|
protected:
|
||||||
|
void bar2();
|
||||||
};`,
|
};`,
|
||||||
`class A {
|
`class A {
|
||||||
public:
|
public:
|
||||||
|
|||||||
@@ -27,6 +27,8 @@ TestClassDecl Case 1:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -41,6 +43,8 @@ TestClassDecl Case 1:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "b"
|
"Name": "b"
|
||||||
}]
|
}]
|
||||||
@@ -82,6 +86,8 @@ TestClassDecl Case 2:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": true,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -96,6 +102,8 @@ TestClassDecl Case 2:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "b"
|
"Name": "b"
|
||||||
}]
|
}]
|
||||||
@@ -127,6 +135,8 @@ TestClassDecl Case 2:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -141,6 +151,8 @@ TestClassDecl Case 2:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "b"
|
"Name": "b"
|
||||||
}]
|
}]
|
||||||
|
|||||||
@@ -63,6 +63,8 @@ TestFuncDecl Case 2:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -108,6 +110,8 @@ TestFuncDecl Case 3:
|
|||||||
},
|
},
|
||||||
"Doc": null,
|
"Doc": null,
|
||||||
"Comment": null,
|
"Comment": null,
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": []
|
"Names": []
|
||||||
}, {
|
}, {
|
||||||
"Type": {
|
"Type": {
|
||||||
@@ -120,6 +124,8 @@ TestFuncDecl Case 3:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -171,6 +177,8 @@ TestFuncDecl Case 4:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -185,6 +193,8 @@ TestFuncDecl Case 4:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "b"
|
"Name": "b"
|
||||||
}]
|
}]
|
||||||
@@ -238,6 +248,8 @@ TestFuncDecl Case 5:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -252,6 +264,8 @@ TestFuncDecl Case 5:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "b"
|
"Name": "b"
|
||||||
}]
|
}]
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ TestStructDecl Case 1:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -66,6 +68,8 @@ TestStructDecl Case 2:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -80,6 +84,8 @@ TestStructDecl Case 2:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "b"
|
"Name": "b"
|
||||||
}]
|
}]
|
||||||
@@ -121,6 +127,8 @@ TestStructDecl Case 3:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -135,6 +143,8 @@ TestStructDecl Case 3:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "b"
|
"Name": "b"
|
||||||
}]
|
}]
|
||||||
@@ -176,6 +186,8 @@ TestStructDecl Case 4:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -190,6 +202,8 @@ TestStructDecl Case 4:
|
|||||||
},
|
},
|
||||||
"Doc": null,
|
"Doc": null,
|
||||||
"Comment": null,
|
"Comment": null,
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": []
|
"Names": []
|
||||||
}, {
|
}, {
|
||||||
"Type": {
|
"Type": {
|
||||||
@@ -198,6 +212,8 @@ TestStructDecl Case 4:
|
|||||||
},
|
},
|
||||||
"Doc": null,
|
"Doc": null,
|
||||||
"Comment": null,
|
"Comment": null,
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": []
|
"Names": []
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
@@ -213,6 +229,8 @@ TestStructDecl Case 4:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "Foo"
|
"Name": "Foo"
|
||||||
}]
|
}]
|
||||||
@@ -254,6 +272,8 @@ TestStructDecl Case 5:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "age"
|
"Name": "age"
|
||||||
}]
|
}]
|
||||||
@@ -272,6 +292,8 @@ TestStructDecl Case 5:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "year"
|
"Name": "year"
|
||||||
}]
|
}]
|
||||||
@@ -286,6 +308,8 @@ TestStructDecl Case 5:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "day"
|
"Name": "day"
|
||||||
}]
|
}]
|
||||||
@@ -300,6 +324,8 @@ TestStructDecl Case 5:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "month"
|
"Name": "month"
|
||||||
}]
|
}]
|
||||||
@@ -313,6 +339,8 @@ TestStructDecl Case 5:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "birthday"
|
"Name": "birthday"
|
||||||
}]
|
}]
|
||||||
|
|||||||
@@ -85,6 +85,8 @@ TestTypeDefDecl Case 3:
|
|||||||
},
|
},
|
||||||
"Doc": null,
|
"Doc": null,
|
||||||
"Comment": null,
|
"Comment": null,
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": []
|
"Names": []
|
||||||
}, {
|
}, {
|
||||||
"Type": {
|
"Type": {
|
||||||
@@ -93,12 +95,16 @@ TestTypeDefDecl Case 3:
|
|||||||
},
|
},
|
||||||
"Doc": null,
|
"Doc": null,
|
||||||
"Comment": null,
|
"Comment": null,
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": []
|
"Names": []
|
||||||
}, {
|
}, {
|
||||||
"Type": {
|
"Type": {
|
||||||
},
|
},
|
||||||
"Doc": null,
|
"Doc": null,
|
||||||
"Comment": null,
|
"Comment": null,
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": []
|
"Names": []
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -25,6 +25,8 @@ TestUnionDecl Case 1:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -39,6 +41,8 @@ TestUnionDecl Case 1:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "b"
|
"Name": "b"
|
||||||
}]
|
}]
|
||||||
@@ -80,6 +84,8 @@ TestUnionDecl Case 2:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "a"
|
"Name": "a"
|
||||||
}]
|
}]
|
||||||
@@ -94,6 +100,8 @@ TestUnionDecl Case 2:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "b"
|
"Name": "b"
|
||||||
}]
|
}]
|
||||||
@@ -135,6 +143,8 @@ TestUnionDecl Case 3:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "i"
|
"Name": "i"
|
||||||
}]
|
}]
|
||||||
@@ -149,6 +159,8 @@ TestUnionDecl Case 3:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "f"
|
"Name": "f"
|
||||||
}]
|
}]
|
||||||
@@ -167,6 +179,8 @@ TestUnionDecl Case 3:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "c"
|
"Name": "c"
|
||||||
}]
|
}]
|
||||||
@@ -181,6 +195,8 @@ TestUnionDecl Case 3:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "s"
|
"Name": "s"
|
||||||
}]
|
}]
|
||||||
@@ -194,6 +210,8 @@ TestUnionDecl Case 3:
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "inner"
|
"Name": "inner"
|
||||||
}]
|
}]
|
||||||
|
|||||||
@@ -120,6 +120,8 @@ Type: struct (unnamed struct at temp.h:1:1):
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "x"
|
"Name": "x"
|
||||||
}]
|
}]
|
||||||
@@ -153,6 +155,8 @@ Type: union (unnamed union at temp.h:1:1):
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 1,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "x"
|
"Name": "x"
|
||||||
}]
|
}]
|
||||||
@@ -209,6 +213,8 @@ Type: class (unnamed class at temp.h:1:1):
|
|||||||
"Comment": {
|
"Comment": {
|
||||||
"List": []
|
"List": []
|
||||||
},
|
},
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 3,
|
||||||
"Names": [{
|
"Names": [{
|
||||||
"Name": "x"
|
"Name": "x"
|
||||||
}]
|
}]
|
||||||
@@ -258,6 +264,8 @@ Type: int (*)(int, char):
|
|||||||
},
|
},
|
||||||
"Doc": null,
|
"Doc": null,
|
||||||
"Comment": null,
|
"Comment": null,
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": []
|
"Names": []
|
||||||
}, {
|
}, {
|
||||||
"Type": {
|
"Type": {
|
||||||
@@ -266,6 +274,8 @@ Type: int (*)(int, char):
|
|||||||
},
|
},
|
||||||
"Doc": null,
|
"Doc": null,
|
||||||
"Comment": null,
|
"Comment": null,
|
||||||
|
"IsStatic": false,
|
||||||
|
"Access": 0,
|
||||||
"Names": []
|
"Names": []
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -143,6 +143,8 @@ func MarshalASTExpr(t ast.Expr) *cjson.JSON {
|
|||||||
root.SetItem(c.Str("Type"), MarshalASTExpr(d.Type))
|
root.SetItem(c.Str("Type"), MarshalASTExpr(d.Type))
|
||||||
root.SetItem(c.Str("Doc"), MarshalASTExpr(d.Doc))
|
root.SetItem(c.Str("Doc"), MarshalASTExpr(d.Doc))
|
||||||
root.SetItem(c.Str("Comment"), MarshalASTExpr(d.Comment))
|
root.SetItem(c.Str("Comment"), MarshalASTExpr(d.Comment))
|
||||||
|
root.SetItem(c.Str("IsStatic"), boolField(d.IsStatic))
|
||||||
|
root.SetItem(c.Str("Access"), numberField(uint(d.Access)))
|
||||||
names := cjson.Array()
|
names := cjson.Array()
|
||||||
for _, n := range d.Names {
|
for _, n := range d.Names {
|
||||||
names.AddItem(MarshalASTExpr(n))
|
names.AddItem(MarshalASTExpr(n))
|
||||||
|
|||||||
Reference in New Issue
Block a user