object

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 7, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NULL_OBJ  = "NULL"
	ERROR_OBJ = "ERROR"

	STRING_OBJ  = "STRING"
	INTEGER_OBJ = "INTEGER"
	BOOLEAN_OBJ = "BOOLEAN"
	REGEXP_OBJ  = "REGEXP"

	STRUCT_OBJ   = "STRUCT"
	FUNCTION_OBJ = "FUNCTION"
	ARRAY_OBJ    = "ARRAY"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array struct {
	Elements []Object
}

func (*Array) Equals

func (ao *Array) Equals(o Object) bool

func (*Array) String

func (ao *Array) String() string

func (*Array) Type

func (ao *Array) Type() ObjectType

type Boolean

type Boolean struct {
	Value bool
}

func (*Boolean) Equals

func (b *Boolean) Equals(o Object) bool

func (*Boolean) String

func (b *Boolean) String() string

func (*Boolean) Type

func (b *Boolean) Type() ObjectType

type Error

type Error struct {
	Message string
}

func (*Error) Equals

func (e *Error) Equals(o Object) bool

func (*Error) String

func (e *Error) String() string

func (*Error) Type

func (e *Error) Type() ObjectType

type Function

type Function func(args []Object) Object

func (Function) Equals

func (f Function) Equals(o Object) bool

func (Function) String

func (f Function) String() string

func (Function) Type

func (f Function) Type() ObjectType

type Integer

type Integer struct {
	Value int64
}

func (*Integer) Equals

func (i *Integer) Equals(o Object) bool

func (*Integer) String

func (i *Integer) String() string

func (*Integer) Type

func (i *Integer) Type() ObjectType

type Null

type Null struct{}

func (*Null) Equals

func (n *Null) Equals(o Object) bool

func (*Null) String

func (n *Null) String() string

func (*Null) Type

func (n *Null) Type() ObjectType

type Object

type Object interface {
	Type() ObjectType
	String() string
	Equals(o Object) bool
}

type ObjectType

type ObjectType string

type Regexp

type Regexp struct {
	*regexp2.Regexp
	Flags string
}

func (*Regexp) Equals

func (r *Regexp) Equals(o Object) bool

func (*Regexp) String

func (r *Regexp) String() string

func (*Regexp) Type

func (r *Regexp) Type() ObjectType

type String

type String struct {
	Value string
}

func (*String) Equals

func (s *String) Equals(o Object) bool

func (*String) String

func (s *String) String() string

func (*String) Type

func (s *String) Type() ObjectType

type Struct

type Struct map[string]Object

func (Struct) Equals

func (s Struct) Equals(o Object) bool

func (Struct) Get

func (s Struct) Get(key string) (Object, bool)

func (Struct) Has

func (s Struct) Has(key string) bool

func (Struct) Set

func (s Struct) Set(key string, obj Object)

func (Struct) String

func (s Struct) String() string

func (Struct) Type

func (s Struct) Type() ObjectType

Jump to

Keyboard shortcuts

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