未验证 提交 e1098890 编写于 作者: P Phodal Huang

feat: add function body to code base..............

上级 dd26360f
......@@ -61,8 +61,14 @@ func (s *BadSmellListener) EnterInterfaceMethodDeclaration(ctx *InterfaceMethodD
stopLine := ctx.GetStop().GetLine()
name := ctx.IDENTIFIER().GetText()
stopLinePosition := startLinePosition + len(name)
methodBody := ctx.MethodBody().GetText()
typeType := ctx.TypeTypeOrVoid().GetText()
var params []JFullParameter = nil
parameters := ctx.FormalParameters()
if parameters != nil {
}
method := &JFullMethod{
name,
......@@ -71,7 +77,8 @@ func (s *BadSmellListener) EnterInterfaceMethodDeclaration(ctx *InterfaceMethodD
startLinePosition,
stopLine,
stopLinePosition,
nil,
methodBody,
params,
}
methods = append(methods, *method)
......@@ -102,6 +109,12 @@ func (s *BadSmellListener) EnterMethodDeclaration(ctx *MethodDeclarationContext)
//XXX: find the start position of {, not public
typeType := ctx.TypeTypeOrVoid().GetText()
methodBody := ctx.MethodBody().GetText()
parameters := ctx.FormalParameters()
if parameters != nil {
}
method := &JFullMethod{
name,
......@@ -110,6 +123,7 @@ func (s *BadSmellListener) EnterMethodDeclaration(ctx *MethodDeclarationContext)
startLinePosition,
stopLine,
stopLinePosition,
methodBody,
nil,
}
methods = append(methods, *method)
......
......@@ -27,6 +27,7 @@ type JFullMethod struct {
StartLinePosition int
StopLine int
StopLinePosition int
MethodBody string
Parameters []JFullParameter
}
......@@ -36,5 +37,5 @@ type JFullParameter struct {
}
func NewJFullClassNode() *JFullClassNode {
return &JFullClassNode{"", "", "", "", nil, nil}
return &JFullClassNode{"", "", "", "", nil, nil}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册