weakvalue

package
v0.0.0-...-dfe0916 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 23, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Type

type Type int
const (
	ValueNull    Type = 0
	ValueInteger Type = 1
	ValueUint    Type = 2
	ValueFloat   Type = 3
	ValueString  Type = 4
)

type WeakFloat

type WeakFloat struct {
	Value float64
}

func (*WeakFloat) Add

func (w *WeakFloat) Add(v WeakValue) WeakValue

func (*WeakFloat) AsBoolean

func (w *WeakFloat) AsBoolean() bool

func (*WeakFloat) AsFloat

func (w *WeakFloat) AsFloat() float64

func (*WeakFloat) AsInteger

func (w *WeakFloat) AsInteger() int64

func (*WeakFloat) AsString

func (w *WeakFloat) AsString() string

func (*WeakFloat) AsUint

func (w *WeakFloat) AsUint() uint64

func (*WeakFloat) Binary

func (w *WeakFloat) Binary(op opcode.Op, v WeakValue) WeakValue

func (*WeakFloat) EqualTo

func (w *WeakFloat) EqualTo(v WeakValue) bool

func (*WeakFloat) IsNull

func (w *WeakFloat) IsNull() bool

func (*WeakFloat) String

func (w *WeakFloat) String() string

func (*WeakFloat) Sub

func (w *WeakFloat) Sub(v WeakValue) WeakValue

func (*WeakFloat) Type

func (w *WeakFloat) Type() Type

func (*WeakFloat) Unary

func (w *WeakFloat) Unary(op opcode.Op) WeakValue

type WeakInteger

type WeakInteger struct {
	Value int64
}

WeakInteger represents integer value.

func (*WeakInteger) Add

func (w *WeakInteger) Add(v WeakValue) WeakValue

func (*WeakInteger) AsBoolean

func (w *WeakInteger) AsBoolean() bool

func (*WeakInteger) AsFloat

func (w *WeakInteger) AsFloat() float64

func (*WeakInteger) AsInteger

func (w *WeakInteger) AsInteger() int64

func (*WeakInteger) AsString

func (w *WeakInteger) AsString() string

func (*WeakInteger) AsUint

func (w *WeakInteger) AsUint() uint64

func (*WeakInteger) Binary

func (w *WeakInteger) Binary(op opcode.Op, v WeakValue) WeakValue

func (*WeakInteger) EqualTo

func (w *WeakInteger) EqualTo(v WeakValue) bool

EqualTo

func (*WeakInteger) IsNull

func (w *WeakInteger) IsNull() bool

func (*WeakInteger) String

func (w *WeakInteger) String() string

String returns a string representation of the value.

func (*WeakInteger) Sub

func (w *WeakInteger) Sub(v WeakValue) WeakValue

func (*WeakInteger) Type

func (w *WeakInteger) Type() Type

func (*WeakInteger) Unary

func (w *WeakInteger) Unary(op opcode.Op) WeakValue

type WeakNull

type WeakNull struct {
}

WeakNull represents a null value.

func (*WeakNull) Add

func (w *WeakNull) Add(v WeakValue) WeakValue

func (*WeakNull) AsBoolean

func (w *WeakNull) AsBoolean() bool

func (*WeakNull) AsFloat

func (w *WeakNull) AsFloat() float64

func (*WeakNull) AsInteger

func (w *WeakNull) AsInteger() int64

func (*WeakNull) AsString

func (w *WeakNull) AsString() string

func (*WeakNull) AsUint

func (w *WeakNull) AsUint() uint64

func (*WeakNull) Binary

func (w *WeakNull) Binary(op opcode.Op, v WeakValue) WeakValue

func (*WeakNull) EqualTo

func (w *WeakNull) EqualTo(v WeakValue) bool

func (*WeakNull) IsNull

func (w *WeakNull) IsNull() bool

func (*WeakNull) String

func (w *WeakNull) String() string

func (*WeakNull) Sub

