@@ -107,7 +107,8 @@ open class McfppFieldVisitor : mcfppParserBaseVisitor<Any?>() {
107107 val f = Function (
108108 ctx.Identifier ().text,
109109 Interface .currInterface!! ,
110- MCFPPType .parseFromIdentifier(if (ctx.functionReturnType() == null ) " void" else ctx.functionReturnType().text, typeScope)
110+ MCFPPType .parseFromIdentifier(if (ctx.functionReturnType() == null ) " void" else ctx.functionReturnType().text, typeScope),
111+ null
111112 )
112113 // 解析参数
113114 f.addParamsFromContext(ctx.functionParams())
@@ -296,7 +297,8 @@ open class McfppFieldVisitor : mcfppParserBaseVisitor<Any?>() {
296297 ctx.Identifier ().text,
297298 Class .currClass!! ,
298299 Class .currClass!! is ObjectClass ,
299- type
300+ type,
301+ ctx.functionBody()
300302 )
301303 }
302304 if (! isStatic){
@@ -330,7 +332,8 @@ open class McfppFieldVisitor : mcfppParserBaseVisitor<Any?>() {
330332 ctx.Identifier ().text,
331333 Class .currClass!! ,
332334 false ,
333- type
335+ type,
336+ null
334337 )
335338 f.isAbstract = true
336339 if (f.isStatic){
@@ -466,7 +469,7 @@ open class McfppFieldVisitor : mcfppParserBaseVisitor<Any?>() {
466469 val f = if (ctx.functionParams()?.readOnlyParams() != null && ctx.functionParams().readOnlyParams().parameterList().parameter().size != 0 ){
467470 GenericFunction (identifier, Project .currNamespace, type, ctx.functionBody())
468471 }else {
469- Function (identifier, Project .currNamespace,type)
472+ Function (identifier, Project .currNamespace,type, ctx.functionBody() )
470473 }
471474 // 解析参数
472475 ctx.functionParams()?.let { f.addParamsFromContext(it) }
@@ -499,7 +502,7 @@ open class McfppFieldVisitor : mcfppParserBaseVisitor<Any?>() {
499502 val f: Function
500503 // 是否是内联函数
501504 val identifier : String = ctx.Identifier ().text
502- f = InlineFunction (identifier, Project .currNamespace, ctx)
505+ f = InlineFunction (identifier, Project .currNamespace, ctx.functionBody() )
503506 // 解析参数
504507 f.addParamsFromContext(ctx.functionParams())
505508 // TODO 解析函数的注解
@@ -592,7 +595,7 @@ open class McfppFieldVisitor : mcfppParserBaseVisitor<Any?>() {
592595 val f = if (ctx.functionParams().readOnlyParams() != null && ctx.functionParams().readOnlyParams().parameterList().parameter().size != 0 ){
593596 GenericExtensionFunction (ctx.Identifier ().text, data, Project .currNamespace, MCFPPType .parseFromIdentifier(ctx.functionReturnType().text, typeScope), ctx.functionBody())
594597 }else {
595- ExtensionFunction (ctx.Identifier ().text, data, Project .currNamespace, MCFPPType .parseFromIdentifier(ctx.functionReturnType().text, typeScope))
598+ ExtensionFunction (ctx.Identifier ().text, data, Project .currNamespace, MCFPPType .parseFromIdentifier(ctx.functionReturnType().text, typeScope), ctx.functionBody() )
596599 }
597600 // 解析参数
598601 f.accessModifier = AccessModifier .PUBLIC
@@ -769,7 +772,8 @@ open class McfppFieldVisitor : mcfppParserBaseVisitor<Any?>() {
769772 ctx.Identifier ().text,
770773 DataTemplate .currTemplate!! ,
771774 DataTemplate .currTemplate is ObjectDataTemplate ,
772- type
775+ type,
776+ ctx.functionBody()
773777 )
774778 }
775779 if (! isStatic){
0 commit comments