object

package
v0.1.6 Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2026 License: GPL-3.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ParseArgs

func ParseArgs(args Arguments, vals []*Value, scope scope.Scope[string, *Value])

Types

type Argument

type Argument struct {
	Name    string
	Default *Value
}

type Arguments

type Arguments struct {
	Elements []Argument
	Last     *string
}

func (Arguments) String

func (a Arguments) String() string

type Array

type Array struct{ Elements []*Value }

func (Array) Equals

func (a Array) Equals(value *Value) bool

func (Array) Type

func (Array) Type() Type

type Bool

type Bool struct{ Value bool }

func (Bool) Equals

func (b Bool) Equals(value *Value) bool

func (Bool) Type

func (Bool) Type() Type

type Error

type Error errors.Error

func (Error) Equals

func (e Error) Equals(value *Value) bool

func (Error) Type

func (Error) Type() Type

type ExpressionResult

type ExpressionResult struct {
	Signal    signal.Signal
	SignalVal *Value
	Trace     stacktrace.StackTrace
}

func (ExpressionResult) Error

func (s ExpressionResult) Error() string

func (ExpressionResult) IntoSubroutineResult

func (s ExpressionResult) IntoSubroutineResult() (SubroutineResult, bool)

func (ExpressionResult) IntoSubroutineResultStrict

func (s ExpressionResult) IntoSubroutineResultStrict(pos pos.Pos) SubroutineResult

func (ExpressionResult) String

func (s ExpressionResult) String() string

type InnerValue

type InnerValue interface {
	Type() Type
	Equals(value *Value) bool
	// contains filtered or unexported methods
}

type Method

type Method struct {
	Subroutine *Subroutine
	It         *Value
}

func (Method) Equals

func (m Method) Equals(value *Value) bool

func (Method) Type

func (Method) Type() Type

type Null

type Null struct{}

func (Null) Equals

func (Null) Equals(value *Value) bool

func (Null) Type

func (Null) Type() Type

type Number

type Number struct{ Value float64 }

func (Number) Equals

func (n Number) Equals(value *Value) bool

func (Number) Type

func (Number) Type() Type

type Object

type Object struct {
	// an object should always be initialized
	Map map[string]*Value
}

func (Object) Equals

func (o Object) Equals(value *Value) bool

func (Object) Type

func (Object) Type() Type

type String

type String struct{ Value string }

func (String) Equals

func (s String) Equals(value *Value) bool

func (String) Type

func (String) Type() Type

type Subroutine

type Subroutine struct {
	Name      string
	Arguments Arguments
	Scope     scope.Scope[string, *Value]
	Prototype *Value
	BuiltIn   func(*vm.VM[*Value], scope.Scope[string, *Value]) SubroutineResult
	Code      ast.BlockExpression
}

func (*Subroutine) Equals

func (s *Subroutine) Equals(value *Value) bool

func (*Subroutine) Type

func (*Subroutine) Type() Type

type SubroutineResult

type SubroutineResult struct {
	Signal    signal.SubroutineSignal
	SignalVal *Value
	Trace     stacktrace.StackTrace
}

func (SubroutineResult) AsExpressionResult

func (s SubroutineResult) AsExpressionResult() ExpressionResult

func (SubroutineResult) Error

func (s SubroutineResult) Error() string

func (SubroutineResult) String

func (s SubroutineResult) String() string

type Type

type Type byte
const (
	TypeNull Type = iota
	TypeObject
	TypeSubroutine
	TypeArray
	TypeInt
	TypeNumber
	TypeString
	TypeBool
	TypeError
)

func (Type) String

func (t Type) String() string

type Value

type Value struct {
	// contains filtered or unexported fields
}

func IntoValue

func IntoValue(err error) *Value

func New added in v0.1.4

func New(i InnerValue) *Value

func (*Value) Clone added in v0.1.4

func (v *Value) Clone() *Value

func (*Value) Equals added in v0.1.4

func (v *Value) Equals(value *Value) bool

func (*Value) InnerValue added in v0.1.4

func (v *Value) InnerValue() InnerValue

func (*Value) IsNull

func (v *Value) IsNull() bool

func (*Value) Normalize

func (v *Value) Normalize() *Value

func (*Value) Set added in v0.1.4

func (v *Value) Set(i InnerValue)

func (*Value) String

func (v *Value) String() string

func (*Value) Type added in v0.1.4

func (v *Value) Type() Type

func (*Value) Uuid added in v0.1.4

func (v *Value) Uuid() uuid.UUID

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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