object

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	INTEGER_OBJ       = "INTEIRO"
	BOOLEAN_OBJ       = "BOOLEANO"
	NULL_OBJ          = "NULO"
	DEVOLVE_VALUE_OBJ = "DEVOLVE_VALUE"
	ERROR_OBJ         = "ERRO"
	FUNCTION_OBJ      = "PROCESSO"
	STRING_OBJ        = "STRING"
	BUILTIN_OBJ       = "BUILTIN"
	LISTA_OBJ         = "LISTA"
	ESTRUTURA_OBJ     = "ESTRUTURA"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Boolean

type Boolean struct {
	Value string
}

func (*Boolean) Inspect

func (b *Boolean) Inspect() string

func (*Boolean) Type

func (b *Boolean) Type() ObjectType

type Builtin

type Builtin struct {
	Fn BuiltinFunction
}

func (*Builtin) Inspect

func (b *Builtin) Inspect() string

func (*Builtin) Type

func (b *Builtin) Type() ObjectType

type BuiltinFunction

type BuiltinFunction func(args ...Object) Object

type DevolveValue

type DevolveValue struct {
	Value Object
}

func (*DevolveValue) Inspect

func (dv *DevolveValue) Inspect() string

func (*DevolveValue) Type

func (dv *DevolveValue) Type() ObjectType

type Environment

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

func NewEnclosedEnvironment

func NewEnclosedEnvironment(outer *Environment) *Environment

func NewEnvironment

func NewEnvironment() *Environment

func (*Environment) Get

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

func (*Environment) Set

func (e *Environment) Set(name string, val Object) Object

type Error

type Error struct {
	Message string
}

func (*Error) Inspect

func (e *Error) Inspect() string

func (*Error) Type

func (e *Error) Type() ObjectType

type Estrutura added in v0.3.0

type Estrutura struct {
	Items map[string]Object
}

func (*Estrutura) Inspect added in v0.3.0

func (t *Estrutura) Inspect() string

func (*Estrutura) Type added in v0.3.0

func (t *Estrutura) Type() ObjectType

type Integer

type Integer struct {
	Value int64
}

func (*Integer) Inspect

func (i *Integer) Inspect() string

func (*Integer) Type

func (i *Integer) Type() ObjectType

type Lista

type Lista struct {
	Elements []Object
}

func (*Lista) Inspect

func (l *Lista) Inspect() string

func (*Lista) Type

func (l *Lista) Type() ObjectType

type Null

type Null struct {
}

func (*Null) Inspect

func (n *Null) Inspect() string

func (*Null) Type

func (n *Null) Type() ObjectType

type Object

type Object interface {
	Type() ObjectType
	Inspect() string
}

type ObjectType

type ObjectType string

type Proc

type Proc struct {
	Parameters []*ast.Identifier
	Body       *ast.BlockStatement
	Env        *Environment
}

func (*Proc) Inspect

func (p *Proc) Inspect() string

func (*Proc) Type

func (p *Proc) Type() ObjectType

type String

type String struct {
	Value string
}

func (*String) Inspect

func (s *String) Inspect() string

func (*String) Type

func (s *String) Type() ObjectType

Jump to

Keyboard shortcuts

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