raw

package
v0.0.0-...-58f8293 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Add

func Add(x Value, v Value) (any, error)

Add v + x

func Compare

func Compare(a Value, b Value) (int, error)

Compare returns an integer comparing two Values . The result will be 0 if a==b, -1 if a < b, and +1 if a > b.

func Div

func Div(x Value, v Value) (any, error)

Div v / x

func Len

func Len(value Value) int

func Mod

func Mod(x Value, v Value) (any, error)

Mod v % x

func Mul

func Mul(x Value, v Value) (any, error)

Mul v * x

func Pow

func Pow(x Value, v Value) (any, error)

Pow v ** x

func Sub

func Sub(x Value, v Value) (any, error)

Sub v - x

func ToBool

func ToBool(value Value) bool

func ToFloat

func ToFloat(value Value) float64

func ToInt

func ToInt(value Value) int64

func ToString

func ToString(value Value) string

func ToUint

func ToUint(value Value) uint64

Types

type ArrayValue

type ArrayValue []Value

func (ArrayValue) Index

func (arr ArrayValue) Index(i int) Value

func (ArrayValue) Iter

func (arr ArrayValue) Iter() Iter

func (ArrayValue) Kind

func (ArrayValue) Kind() Kind

func (ArrayValue) Len

func (arr ArrayValue) Len() (i int)

type BoolValue

type BoolValue bool

func (BoolValue) Kind

func (BoolValue) Kind() Kind

type FloatValue

type FloatValue float64

func (FloatValue) Kind

func (FloatValue) Kind() Kind

type IntValue

type IntValue int64

func (IntValue) Kind

func (IntValue) Kind() Kind

type Iter

type Iter interface {
	Next() bool
	Val() IterVal
}

type IterVal

type IterVal interface {
	Key() Value
	Value() Value
}

type Kind

type Kind int
const (
	Invalid Kind = iota
	Uint
	Int
	Float
	String
	Bool
	Array
	Map
)

type MapValue

type MapValue map[string]Value

func (MapValue) Iter

func (m MapValue) Iter() Iter

func (MapValue) Keys

func (m MapValue) Keys() []string

func (MapValue) Kind

func (MapValue) Kind() Kind

type StringValue

type StringValue string

func (StringValue) Kind

func (StringValue) Kind() Kind

type UintValue

type UintValue uint64

func (UintValue) Kind

func (UintValue) Kind() Kind

type Value

type Value interface {
	Kind() Kind
}

func ValueOf

func ValueOf(in any) Value

Jump to

Keyboard shortcuts

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