object

package
v1.5.2 Latest Latest
Warning

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

Go to latest
Published: Mar 22, 2024 License: MIT Imports: 7 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       = "ARRAY"
	OBJ_OBJ       = "OBJECT"
	HTML_OBJ      = "HTML"
	USE_OBJ       = "LAYOUT"
	RESERVE_OBJ   = "RESERVE"
	INSERT_OBJ    = "INSERT"
	BLOCK_OBJ     = "BLOCK"
	BUILTIN_OBJ   = "FUNCTION"
	COMPONENT_OBJ = "COMPONENT"

	BREAK_OBJ       = "BREAK"
	BREAK_IF_OBJ    = "BREAK_IF"
	CONTINUE_OBJ    = "CONTINUE"
	CONTINUE_IF_OBJ = "CONTINUE_IF"
)

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 Break added in v1.2.0

type Break struct{}

func (*Break) Is added in v1.2.0

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

func (*Break) String added in v1.2.0

func (b *Break) String() string

func (*Break) Type added in v1.2.0

func (b *Break) 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 Component added in v1.4.0

type Component struct {
	Name    string
	Content Object
}

func (*Component) Is added in v1.4.0

func (c *Component) Is(t ObjectType) bool

func (*Component) String added in v1.4.0

func (c *Component) String() string

func (*Component) Type added in v1.4.0

func (c *Component) Type() ObjectType

type Continue added in v1.2.0

type Continue struct{}

func (*Continue) Is added in v1.2.0

func (c *Continue) Is(t ObjectType) bool

func (*Continue) String added in v1.2.0

func (c *Continue) String() string

func (*Continue) Type added in v1.2.0

func (c *Continue) Type() ObjectType

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

func (*Env) SetLoopVar added in v1.0.0

func (e *Env) SetLoopVar(pairs map[string]Object)

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 Obj added in v0.0.8

type Obj struct {
	Pairs map[string]Object
}

func (*Obj) Is added in v0.0.8

func (o *Obj) Is(t ObjectType) bool

func (*Obj) String added in v0.0.8

func (a *Obj) String() string

func (*Obj) Type added in v0.0.8

func (o *Obj) 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