Documentation ¶
Index ¶
- Constants
- type Array
- type Boolean
- type Builtin
- type BuiltinFunction
- type Environment
- type Error
- type Function
- type HashKey
- type HashPair
- type Hashable
- type HexFile
- type Integer
- type Map
- type Method
- type MethodFunction
- type Null
- type Object
- type ObjectType
- type ReturnValue
- type Set
- type String
- type Type
Constants ¶
View Source
const ( NullObj = "Null" TypeObj = "Type" SetObj = "Set" MapObj = "Map" HexObj = "Hex File" FileObj = "File" ErrorObj = "Error" ArrayObj = "Array" StringObj = "String" MethodObj = "Method" IntegerObj = "Int" BooleanObj = "Bool" BuiltinObj = "Builtin Function" FunctionObj = "Function" ReturnValueObj = "Return value" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Elements []Object
}
func (*Array) Type ¶
func (arr *Array) Type() ObjectType
type Boolean ¶
type Boolean struct {
Value bool
}
func (*Boolean) Type ¶
func (b *Boolean) Type() ObjectType
type Builtin ¶
type Builtin struct {
Function BuiltinFunction
}
func (*Builtin) Type ¶
func (b *Builtin) Type() ObjectType
type BuiltinFunction ¶
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func NewEnvironment ¶
func NewEnvironment() *Environment
func WrappedEnvironment ¶
func WrappedEnvironment(outerEnv *Environment) *Environment
func (*Environment) IsNestedBlock ¶
func (env *Environment) IsNestedBlock() bool
type Error ¶
type Error struct { // TODO add subtype info referring to a typed enum for different error values Message string }
func (*Error) Type ¶
func (e *Error) Type() ObjectType
type Function ¶
type Function struct { Parameters []*ast.Identifier Body *ast.BlockStatement Env *Environment }
func (*Function) Type ¶
func (f *Function) Type() ObjectType
type HashKey ¶
type HashKey struct { Type ObjectType Value uint64 }
type HexFile ¶ added in v0.2.0
func (*HexFile) Type ¶ added in v0.2.0
func (hf *HexFile) Type() ObjectType
type Integer ¶
type Integer struct {
Value int64
}
func (*Integer) Type ¶
func (i *Integer) Type() ObjectType
type Method ¶
type Method struct {
MethodFunc MethodFunction
}
func (*Method) Type ¶
func (m *Method) Type() ObjectType
type MethodFunction ¶
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 (rv *ReturnValue) Inspect() string
func (*ReturnValue) Type ¶
func (rv *ReturnValue) Type() ObjectType
Click to show internal directories.
Click to hide internal directories.