func (w *WeakNull) Sub(v WeakValue) WeakValue

func (*WeakNull) Type

func (w *WeakNull) Type() Type

func (*WeakNull) Unary

func (w *WeakNull) Unary(op opcode.Op) WeakValue

type WeakString

type WeakString struct {
	Value string
}

func (*WeakString) Add

func (w *WeakString) Add(v WeakValue) WeakValue

func (*WeakString) AsBoolean

func (w *WeakString) AsBoolean() bool

func (*WeakString) AsFloat

func (w *WeakString) AsFloat() float64

func (*WeakString) AsInteger

func (w *WeakString) AsInteger() int64

func (*WeakString) AsString

func (w *WeakString) AsString() string

func (*WeakString) AsUint

func (w *WeakString) AsUint() uint64

func (*WeakString) Binary

func (w *WeakString) Binary(op opcode.Op, v WeakValue) WeakValue

func (*WeakString) EqualTo

func (w *WeakString) EqualTo(v WeakValue) bool

func (*WeakString) IsNull

func (w *WeakString) IsNull() bool

func (*WeakString) String

func (w *WeakString) String() string

func (*WeakString) Sub

func (w *WeakString) Sub(v WeakValue) WeakValue

func (*WeakString) ToFloat

func (w *WeakString) ToFloat() (float64, bool)

func (*WeakString) ToInteger

func (w *WeakString) ToInteger() (int64, bool)

func (*WeakString) ToUint

func (w *WeakString) ToUint() (uint64, bool)

func (*WeakString) Type

func (w *WeakString) Type() Type

func (*WeakString) Unary

func (w *WeakString) Unary(op opcode.Op) WeakValue

type WeakUint

type WeakUint struct {
	Value uint64
}

func (*WeakUint) Add

func (w *WeakUint) Add(v WeakValue) WeakValue

func (*WeakUint) AsBoolean

func (w *WeakUint) AsBoolean() bool

func (*WeakUint) AsFloat

func (w *WeakUint) AsFloat() float64

func (*WeakUint) AsInteger

func (w *WeakUint) AsInteger() int64

func (*WeakUint) AsString

func (w *WeakUint) AsString() string

func (*WeakUint) AsUint

func (w *WeakUint) AsUint() uint64

func (*WeakUint) Binary

func (w *WeakUint) Binary(op opcode.Op, v WeakValue) WeakValue

func (*WeakUint) EqualTo

func (w *WeakUint) EqualTo(v WeakValue) bool

func (*WeakUint) IsNull

func (w *WeakUint) IsNull() bool

func (*WeakUint) String

func (w *WeakUint) String() string

func (*WeakUint) Sub

func (w *WeakUint) Sub(v WeakValue) WeakValue

func (*WeakUint) Type

func (w *WeakUint) Type() Type

func (*WeakUint) Unary

func (w *WeakUint) Unary(op opcode.Op) WeakValue

type WeakValue

type WeakValue interface {
	Type() Type
	EqualTo(WeakValue) bool
	String() string

	IsNull() bool
	AsBoolean() bool
	AsInteger() int64
	AsUint() uint64
	AsFloat() float64
	AsString() string

	Unary(opcode.Op) WeakValue
	Binary(opcode.Op, WeakValue) WeakValue

	Add(WeakValue) WeakValue
	Sub(WeakValue) WeakValue
}

WeakValue is a value of weak type

func NewFalse

func NewFalse() WeakValue

WeakFalse creates an instance of false, as a integer.

func NewFloat

func NewFloat(f float64) WeakValue

func NewInteger

func NewInteger(i int64) WeakValue

NewInteger creates an instance of integer.

func NewNull

func NewNull() WeakValue

func NewString

func NewString(s string) WeakValue

func NewTrue

func NewTrue() WeakValue

WeakTrue creates an instance of true, as a integer.

func NewUint

func NewUint(u uint64) WeakValue

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL