Documentation ¶
Index ¶
Constants ¶
View Source
const ( OBJ_INTEGER = "INTEGER" OBJ_FLOAT = "FLOAT" OBJ_STRING = "STRING" OBJ_BOOLEAN = "BOOLEAN" OBJ_NULL = "NULL" OBJ_RETURN_VALUE = "RETURN_VALUE" OBJ_FUNCTION = "FUNCTION" OBJ_ERROR = "ERROR" OBJ_BUILTIN = "BUILTIN" OBJ_ARRAY = "ARRAY" OBJ_HASH = "HASH" OBJ_LOOP = "LOOP" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Elements []Object
}
func (*Array) Type ¶
func (ao *Array) Type() ObjectType
type Boolean ¶
type Boolean struct {
Value bool
}
func (*Boolean) Type ¶
func (b *Boolean) Type() ObjectType
type Builtin ¶
type Builtin struct {
Fn BuiltinFunction
}
func (*Builtin) Type ¶
func (b *Builtin) Type() ObjectType
type BuiltinFunction ¶
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
func NewEnvironment ¶
func NewEnvironment() *Environment
type Error ¶
type Error struct {
Message string
}
func (*Error) Type ¶
func (e *Error) Type() ObjectType
type Float ¶
type Float struct {
Value float64
}
func (*Float) Type ¶
func (f *Float) Type() ObjectType
type Function ¶
type Function struct { Parameters []*ast.Identifier Body *ast.BlockStatement Env *Environment }
func (*Function) Type ¶
func (f *Function) Type() ObjectType
type Integer ¶
type Integer struct {
Value int64
}
func (*Integer) Type ¶
func (i *Integer) Type() ObjectType
type Loop ¶
type Loop struct { Condition ast.Expression Body *ast.BlockStatement Env *Environment }
func (*Loop) Type ¶
func (l *Loop) Type() ObjectType
type Object ¶
type Object interface { Type() ObjectType // Returns a string representation of the object. // Most of the time, this will be the literal value of the object. Inspect() string }
type ObjectType ¶
type ObjectType string
type ReturnValue ¶
type ReturnValue struct {
Value Object
}
func (*ReturnValue) Inspect ¶
func (rv *ReturnValue) Inspect() string
func (*ReturnValue) Type ¶
func (rv *ReturnValue) Type() ObjectType
Click to show internal directories.
Click to hide internal directories.