(ctx *parser.LiteralContext)
| 425 | } |
| 426 | |
| 427 | func (s *RefResolver) ExitLiteral(ctx *parser.LiteralContext) { |
| 428 | if ctx.DECIMAL_LITERAL() != nil { |
| 429 | // 设置标识符类型 |
| 430 | s.at.PutTypeOfNode(ctx, symbol.Int) |
| 431 | symbol.Int.SetArray(false) |
| 432 | } else if ctx.FLOAT_LITERAL() != nil { |
| 433 | s.at.PutTypeOfNode(ctx, symbol.Float) |
| 434 | symbol.Float.SetArray(false) |
| 435 | } else if ctx.String_() != nil { |
| 436 | s.at.PutTypeOfNode(ctx, symbol.String) |
| 437 | symbol.String.SetArray(false) |
| 438 | } else if ctx.BOOL_LITERAL() != nil { |
| 439 | s.at.PutTypeOfNode(ctx, symbol.Bool) |
| 440 | symbol.Bool.SetArray(false) |
| 441 | } else if ctx.Nil() != nil { |
| 442 | s.at.PutTypeOfNode(ctx, symbol.Nil) |
| 443 | symbol.Nil.SetArray(false) |
| 444 | |
| 445 | } |
| 446 | } |
nothing calls this directly
no test coverage detected