MCPcopy Create free account
hub / github.com/brimdata/super / LookupPrimitiveCaster

Function LookupPrimitiveCaster

runtime/sam/expr/cast.go:17–49  ·  view source on GitHub ↗
(sctx *super.Context, typ super.Type)

Source from the content-addressed store, hash-verified

15)
16
17func LookupPrimitiveCaster(sctx *super.Context, typ super.Type) Evaluator {
18 if enum, ok := typ.(*super.TypeEnum); ok {
19 return &casterEnum{sctx, enum}
20 }
21 switch typ {
22 case super.TypeBool:
23 return &casterBool{sctx}
24 case super.TypeInt8, super.TypeInt16, super.TypeInt32, super.TypeInt64:
25 return &casterIntN{sctx, typ}
26 case super.TypeUint8, super.TypeUint16, super.TypeUint32, super.TypeUint64:
27 return &casterUintN{sctx, typ}
28 case super.TypeFloat16, super.TypeFloat32, super.TypeFloat64:
29 return &casterFloat{sctx, typ}
30 case super.TypeIP:
31 return &casterIP{sctx}
32 case super.TypeNet:
33 return &casterNet{sctx}
34 case super.TypeDuration:
35 return &casterDuration{sctx}
36 case super.TypeTime:
37 return &casterTime{sctx}
38 case super.TypeString:
39 return &casterString{sctx}
40 case super.TypeBytes:
41 return &casterBytes{sctx}
42 case super.TypeType:
43 return &casterType{sctx}
44 case super.TypeNull:
45 return &casterNull{sctx}
46 default:
47 return nil
48 }
49}
50
51type casterIntN struct {
52 sctx *super.Context

Callers 3

CastMethod · 0.92
NewExprLvalElemFunction · 0.85
getNumericIndexFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected