Documentation
¶
Index ¶
Constants ¶
View Source
const ( INTEGER_OBJ = "INTEGER" BOOLEAN_OBJ = "BOOLEAN" NULL_OBJ = "NULL" RETURN_VALUE_OBJ = "RETURN_VALUE" ERROR_OBJ = "ERROR" FUNCTION_OBJ = "FUNCTION" STRING_OBJ = "STRING" CHAR_OBJ = "CHAR" FLOAT_OBJ = "FLOAT" BUILTIN_OBJ = "BUILTIN" ARRAY_OBJ = "ARRAY" HASH_OBJ = "HASH" MODULE_OBJ = "MODULE" )
constant for each object type
Variables ¶
this allows us only to have on Bolean object and Null object
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Elements []Object
}
array obj
func (*Array) Type ¶
func (ao *Array) Type() ObjectType
type Boolean ¶
type Boolean struct {
Value bool
}
bool obj
func (*Boolean) Type ¶
func (i *Boolean) Type() ObjectType
type Builtin ¶
type Builtin struct {
Fn BuiltinFunction
}
builtin obj
func (*Builtin) Type ¶
func (b *Builtin) Type() ObjectType
type BuiltinFunction ¶
type BuiltinFunction func(node *ast.CallExpression, args ...Object) Object
type Char ¶
type Char struct {
Value rune
}
char obj
func (*Char) Type ¶
func (s *Char) Type() ObjectType
type Environment ¶
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
Environment
func NewEnvironment ¶
func NewEnvironment() *Environment
type Float ¶
type Float struct {
Value float64
}
float obj
func (*Float) Type ¶
func (s *Float) Type() ObjectType
type Function ¶
type Function struct {
Parameters []*ast.Identifier
Body *ast.BlockStatement
Env *Environment
}
function object
func (*Function) Type ¶
func (f *Function) Type() ObjectType
type Integer ¶
type Integer struct {
Value int64
}
integer obj
func (*Integer) Type ¶
func (i *Integer) Type() ObjectType
type Module ¶ added in v0.1.4
func (*Module) Type ¶ added in v0.1.4
func (m *Module) Type() ObjectType
type Object ¶
type Object interface {
Type() ObjectType
Inspect() string
}
type ObjectType ¶
type ObjectType string
type ReturnValue ¶
type ReturnValue struct {
Value Object
}
return value obj
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.