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

Method ExitLiteral

resolver/ref_resolver.go:427–446  ·  view source on GitHub ↗
(ctx *parser.LiteralContext)

Source from the content-addressed store, hash-verified

425}
426
427func (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}

Callers

nothing calls this directly

Calls 7

PutTypeOfNodeMethod · 0.80
BOOL_LITERALMethod · 0.80
NilMethod · 0.80
SetArrayMethod · 0.65
DECIMAL_LITERALMethod · 0.45
FLOAT_LITERALMethod · 0.45
String_Method · 0.45

Tested by

no test coverage detected