Documentation ¶
Overview ¶
Package constant provides a mockable wrapper for go/constant.
Index ¶
- type Impl
- func (*Impl) BinaryOp(x_ constant.Value, op token.Token, y_ constant.Value) constant.Value
- func (*Impl) BitLen(x constant.Value) int
- func (*Impl) BoolVal(x constant.Value) bool
- func (*Impl) Bytes(x constant.Value) []byte
- func (*Impl) Compare(x_ constant.Value, op token.Token, y_ constant.Value) bool
- func (*Impl) Denom(x constant.Value) constant.Value
- func (*Impl) Float32Val(x constant.Value) (float32, bool)
- func (*Impl) Float64Val(x constant.Value) (float64, bool)
- func (*Impl) Imag(x constant.Value) constant.Value
- func (*Impl) Int64Val(x constant.Value) (int64, bool)
- func (*Impl) Make(x any) constant.Value
- func (*Impl) MakeBool(b bool) constant.Value
- func (*Impl) MakeFloat64(x float64) constant.Value
- func (*Impl) MakeFromBytes(bytes []byte) constant.Value
- func (*Impl) MakeFromLiteral(lit string, tok token.Token, zero uint) constant.Value
- func (*Impl) MakeImag(x constant.Value) constant.Value
- func (*Impl) MakeInt64(x int64) constant.Value
- func (*Impl) MakeString(s string) constant.Value
- func (*Impl) MakeUint64(x uint64) constant.Value
- func (*Impl) MakeUnknown() constant.Value
- func (*Impl) Num(x constant.Value) constant.Value
- func (*Impl) Real(x constant.Value) constant.Value
- func (*Impl) Shift(x constant.Value, op token.Token, s uint) constant.Value
- func (*Impl) Sign(x constant.Value) int
- func (*Impl) StringVal(x constant.Value) string
- func (*Impl) ToComplex(x constant.Value) constant.Value
- func (*Impl) ToFloat(x constant.Value) constant.Value
- func (*Impl) ToInt(x constant.Value) constant.Value
- func (*Impl) Uint64Val(x constant.Value) (uint64, bool)
- func (*Impl) UnaryOp(op token.Token, y constant.Value, prec uint) constant.Value
- func (*Impl) Val(x constant.Value) any
- type Interface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Impl ¶
type Impl struct{}
func (*Impl) MakeFromLiteral ¶
func (*Impl) MakeUnknown ¶
type Interface ¶
type Interface interface { BinaryOp(x_ constant.Value, op token.Token, y_ constant.Value) constant.Value BitLen(x constant.Value) int BoolVal(x constant.Value) bool Bytes(x constant.Value) []byte Compare(x_ constant.Value, op token.Token, y_ constant.Value) bool Denom(x constant.Value) constant.Value Float32Val(x constant.Value) (float32, bool) Float64Val(x constant.Value) (float64, bool) Imag(x constant.Value) constant.Value Int64Val(x constant.Value) (int64, bool) Make(x any) constant.Value MakeBool(b bool) constant.Value MakeFloat64(x float64) constant.Value MakeFromBytes(bytes []byte) constant.Value MakeFromLiteral(lit string, tok token.Token, zero uint) constant.Value MakeImag(x constant.Value) constant.Value MakeInt64(x int64) constant.Value MakeString(s string) constant.Value MakeUint64(x uint64) constant.Value MakeUnknown() constant.Value Num(x constant.Value) constant.Value Real(x constant.Value) constant.Value Shift(x constant.Value, op token.Token, s uint) constant.Value Sign(x constant.Value) int StringVal(x constant.Value) string ToComplex(x constant.Value) constant.Value ToFloat(x constant.Value) constant.Value ToInt(x constant.Value) constant.Value Uint64Val(x constant.Value) (uint64, bool) UnaryOp(op token.Token, y constant.Value, prec uint) constant.Value Val(x constant.Value) any }
Click to show internal directories.
Click to hide internal directories.