查询函数声明 ctx
(ctx antlr.Tree)
| 110 | |
| 111 | // 查询函数声明 ctx |
| 112 | func (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 赋值类型校验 |
| 126 | func (s *SemanticResolver) ExitVariableDeclarator(ctx *parser.VariableDeclaratorContext) { |
no test coverage detected