object

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	NIL_OBJ = "NIL"
	ERR_OBJ = "ERROR"

	INT_OBJ     = "INTEGER"
	FLOAT_OBJ   = "FLOAT"
	BOOL_OBJ    = "BOOLEAN"
	STR_OBJ     = "STRING"
	ARR_OBJ     = "SLICE"
	HTML_OBJ    = "HTML"
	USE_OBJ     = "LAYOUT"
	RESERVE_OBJ = "RESERVE"
	INSERT_OBJ  = "INSERT"
	BLOCK_OBJ   = "BLOCK"
	BUILTIN_OBJ = "FUNCTION"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Array added in v0.0.2

type Array struct {
	Elements []Object
}

func (*Array) Is added in v0.0.2

func (a *Array) Is(t ObjectType) bool

func (*Array) String added in v0.0.2

func (a *Array) String() string

func (*Array) Type added in v0.0.2

func (a *Array) Type() ObjectType

type Block added in v0.0.2

type Block struct {
	Elements []Object
}

func (*Block) Is added in v0.0.2

func (b *Block) Is(t ObjectType) bool

func (*Block) String added in v0.0.2

func (b *Block) String() string

func (*Block) Type added in v0.0.2

func (b *Block) Type() ObjectType

type Bool added in v0.0.2

type Bool struct {
	Value bool
}

func (*Bool) Is added in v0.0.2

func (b *Bool) Is(t ObjectType) bool

func (*Bool) String added in v0.0.2

func (b *Bool) String() string

func (*Bool) Type added in v0.0.2

func (b *Bool) Type() ObjectType

type Builtin added in v0.0.2

type Builtin struct {
	Fn BuiltinFunction
}

func (*Builtin) String added in v0.0.2

func (b *Builtin) String() string

func (*Builtin) Type added in v0.0.2

func (b *Builtin) Type() ObjectType

type BuiltinFunction added in v0.0.2

type BuiltinFunction func(receiver Object, args ...Object) Object

type Env

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

func EnvFromMap

func EnvFromMap(data map[string]interface{}) (*Env, *fail.Error)

func NewEnclosedEnv added in v0.0.2

func NewEnclosedEnv(outer *Env) *Env

func NewEnv

func NewEnv() *Env

func (*Env) Get

func (e *Env) Get(name string) (Object, bool)

func (*Env) Set

func (e *Env) Set(key string, val Object) error

type Error

type Error struct {
	Err *fail.Error
}

func (*Error) Is added in v0.0.2

func (e *Error) Is(t ObjectType) bool

func (*Error) String

func (e *Error) String() string

func (*Error) Type

func (e *Error) Type() ObjectType

type Float added in v0.0.2

type Float struct {
	Value float64
}

func (*Float) Is added in v0.0.2

func (f *Float) Is(t ObjectType) bool

func (*Float) String added in v0.0.2

func (f *Float) String() string

func (*Float) SubtractFromFloat added in v0.0.2

func (f *Float) SubtractFromFloat(num uint) error

func (*Float) Type added in v0.0.2

func (f *Float) Type() ObjectType

type HTML added in v0.0.2

type HTML struct {
	Value string
}

func (*HTML) Is added in v0.0.2

func (h *HTML) Is(t ObjectType) bool

func (*HTML) String added in v0.0.2

func (h *HTML) String() string

func (*HTML) Type added in v0.0.2

func (h *HTML) Type() ObjectType

type Int added in v0.0.2

type Int struct {
	Value int64
}

func (*Int) Is added in v0.0.2

func (i *Int) Is(t ObjectType) bool

func (*Int) String added in v0.0.2

func (i *Int) String() string

func (*Int) Type added in v0.0.2

func (i *Int) Type() ObjectType

type Nil

type Nil struct{}

func (*Nil) Is added in v0.0.2

func (n *Nil) Is(t ObjectType) bool

func (*Nil) String

func (n *Nil) String() string

func (*Nil) Type

func (n *Nil) Type() ObjectType

type Object

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

type ObjectType

type ObjectType string

type Reserve added in v0.0.2

type Reserve struct {
	Name     string
	Content  Object
	Argument Object
}

func (*Reserve) Is added in v0.0.2

func (r *Reserve) Is(t ObjectType) bool

func (*Reserve) String added in v0.0.2

func (r *Reserve) String() string

func (*Reserve) Type added in v0.0.2

func (r *Reserve) Type() ObjectType

type Str added in v0.0.2

type Str struct {
	Value string
}

func (*Str) Is added in v0.0.2

func (s *Str) Is(t ObjectType) bool

func (*Str) String added in v0.0.2

func (s *Str) String() string

func (*Str) Type added in v0.0.2

func (s *Str) Type() ObjectType

type Use added in v0.0.2

type Use struct {
	Path    string
	Content Object
}

func (*Use) Is added in v0.0.2

func (u *Use) Is(t ObjectType) bool

func (*Use) String added in v0.0.2

func (u *Use) String() string

func (*Use) Type added in v0.0.2

func (u *Use) Type() ObjectType

Jump to

Keyboard shortcuts

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