Documentation
¶
Index ¶
Constants ¶
const ( NULL_OBJ = "NULL" RETURN_VALUE_OBJ = "RETURN_VALUE" ERROR_OBJ = "ERROR" FUNCTION_OBJ = "FUNCTION" BUILTIN_OBJ = "BUILTIN" INTEGER_OBJ = "INTEGER" BOOLEAN_OBJ = "BOOLEAN" STRING_OBJ = "STRING" LIST_OBJ = "LIST" MAP_OBJ = "MAP" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Boolean ¶
type Boolean struct { // Represents the value of the Boolean Value bool }
A structure that represents a Boolean object
func (*Boolean) Type ¶
func (b *Boolean) Type() ObjectType
A method of Boolean that returns the Boolean value type
type Builtin ¶
type Builtin struct { // Represents the built-in function Fn BuiltinFunction }
A structure that represents a Builtin Function
func (*Builtin) Inspect ¶
A method of Builtin that returns the string value of the Builtin function object
func (*Builtin) Type ¶
func (b *Builtin) Type() ObjectType
A method of Builtin that returns the Builtin function value type
type BuiltinFunction ¶
A type alias for built in function objects
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
A structure that represents an execution environment
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
A constructor function that generates and returns an enclosed Environment given the outer environment
func NewEnvironment ¶
func NewEnvironment() *Environment
A constructor function that generates and returns a new Environment
type Error ¶
type Error struct { // Represents the error message Message string }
A structure that represents an Error object
func NewError ¶
A constructor function that generates and returns a new Error for a given message and some variadic interface
func (*Error) Type ¶
func (e *Error) Type() ObjectType
A method of Error that returns the Error value type
type Function ¶
type Function struct { // Represents the function parameters Parameters []*syntaxtree.Identifier // Represents the function body Body *syntaxtree.BlockStatement // Represents the function execution environment (scope) Env *Environment }
A structure that represents a Function object
func (*Function) Inspect ¶
A method of Function that returns the string value of the Function object
func (*Function) Type ¶
func (f *Function) Type() ObjectType
A method of Function that returns the Function value type
type HashKey ¶
type HashKey struct { // Represents the hash key type Type ObjectType // Represents the hash key value Value uint64 }
A structure that represents a HashKey object
type Hashable ¶
type Hashable interface {
HashKey() HashKey
}
An interface implemented by objects that can be hashed
type Integer ¶
type Integer struct { // Represents the value of the Integer Value int64 }
A structure that represents an Integer object
func (*Integer) Type ¶
func (i *Integer) Type() ObjectType
A method of Integer that returns the Integer value type
type List ¶
type List struct { // Represents the elements of the list Elements []Object }
A structure that represents a List object
func (*List) Type ¶
func (l *List) Type() ObjectType
A method of List that returns the List value type
type Map ¶
A structure that represents a Map object
type MapPair ¶
type MapPair struct { // Represents the key of the key-value pair Key Object // Represents the value of the key-value pair Value Object }
A structure that represents a Map key-value pair
type Null ¶
type Null struct{}
A structure that represents a Null object
func (*Null) Type ¶
func (n *Null) Type() ObjectType
A method of Null that returns the Null value type
type Object ¶
type Object interface { Type() ObjectType Inspect() string }
A structure that represents an evaluated object
type ReturnValue ¶
type ReturnValue struct { // Represents the returned object Value Object }
A structure that represents a Returned object
func (*ReturnValue) Inspect ¶
func (rv *ReturnValue) Inspect() string
A method of ReturnValue that returns the string value of the Returned object
func (*ReturnValue) Type ¶
func (rv *ReturnValue) Type() ObjectType
A method of ReturnValue that returns the Return value type
type String ¶
type String struct { // Represents the value of the String Value string }
A structure that represents a String object
func (*String) Type ¶
func (s *String) Type() ObjectType
A method of String that returns the String value type