Documentation ¶
Index ¶
Constants ¶
View Source
const ( INTEGER_OBJ = "INTEGER" FLOAT_OBJ = "FLOAT" STRING_OBJ = "STRING" BOOLEAN_OBJ = "BOOLEAN" ARRAY_OBJ = "ARRAY" HASH_OBJ = "HASH" NULL_OBJ = "NULL" RETURN_OBJ = "RETURN_VALUE" FUNCTION_OBJ = "FUNCTION" ERROR_OBJ = "ERROR" BUILTIN_OBJ = "BUILTIN" JUMP_OBJ = "JUMP" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Elements []Object
}
func (*Array) Type ¶
func (array *Array) Type() ObjectType
type Boolean ¶
type Boolean struct {
Value bool
}
func (*Boolean) Type ¶
func (boolean *Boolean) Type() ObjectType
type Builtin ¶
type Builtin struct {
Fn builtinFunction
}
func (*Builtin) Type ¶
func (builtin *Builtin) Type() ObjectType
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
Constructor function for local environment *outer points to the outer environment thereby creating the scope chain
func NewEnvironment ¶
func NewEnvironment() *Environment
Constructor function for global environment *outer points to null as this is the outermost environment
func (*Environment) Get ¶
func (environment *Environment) Get(name string) (Object, bool)
Retrieves value of supplied identifier from environment If identifier is not present in current environment, look up in outer environment (Scope chain)
type Error ¶
type Error struct {
Message string
}
func (*Error) Type ¶
func (err *Error) Type() ObjectType
type Float ¶
type Float struct {
Value float64
}
func (*Float) Type ¶
func (float *Float) Type() ObjectType
type Function ¶
type Function struct { Parameters []*ast.Identifier Body *ast.BlockStatement Env *Environment }
func (*Function) Type ¶
func (function *Function) Type() ObjectType
type HashKey ¶
type HashKey struct { Type ObjectType Value uint64 }
type Integer ¶
type Integer struct {
Value int
}
func (*Integer) Type ¶
func (integer *Integer) Type() ObjectType
type Jump ¶
type Jump struct {
Signal string
}
func (*Jump) Type ¶
func (jump *Jump) Type() ObjectType
type Object ¶
type Object interface { Type() ObjectType Inspect() string }
type ObjectType ¶
type ObjectType string
type ReturnValue ¶
type ReturnValue struct {
Value Object
}
func (*ReturnValue) Inspect ¶
func (returnValue *ReturnValue) Inspect() string
func (*ReturnValue) Type ¶
func (returnValue *ReturnValue) Type() ObjectType
Click to show internal directories.
Click to hide internal directories.