Documentation ¶
Index ¶
- Constants
- Variables
- type Array
- type Boolean
- type Break
- type Builtin
- type Environment
- func (e *Environment) Builtin(name string) *Builtin
- func (e *Environment) Get(name string) (Object, bool)
- func (e *Environment) Import(name string) (Package, bool)
- func (e *Environment) RegisterPackages(pkgs ...Package)
- func (e *Environment) Set(name string, val Object) Object
- func (e *Environment) Type(pkgName string, name string, initial Object) Object
- type Error
- type Float
- type Function
- type FunctionFunc
- type HashKey
- type HashMap
- type HashPair
- type Hashable
- type Integer
- type MemberFunc
- type Null
- type Object
- type ObjectType
- type Package
- type ReturnValue
- type String
Constants ¶
View Source
const ( INTEGER_OBJ = "INTEGER" FLOAT_OBJ = "FLOAT" BOOLEAN_OBJ = "BOOLEAN" STRING_OBJ = "STRING" ARRAY_OBJ = "ARRAY" HASHMAP_OBJ = "HASHMAP" FUNCTION_OBJ = "FUNCTION" BUILTIN_OBJ = "BUILTIN" PACKAGE_OBJ = "PACKAGE" NULL_OBJ = "NULL" RETURN_VALUE_OBJ = "RETURN_VALUE" BREAK_OBJ = "BREAK" ERROR_OBJ = "ERROR" )
Variables ¶
View Source
var ArrayMemberFunc func(name string) MemberFunc
View Source
var BooleanMemberFunc func(string) MemberFunc
View Source
var FloatMemberFunc func(string) MemberFunc
View Source
var HashMapMemberFunc func(name string) MemberFunc
View Source
var IntegerMemberFunc func(string) MemberFunc
View Source
var StringMemberFunc func(string) MemberFunc
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Elements []Object
}
func (*Array) Member ¶
func (ao *Array) Member(name string) MemberFunc
func (*Array) Type ¶
func (ao *Array) Type() ObjectType
type Boolean ¶
type Boolean struct {
Value bool
}
func (*Boolean) Member ¶
func (b *Boolean) Member(name string) MemberFunc
func (*Boolean) Type ¶
func (b *Boolean) Type() ObjectType
type Break ¶
type Break struct { }
func (*Break) Member ¶
func (br *Break) Member(name string) MemberFunc
func (*Break) Type ¶
func (br *Break) Type() ObjectType
type Builtin ¶
type Builtin struct {
Func FunctionFunc
}
func (*Builtin) Member ¶
func (b *Builtin) Member(name string) MemberFunc
func (*Builtin) Type ¶
func (b *Builtin) Type() ObjectType
type Environment ¶
type Environment struct { Stdout io.Writer TimeProvider func() time.Time // contains filtered or unexported fields }
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
func NewEnvironment ¶
func NewEnvironment() *Environment
func (*Environment) Builtin ¶
func (e *Environment) Builtin(name string) *Builtin
func (*Environment) RegisterPackages ¶
func (e *Environment) RegisterPackages(pkgs ...Package)
type Error ¶
type Error struct {
Message string
}
func (*Error) Member ¶
func (e *Error) Member(name string) MemberFunc
func (*Error) Type ¶
func (e *Error) Type() ObjectType
type Float ¶
type Float struct {
Value float64
}
func (*Float) Member ¶
func (f *Float) Member(name string) MemberFunc
func (*Float) Type ¶
func (f *Float) Type() ObjectType
type Function ¶
type Function struct { Parameters []*ast.Identifier Body *ast.BlockStatement Env *Environment }
func (*Function) Member ¶
func (br *Function) Member(name string) MemberFunc
func (*Function) Type ¶
func (f *Function) Type() ObjectType
type FunctionFunc ¶
type HashKey ¶
type HashKey struct { Type ObjectType Value uint64 }
type HashMap ¶
func (*HashMap) Member ¶
func (h *HashMap) Member(name string) MemberFunc
func (*HashMap) Type ¶
func (h *HashMap) Type() ObjectType
type Integer ¶
type Integer struct {
Value int64
}
func (*Integer) Member ¶
func (i *Integer) Member(name string) MemberFunc
func (*Integer) Type ¶
func (i *Integer) Type() ObjectType
type MemberFunc ¶
type Null ¶
type Null struct{}
func (*Null) Member ¶
func (n *Null) Member(name string) MemberFunc
func (*Null) Type ¶
func (n *Null) Type() ObjectType
type Object ¶
type Object interface { Type() ObjectType Member(name string) MemberFunc Inspect() string }
type ObjectType ¶
type ObjectType string
type Package ¶
type Package interface { Object Name() string Member(name string) MemberFunc OnLoad(*Environment) }
type ReturnValue ¶
type ReturnValue struct {
Value Object
}
func (*ReturnValue) Inspect ¶
func (rv *ReturnValue) Inspect() string
func (*ReturnValue) Member ¶
func (rv *ReturnValue) Member(name string) MemberFunc
func (*ReturnValue) Type ¶
func (rv *ReturnValue) Type() ObjectType
Click to show internal directories.
Click to hide internal directories.