Documentation ¶
Index ¶
- Constants
- func ConvertLiteralCheckOverflow(src interface{}, to xr.Type) interface{}
- func Marshal(kind Kind, val constant.Value) string
- type Kind
- type Lit
- func (untyp *Lit) BigFloat() *big.Float
- func (untyp *Lit) BigInt() *big.Int
- func (untyp *Lit) BigRat() *big.Rat
- func (untyp *Lit) Convert(t xr.Type) interface{}
- func (untyp *Lit) DefaultType() xr.Type
- func (untyp *Lit) EqualInt64(i int64) bool
- func (untyp *Lit) Float64() (float64, bool)
- func (untyp *Lit) Int64() (int64, bool)
- func (untyp Lit) String() string
- func (untyp *Lit) Uint64() (uint64, bool)
- type Val
Constants ¶
Variables ¶
This section is empty.
Functions ¶
func ConvertLiteralCheckOverflow ¶
ConvertLiteralCheckOverflow converts a literal to type t and returns the converted value. panics if the conversion overflows the given type
Types ¶
type Kind ¶
untyped kind. matches reflect.Kind except for rune literals, where Kind == reflect.Int32
func GoUntypedToKind ¶
type Lit ¶
type Lit struct { Kind Kind // untyped constant's default type Val constant.Value // contains filtered or unexported fields }
Lit represents an untyped literal value, i.e. an untyped constant
func (*Lit) Convert ¶
Convert checks that an untyped.Lit can be converted exactly to the given type. performs actual untyped -> typed conversion and subsequent overflow checks. returns the constant.Value converted to given type
func (*Lit) DefaultType ¶
DefaultType returns the default type of an untyped constant.
func (*Lit) EqualInt64 ¶
Click to show internal directories.
Click to hide internal directories.