Documentation
¶
Index ¶
- Constants
- type Array
- type Boolean
- type Break
- type Builtin
- type BuiltinFunction
- type Char
- type Continue
- type Environment
- type Float
- type Function
- type Hash
- type HashKey
- type HashPair
- type Hashable
- type Integer
- type Null
- type Object
- type ObjectType
- type ReturnValue
- type String
- type Variable
- type VariableType
Constants ¶
View Source
const ( ARRAY_OBJ = "ARRAY" INTEGER_OBJ = "INTEGER" BOOLEAN_OBJ = "BOOLEAN" STRING_OBJ = "STRING" FLOAT_OBJ = "FLOAT" CHAR_OBJ = "CHARACTER" NULL_OBJ = "NULL" RETURN_VALUE_OBJ = "RETURN_VALUE" FUNCTION_OBJ = "FUNCTION" BUILTIN_OBJ = "BUILTIN" HASH_OBJ = "HASH" CONTINUE_OBJ = "CONTINUE" BREAK_OBJ = "BREAK" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Boolean ¶
type Boolean struct {
Value bool
}
func (*Boolean) Type ¶
func (b *Boolean) Type() ObjectType
type Builtin ¶
type Builtin struct {
Fn BuiltinFunction
}
func (*Builtin) Type ¶
func (b *Builtin) Type() ObjectType
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
func NewEnvironment ¶
func NewEnvironment() *Environment
func (*Environment) Set ¶
func (e *Environment) Set(name string, val Object, valType VariableType)
func (*Environment) Update ¶
func (e *Environment) Update(name string, newVal Object, valType VariableType)
type Float ¶
type Float struct {
Value float64
}
func (*Float) Type ¶
func (f *Float) Type() ObjectType
type Function ¶
type Function struct {
Name *ast.Identifier
Parameters []*ast.FunctionParameters
ReturnType []*ast.FunctionReturnType
Body *ast.FunctionBody
Env *Environment
}
func (*Function) Type ¶
func (f *Function) Type() ObjectType
type HashKey ¶
type HashKey struct {
Type ObjectType
Value uint64
}
type Integer ¶
type Integer struct {
Value int64
}
func (*Integer) Type ¶
func (i *Integer) 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 (rv *ReturnValue) Inspect() string
func (*ReturnValue) Type ¶
func (rv *ReturnValue) Type() ObjectType
type String ¶
type String struct {
Value string
}
func (*String) Type ¶
func (s *String) Type() ObjectType
type Variable ¶
type Variable struct {
Value Object
Type VariableType
}
Click to show internal directories.
Click to hide internal directories.