Documentation ¶
Index ¶
Constants ¶
View Source
const ( // INTEGER object type INTEGER = "INTEGER" // BOOLEAN object type BOOLEAN = "BOOLEAN" // STRING object type STRING = "STRING" // NULL object type NULL = "NULL" // VOID object type VOID = "VOID" // RETURN object wrapper type RETURN = "RETURN" // ERROR object type ERROR = "ERROR" // FUNCTION object type FUNCTION = "FUNCTION" // BUILTIN object type BUILTIN = "BUILTIN" // ARRAY object type ARRAY = "ARRAY" // HASH object type HASH = "HASH" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Boolean ¶
type Boolean struct {
Value bool
}
Boolean object.
type Builtin ¶
type Builtin struct {
Fn BuiltinFunction
}
Builtin is a wrapper over built-in function.
type BuiltinFunction ¶
BuiltinFunction is a built-in function type.
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment is a map of known objects.
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
NewEnclosedEnvironment returns new Environment instance
func NewEnvironment ¶
func NewEnvironment() *Environment
NewEnvironment returns new Environment instance
func (*Environment) Get ¶
func (e *Environment) Get(name string) (Object, bool)
Get returns value of given key from Enviroment's map. If not found, looks for value in Environment's ancestor.
func (*Environment) Set ¶
func (e *Environment) Set(name string, val Object) Object
Set puts the value of given key in Enviroment's map.
func (*Environment) ShallowGet ¶
func (e *Environment) ShallowGet(name string) (Object, bool)
ShallowGet returns value of given key from Enviroment's map.
type Function ¶
type Function struct { Parameters []*ast.Identifier Body *ast.BlockStatement Env *Environment }
Function object.
type Hashable ¶
type Hashable interface {
HashKey() HashKey
}
Hashable interface represents types that can be keys in hash object.
type Integer ¶
type Integer struct {
Value int64
}
Integer object.
type Return ¶
type Return struct {
Value Object
}
Return object is a wrapper to a object that gets returned.
Click to show internal directories.
Click to hide internal directories.