object

package
v0.0.0-...-1d17be5 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2020 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

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

Variables

This section is empty.

Functions

This section is empty.

Types

type Array

type Array struct {
	Elements []Object
}

func (*Array) Inspect

func (ao *Array) Inspect() string

func (*Array) Type

func (ao *Array) Type() Type

type Boolean

type Boolean struct {
	Value bool
}

func (*Boolean) Inspect

func (b *Boolean) Inspect() string

func (*Boolean) MapKey

func (b *Boolean) MapKey() MapKey

func (*Boolean) Type

func (b *Boolean) Type() Type

type Builtin

type Builtin struct {
	Fn BuiltinFunction
}

func (*Builtin) Inspect

func (b *Builtin) Inspect() string

func (*Builtin) Type

func (b *Builtin) Type() Type

type BuiltinFunction

type BuiltinFunction func(args ...Object) Object

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() Type

type Function

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

func (*Function) Inspect

func (f *Function) Inspect() string

func (*Function) Type

func (f *Function) Type() Type

type Integer

type Integer struct {
	Value int64
}

func (*Integer) Inspect

func (i *Integer) Inspect() string

func (*Integer) MapKey

func (i *Integer) MapKey() MapKey

func (*Integer) Type

func (i *Integer) Type() Type

type Map

type Map struct {
	Pairs map[MapKey]MapPair
}

func (*Map) Inspect

func (m *Map) Inspect() string

func (*Map) Type

func (m *Map) Type() Type

type MapKey

type MapKey struct {
	Type  Type
	Value uint64
}

type MapPair

type MapPair struct {
	Key   Mappable
	Value Object
}

type Mappable

type Mappable interface {
	Object
	MapKey() MapKey
}

type Null

type Null struct {
}

func (*Null) Inspect

func (n *Null) Inspect() string

func (*Null) Type

func (n *Null) Type() Type

type Object

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

Object is the internal representation of any type in the doggo language.

type ReturnValue

type ReturnValue struct {
	Value Object
}

func (*ReturnValue) Inspect

func (rv *ReturnValue) Inspect() string

func (*ReturnValue) Type

func (rv *ReturnValue) Type() Type

type String

type String struct {
	Value string
}

func (*String) Inspect

func (s *String) Inspect() string

func (*String) MapKey

func (s *String) MapKey() MapKey

func (*String) Type

func (s *String) Type() Type

type Type

type Type string

Jump to

Keyboard shortcuts

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