MCPcopy Create free account
hub / github.com/crossoverJie/gscript / findFunctionDeclarationCtx

Method findFunctionDeclarationCtx

semantic_resolver.go:112–123  ·  view source on GitHub ↗

查询函数声明 ctx

(ctx antlr.Tree)

Source from the content-addressed store, hash-verified

110
111// 查询函数声明 ctx
112func (s *SemanticResolver) findFunctionDeclarationCtx(ctx antlr.Tree) *parser.FunctionDeclarationContext {
113 if ctx == nil || ctx.GetParent() == nil {
114 return nil
115 }
116 parent := ctx.GetParent()
117 functionDeclareCtx, ok := parent.(*parser.FunctionDeclarationContext)
118 if ok {
119 return functionDeclareCtx
120 }
121 return s.findFunctionDeclarationCtx(parent.GetParent())
122
123}
124
125// ExitVariableDeclarator 赋值类型校验
126func (s *SemanticResolver) ExitVariableDeclarator(ctx *parser.VariableDeclaratorContext) {

Callers 1

ExitStmReturnMethod · 0.95

Calls 1

GetParentMethod · 0.80

Tested by

no test coverage detected