object

package
v0.0.0-...-253af64 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2021 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Overview

Package object -

Index

Constants

View Source
const (
	INTEGER_OBJ      = "INTEGER"
	BOOLEAN_OBJ      = "BOOLEAN"
	NULL_OBJ         = "NULL"
	RETURN_VALUE_OBJ = "RETURN_VALUE"
	ERROR_OBJ        = "ERROR"
	FUNCTION_OBJ     = "FUNCTION"
	STRING_OBJ       = "STRING"
	BUILTIN_OBJ      = "BUILTIN"
	ARRAY_OBJ        = "ARRAY"
	HASH_OBJ         = "HASH"
)

nolint: revive

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array struct {
	Elements []Object
}

Array -

func (*Array) Inspect

func (ao *Array) Inspect() string

Inspect -

func (*Array) Type

func (ao *Array) Type() ObjectType

Type -

type Boolean

type Boolean struct {
	Value bool
}

Boolean -

func (*Boolean) HashKey

func (b *Boolean) HashKey() HashKey

HashKey -

func (*Boolean) Inspect

func (b *Boolean) Inspect() string

Inspect -

func (*Boolean) Type

func (b *Boolean) Type() ObjectType

Type -

type Builtin

type Builtin struct {
	Fn BuiltinFunction
}

Builtin -

func (*Builtin) Inspect

func (b *Builtin) Inspect() string

Inspect -

func (*Builtin) Type

func (b *Builtin) Type() ObjectType

Type -

type BuiltinFunction

type BuiltinFunction func(args ...Object) Object

BuiltinFunction -

type Environment

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

Environment -

func NewEnclosedEnvironment

func NewEnclosedEnvironment(outer *Environment) *Environment

NewEnclosedEnvironment -

func NewEnvironment

func NewEnvironment() *Environment

NewEnvironment -

func (*Environment) Get

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

Get -

func (*Environment) Set

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

Set -

type Error

type Error struct {
	Message string
}

Error -

func (*Error) Inspect

func (e *Error) Inspect() string

Inspect -

func (*Error) Type

func (e *Error) Type() ObjectType

Type -

type Function

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

Function -

func (*Function) Inspect

func (f *Function) Inspect() string

Inspect -

func (*Function) Type

func (f *Function) Type() ObjectType

Type -

type Hash

type Hash struct {
	Pairs map[HashKey]HashPair
}

Hash -

func (*Hash) Inspect

func (h *Hash) Inspect() string

Inspect -

func (*Hash) Type

func (h *Hash) Type() ObjectType

Type -

type HashKey

type HashKey struct {
	Type  ObjectType
	Value uint64
}

HashKey -

type HashPair

type HashPair struct {
	Key   Object
	Value Object
}

HashPair -

type Hashable

type Hashable interface {
	HashKey() HashKey
}

Hashable -

type Integer

type Integer struct {
	Value int64
}

Integer -

func (*Integer) HashKey

func (i *Integer) HashKey() HashKey

HashKey -

func (*Integer) Inspect

func (i *Integer) Inspect() string

Inspect -

func (*Integer) Type

func (i *Integer) Type() ObjectType

Type -

type Null

type Null struct{}

Null -

func (*Null) Inspect

func (n *Null) Inspect() string

Inspect -

func (*Null) Type

func (n *Null) Type() ObjectType

Type -

type Object

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

Object -

type ObjectType

type ObjectType string

ObjectType - ignore stutter warning nolint: revive

type ReturnValue

type ReturnValue struct {
	Value Object
}

ReturnValue -

func (*ReturnValue) Inspect

func (rv *ReturnValue) Inspect() string

Inspect -

func (*ReturnValue) Type

func (rv *ReturnValue) Type() ObjectType

Type -

type String

type String struct {
	Value string
}

String -

func (*String) HashKey

func (s *String) HashKey() HashKey

HashKey -

func (*String) Inspect

func (s *String) Inspect() string

Inspect -

func (*String) Type

func (s *String) Type() ObjectType

Type -

Jump to

Keyboard shortcuts

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