Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
Phodal
Coca
提交
5e12ef67
C
Coca
项目概览
Phodal
/
Coca
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
Coca
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
前往新版Gitcode,体验更适合开发者的 AI 搜索 >>
未验证
提交
5e12ef67
编写于
1月 14, 2020
作者:
P
Phodal Huang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: change build property
上级
e37d065a
变更
14
隐藏空白更改
内联
并排
Showing
14 changed file
with
422 addition
and
369 deletion
+422
-369
cocatest/json_compare.go
cocatest/json_compare.go
+1
-1
pkg/domain/trial/code_property.go
pkg/domain/trial/code_property.go
+6
-5
trial/cocago/cocago_builder.go
trial/cocago/cocago_builder.go
+2
-9
trial/cocago/cocago_parser.go
trial/cocago/cocago_parser.go
+11
-10
trial/cocago/testdata/anonymous_methods.json
trial/cocago/testdata/anonymous_methods.json
+0
-1
trial/cocago/testdata/basic_interface.json
trial/cocago/testdata/basic_interface.json
+8
-0
trial/cocago/testdata/data_struct_property.json
trial/cocago/testdata/data_struct_property.json
+12
-2
trial/cocago/testdata/hello_world.json
trial/cocago/testdata/hello_world.json
+54
-52
trial/cocago/testdata/multiple_method_call.json
trial/cocago/testdata/multiple_method_call.json
+0
-1
trial/cocago/testdata/nested_method.json
trial/cocago/testdata/nested_method.json
+2
-0
trial/cocago/testdata/normal_method.json
trial/cocago/testdata/normal_method.json
+192
-168
trial/cocago/testdata/struct_type_zero.json
trial/cocago/testdata/struct_type_zero.json
+42
-42
trial/cocago/testdata/struct_with_func.json
trial/cocago/testdata/struct_with_func.json
+6
-0
trial/cocago/testdata/struct_with_func_decl.json
trial/cocago/testdata/struct_with_func_decl.json
+86
-78
未找到文件。
cocatest/json_compare.go
浏览文件 @
5e12ef67
...
...
@@ -57,7 +57,7 @@ func JSONFileBytesEqual(actualInterface interface{}, exceptFile string) (bool, e
contents
,
err
:=
ioutil
.
ReadFile
(
exceptFile
)
if
err
!=
nil
{
return
false
,
err
_
=
ioutil
.
WriteFile
(
exceptFile
,
[]
byte
(
`{}`
),
0644
)
}
return
JSONBytesEqual
(
actual
,
contents
,
exceptFile
)
...
...
pkg/domain/trial/code_property.go
浏览文件 @
5e12ef67
package
trial
type
CodeProperty
struct
{
Modifiers
[]
string
Name
string
TypeName
string
TypeType
string
Modifiers
[]
string
Name
string
TypeName
string
TypeType
string
ReturnTypes
[]
CodeProperty
Parameters
[]
CodeProperty
}
trial/cocago/cocago_builder.go
浏览文件 @
5e12ef67
...
...
@@ -11,17 +11,10 @@ func AddStructType(currentStruct trial.CodeDataStruct, x *ast.StructType, curren
Type
:
"struct"
,
}
for
_
,
field
:=
range
x
.
Fields
.
List
{
typeName
,
typeType
:=
BuildPropertyField
(
field
)
property
:=
trial
.
CodeProperty
{
Modifiers
:
nil
,
Name
:
getFieldName
(
field
),
TypeType
:
typeType
,
TypeName
:
typeName
,
}
property
:=
BuildPropertyField
(
getFieldName
(
field
),
field
)
member
.
FileID
=
currentFile
.
FullName
currentStruct
.
Properties
=
append
(
currentStruct
.
Properties
,
property
)
currentStruct
.
Properties
=
append
(
currentStruct
.
Properties
,
*
property
)
}
currentFile
.
Members
=
append
(
currentFile
.
Members
,
&
member
)
currentFile
.
DataStructures
=
append
(
currentFile
.
DataStructures
,
currentStruct
)
}
trial/cocago/cocago_parser.go
浏览文件 @
5e12ef67
...
...
@@ -259,14 +259,8 @@ func GetMemberFromFile(file trial.CodeFile, recv string) *trial.CodeMember {
func
BuildFieldToProperty
(
fieldList
[]
*
ast
.
Field
)
[]
trial
.
CodeProperty
{
var
properties
[]
trial
.
CodeProperty
for
_
,
field
:=
range
fieldList
{
typeName
,
typeType
:=
BuildPropertyField
(
field
)
property
:=
trial
.
CodeProperty
{
Modifiers
:
nil
,
Name
:
getFieldName
(
field
),
TypeType
:
typeType
,
TypeName
:
typeName
,
}
properties
=
append
(
properties
,
property
)
property
:=
BuildPropertyField
(
getFieldName
(
field
),
field
)
properties
=
append
(
properties
,
*
property
)
}
return
properties
}
...
...
@@ -278,7 +272,7 @@ func getFieldName(field *ast.Field) string {
return
field
.
Names
[
0
]
.
Name
}
func
BuildPropertyField
(
field
*
ast
.
Field
)
(
string
,
string
)
{
func
BuildPropertyField
(
name
string
,
field
*
ast
.
Field
)
*
trial
.
CodeProperty
{
var
typeName
string
var
typeType
string
switch
x
:=
field
.
Type
.
(
type
)
{
...
...
@@ -306,7 +300,14 @@ func BuildPropertyField(field *ast.Field) (string, string) {
default
:
fmt
.
Println
(
"BuildPropertyField"
,
reflect
.
TypeOf
(
x
))
}
return
typeName
,
typeType
property
:=
&
trial
.
CodeProperty
{
Modifiers
:
nil
,
Name
:
name
,
TypeType
:
typeType
,
TypeName
:
typeName
,
}
return
property
}
func
getSelectorName
(
typeX
ast
.
SelectorExpr
)
string
{
...
...
trial/cocago/testdata/anonymous_methods.json
已删除
100644 → 0
浏览文件 @
e37d065a
{}
\ No newline at end of file
trial/cocago/testdata/basic_interface.json
浏览文件 @
5e12ef67
...
...
@@ -9,6 +9,8 @@
{
"Modifiers"
:
null
,
"Name"
:
"Area"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"func"
,
"TypeType"
:
"Function"
}
...
...
@@ -22,6 +24,8 @@
{
"Modifiers"
:
null
,
"Name"
:
"Volume"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"func"
,
"TypeType"
:
"Function"
}
...
...
@@ -35,12 +39,16 @@
{
"Modifiers"
:
null
,
"Name"
:
""
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"Shape"
,
"TypeType"
:
"Identify"
},
{
"Modifiers"
:
null
,
"Name"
:
""
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"Object"
,
"TypeType"
:
"Identify"
}
...
...
trial/cocago/testdata/data_struct_property.json
浏览文件 @
5e12ef67
...
...
@@ -9,30 +9,40 @@
{
"Modifiers"
:
null
,
"Name"
:
"FullName"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
},
{
"Modifiers"
:
null
,
"Name"
:
"PackageName"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
},
{
"Modifiers"
:
null
,
"Name"
:
"Imports"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"string"
,
"TypeType"
:
"ArrayType"
},
{
"Modifiers"
:
null
,
"Name"
:
"Members"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"CodeMember"
,
"TypeType"
:
"ArrayType"
},
{
"Modifiers"
:
null
,
"Name"
:
"ClassNodes"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"domain.JClassNode"
,
"TypeType"
:
"ArrayType"
}
...
...
@@ -49,9 +59,9 @@
"DataStructID"
:
"CodeFile"
,
"FileID"
:
"testdata/data_struct_property.code"
,
"ID"
:
""
,
"MethodNodes"
:
null
,
"Name"
:
""
,
"Namespace"
:
null
,
"MethodNodes"
:
null
,
"Position"
:
{
"StartLine"
:
0
,
"StartLinePosition"
:
0
,
...
...
@@ -62,4 +72,4 @@
}
],
"PackageName"
:
"trial"
}
}
\ No newline at end of file
trial/cocago/testdata/hello_world.json
浏览文件 @
5e12ef67
{
"ClassNodes"
:
null
,
"DataStructures"
:
null
,
"FullName"
:
"testdata/hello_world.code"
,
"Imports"
:
[
"fmt"
],
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"default"
,
"FileID"
:
""
,
"ID"
:
""
,
"MethodNodes"
:
[
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
[
{
"Class"
:
"fmt"
,
"MethodName"
:
"Println"
,
"Package"
:
""
,
"Parameters"
:
[
{
"Modifiers"
:
null
,
"Name"
:
""
,
"TypeName"
:
"
\"
hello, world
\"
"
,
"TypeType"
:
"STRING"
}
],
"Type"
:
""
}
],
"Modifiers"
:
null
,
"Name"
:
"main"
,
"Override"
:
false
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
}
],
"Name"
:
""
,
"Namespace"
:
null
,
"Position"
:
{
"StartLine"
:
0
,
"StartLinePosition"
:
0
,
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Type"
:
"method"
}
],
"PackageName"
:
"main"
"ClassNodes"
:
null
,
"DataStructures"
:
null
,
"FullName"
:
"testdata/hello_world.code"
,
"Imports"
:
[
"fmt"
],
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"default"
,
"FileID"
:
""
,
"ID"
:
""
,
"MethodNodes"
:
[
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
[
{
"Class"
:
"fmt"
,
"MethodName"
:
"Println"
,
"Package"
:
""
,
"Parameters"
:
[
{
"Modifiers"
:
null
,
"Name"
:
""
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"
\"
hello, world
\"
"
,
"TypeType"
:
"STRING"
}
],
"Type"
:
""
}
],
"Modifiers"
:
null
,
"Name"
:
"main"
,
"Override"
:
false
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
}
],
"Name"
:
""
,
"Namespace"
:
null
,
"Position"
:
{
"StartLine"
:
0
,
"StartLinePosition"
:
0
,
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Type"
:
"method"
}
],
"PackageName"
:
"main"
}
\ No newline at end of file
trial/cocago/testdata/multiple_method_call.json
已删除
100644 → 0
浏览文件 @
e37d065a
{}
\ No newline at end of file
trial/cocago/testdata/nested_method.json
浏览文件 @
5e12ef67
...
...
@@ -25,6 +25,8 @@
{
"Modifiers"
:
null
,
"Name"
:
""
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"
\"
Hello World!
\"
"
,
"TypeType"
:
"STRING"
}
...
...
trial/cocago/testdata/normal_method.json
浏览文件 @
5e12ef67
{
"ClassNodes"
:
null
,
"DataStructures"
:
null
,
"FullName"
:
"testdata/normal_method.code"
,
"Imports"
:
[
"github.com/antlr/antlr4/runtime/Go/antlr"
,
"github.com/phodal/coca/languages/ts"
],
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"default"
,
"FileID"
:
""
,
"ID"
:
""
,
"MethodNodes"
:
[
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
null
,
"Modifiers"
:
null
,
"Name"
:
"ProcessTsString"
,
"Override"
:
false
,
"Parameters"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"code"
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
}
],
"ReturnTypes"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"code"
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
},
{
"Modifiers"
:
null
,
"Name"
:
""
,
"TypeName"
:
"parser.TypeScriptParser"
,
"TypeType"
:
"Star"
}
]
},
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
null
,
"Modifiers"
:
null
,
"Name"
:
"processStream"
,
"Override"
:
false
,
"Parameters"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"is"
,
"TypeName"
:
"antlr.CharStream"
,
"TypeType"
:
""
}
],
"ReturnTypes"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"is"
,
"TypeName"
:
"antlr.CharStream"
,
"TypeType"
:
""
},
{
"Modifiers"
:
null
,
"Name"
:
""
,
"TypeName"
:
"parser.TypeScriptParser"
,
"TypeType"
:
"Star"
}
]
}
],
"Name"
:
""
,
"Namespace"
:
null
,
"Position"
:
{
"StartLine"
:
0
,
"StartLinePosition"
:
0
,
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Type"
:
"method"
},
{
"ClassNodes"
:
null
,
"DataStructID"
:
"default"
,
"FileID"
:
""
,
"ID"
:
""
,
"MethodNodes"
:
[
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
null
,
"Modifiers"
:
null
,
"Name"
:
"ProcessTsString"
,
"Override"
:
false
,
"Parameters"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"code"
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
}
],
"ReturnTypes"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"code"
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
},
{
"Modifiers"
:
null
,
"Name"
:
""
,
"TypeName"
:
"parser.TypeScriptParser"
,
"TypeType"
:
"Star"
}
]
},
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
null
,
"Modifiers"
:
null
,
"Name"
:
"processStream"
,
"Override"
:
false
,
"Parameters"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"is"
,
"TypeName"
:
"antlr.CharStream"
,
"TypeType"
:
""
}
],
"ReturnTypes"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"is"
,
"TypeName"
:
"antlr.CharStream"
,
"TypeType"
:
""
},
{
"Modifiers"
:
null
,
"Name"
:
""
,
"TypeName"
:
"parser.TypeScriptParser"
,
"TypeType"
:
"Star"
}
]
}
],
"Name"
:
""
,
"Namespace"
:
null
,
"Position"
:
{
"StartLine"
:
0
,
"StartLinePosition"
:
0
,
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Type"
:
"method"
}
],
"PackageName"
:
"testdata"
"ClassNodes"
:
null
,
"DataStructures"
:
null
,
"FullName"
:
"testdata/normal_method.code"
,
"Imports"
:
[
"github.com/antlr/antlr4/runtime/Go/antlr"
,
"github.com/phodal/coca/languages/ts"
],
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"default"
,
"FileID"
:
""
,
"ID"
:
""
,
"MethodNodes"
:
[
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
null
,
"Modifiers"
:
null
,
"Name"
:
"ProcessTsString"
,
"Override"
:
false
,
"Parameters"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"code"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
}
],
"ReturnTypes"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"code"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
},
{
"Modifiers"
:
null
,
"Name"
:
""
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"parser.TypeScriptParser"
,
"TypeType"
:
"Star"
}
]
},
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
null
,
"Modifiers"
:
null
,
"Name"
:
"processStream"
,
"Override"
:
false
,
"Parameters"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"is"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"antlr.CharStream"
,
"TypeType"
:
""
}
],
"ReturnTypes"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"is"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"antlr.CharStream"
,
"TypeType"
:
""
},
{
"Modifiers"
:
null
,
"Name"
:
""
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"parser.TypeScriptParser"
,
"TypeType"
:
"Star"
}
]
}
],
"Name"
:
""
,
"Namespace"
:
null
,
"Position"
:
{
"StartLine"
:
0
,
"StartLinePosition"
:
0
,
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Type"
:
"method"
},
{
"ClassNodes"
:
null
,
"DataStructID"
:
"default"
,
"FileID"
:
""
,
"ID"
:
""
,
"MethodNodes"
:
[
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
null
,
"Modifiers"
:
null
,
"Name"
:
"ProcessTsString"
,
"Override"
:
false
,
"Parameters"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"code"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
}
],
"ReturnTypes"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"code"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
},
{
"Modifiers"
:
null
,
"Name"
:
""
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"parser.TypeScriptParser"
,
"TypeType"
:
"Star"
}
]
},
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
null
,
"Modifiers"
:
null
,
"Name"
:
"processStream"
,
"Override"
:
false
,
"Parameters"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"is"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"antlr.CharStream"
,
"TypeType"
:
""
}
],
"ReturnTypes"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"is"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"antlr.CharStream"
,
"TypeType"
:
""
},
{
"Modifiers"
:
null
,
"Name"
:
""
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"parser.TypeScriptParser"
,
"TypeType"
:
"Star"
}
]
}
],
"Name"
:
""
,
"Namespace"
:
null
,
"Position"
:
{
"StartLine"
:
0
,
"StartLinePosition"
:
0
,
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Type"
:
"method"
}
],
"PackageName"
:
"testdata"
}
\ No newline at end of file
trial/cocago/testdata/struct_type_zero.json
浏览文件 @
5e12ef67
{
"ClassNodes"
:
null
,
"DataStructures"
:
[
{
"ID"
:
""
,
"MemberIds"
:
null
,
"Name"
:
"O"
,
"Properties"
:
null
}
],
"FullName"
:
"testdata/struct_type_zero.code"
,
"Imports"
:
null
,
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"O"
,
"FileID"
:
""
,
"ID"
:
""
,
"MethodNodes"
:
[
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
null
,
"Modifiers"
:
null
,
"Name"
:
"typee"
,
"Override"
:
false
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
}
],
"Name"
:
""
,
"Namespace"
:
null
,
"Position"
:
{
"StartLine"
:
0
,
"StartLinePosition"
:
0
,
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Type"
:
"struct"
}
],
"PackageName"
:
"testdata"
"ClassNodes"
:
null
,
"DataStructures"
:
[
{
"ID"
:
""
,
"MemberIds"
:
null
,
"Name"
:
"O"
,
"Properties"
:
null
}
],
"FullName"
:
"testdata/struct_type_zero.code"
,
"Imports"
:
null
,
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"O"
,
"FileID"
:
""
,
"ID"
:
""
,
"MethodNodes"
:
[
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
null
,
"Modifiers"
:
null
,
"Name"
:
"typee"
,
"Override"
:
false
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
}
],
"Name"
:
""
,
"Namespace"
:
null
,
"Position"
:
{
"StartLine"
:
0
,
"StartLinePosition"
:
0
,
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Type"
:
"struct"
}
],
"PackageName"
:
"testdata"
}
\ No newline at end of file
trial/cocago/testdata/struct_with_func.json
浏览文件 @
5e12ef67
...
...
@@ -9,18 +9,24 @@
{
"Modifiers"
:
null
,
"Name"
:
"work"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"func"
,
"TypeType"
:
"Function"
},
{
"Modifiers"
:
null
,
"Name"
:
"name"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
},
{
"Modifiers"
:
null
,
"Name"
:
"age"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"int32"
,
"TypeType"
:
"Identify"
}
...
...
trial/cocago/testdata/struct_with_func_decl.json
浏览文件 @
5e12ef67
{
"ClassNodes"
:
null
,
"DataStructures"
:
[
{
"ID"
:
""
,
"MemberIds"
:
null
,
"Name"
:
"person"
,
"Properties"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"name"
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
},
{
"Modifiers"
:
null
,
"Name"
:
"age"
,
"TypeName"
:
"int"
,
"TypeType"
:
"Identify"
},
{
"Modifiers"
:
null
,
"Name"
:
"personfunc"
,
"TypeName"
:
"func"
,
"TypeType"
:
"Function"
}
]
}
],
"FullName"
:
"testdata/struct_with_func_decl.code"
,
"Imports"
:
[
"fmt"
],
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"person"
,
"FileID"
:
"testdata/struct_with_func_decl.code"
,
"ID"
:
""
,
"MethodNodes"
:
[
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
[
{
"Class"
:
"fmt"
,
"MethodName"
:
"Println"
,
"Package"
:
""
,
"Parameters"
:
[
{
"Modifiers"
:
null
,
"Name"
:
""
,
"TypeName"
:
"
\"
Declared outside and invoked!!!
\"
"
,
"TypeType"
:
"STRING"
}
],
"Type"
:
""
}
],
"Modifiers"
:
null
,
"Name"
:
"outside"
,
"Override"
:
false
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
}
],
"Name"
:
""
,
"Namespace"
:
null
,
"Position"
:
{
"StartLine"
:
0
,
"StartLinePosition"
:
0
,
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Type"
:
"struct"
}
],
"PackageName"
:
"testdata"
"ClassNodes"
:
null
,
"DataStructures"
:
[
{
"ID"
:
""
,
"MemberIds"
:
null
,
"Name"
:
"person"
,
"Properties"
:
[
{
"Modifiers"
:
null
,
"Name"
:
"name"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"string"
,
"TypeType"
:
"Identify"
},
{
"Modifiers"
:
null
,
"Name"
:
"age"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"int"
,
"TypeType"
:
"Identify"
},
{
"Modifiers"
:
null
,
"Name"
:
"personfunc"
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"func"
,
"TypeType"
:
"Function"
}
]
}
],
"FullName"
:
"testdata/struct_with_func_decl.code"
,
"Imports"
:
[
"fmt"
],
"Members"
:
[
{
"ClassNodes"
:
null
,
"DataStructID"
:
"person"
,
"FileID"
:
"testdata/struct_with_func_decl.code"
,
"ID"
:
""
,
"MethodNodes"
:
[
{
"Annotations"
:
null
,
"Creators"
:
null
,
"InnerFunctions"
:
null
,
"MethodCalls"
:
[
{
"Class"
:
"fmt"
,
"MethodName"
:
"Println"
,
"Package"
:
""
,
"Parameters"
:
[
{
"Modifiers"
:
null
,
"Name"
:
""
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
,
"TypeName"
:
"
\"
Declared outside and invoked!!!
\"
"
,
"TypeType"
:
"STRING"
}
],
"Type"
:
""
}
],
"Modifiers"
:
null
,
"Name"
:
"outside"
,
"Override"
:
false
,
"Parameters"
:
null
,
"ReturnTypes"
:
null
}
],
"Name"
:
""
,
"Namespace"
:
null
,
"Position"
:
{
"StartLine"
:
0
,
"StartLinePosition"
:
0
,
"StopLine"
:
0
,
"StopLinePosition"
:
0
},
"Type"
:
"struct"
}
],
"PackageName"
:
"testdata"
}
\ No newline at end of file
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录