Documentation ¶
Index ¶
- Constants
- type Array
- type Boolean
- type Builtin
- type BuiltinFunction
- type BytesFile
- type CallableBuiltin
- type ElfFile
- type Environment
- type Error
- type File
- 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 RuntimeError
- type RuntimeErrorType
- type Set
- type String
- type Type
Constants ¶
View Source
const ( TypeError RuntimeErrorType = "Type Error" KeyError RuntimeErrorType = "Key Error" HexError = "Hex Error" ElfError = "Elf Error" BytesError = "Bytes Error" FileError = "File Error" CustomError = "Runtime Error" )
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 { Name string ArgTypes []ObjectType Function BuiltinFunction }
func (*Builtin) GetBuiltinArgTypes ¶ added in v0.4.0
func (b *Builtin) GetBuiltinArgTypes() []ObjectType
func (*Builtin) GetBuiltinName ¶ added in v0.4.0
func (*Builtin) Type ¶
func (b *Builtin) Type() ObjectType
type BuiltinFunction ¶
type BytesFile ¶ added in v0.3.0
func NewBytesFile ¶ added in v0.3.0
func (*BytesFile) Type ¶ added in v0.3.0
func (bf *BytesFile) Type() ObjectType
type CallableBuiltin ¶ added in v0.4.0
type CallableBuiltin interface { GetBuiltinName() string GetBuiltinArgTypes() []ObjectType Call(args ...Object) Object }
type ElfFile ¶ added in v0.3.0
func NewElfFile ¶ added in v0.3.0
func (*ElfFile) Type ¶ added in v0.3.0
func (ef *ElfFile) Type() ObjectType
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 {
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 NewHexFile ¶ added in v0.3.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 { Name string ArgTypes []ObjectType MethodFunc MethodFunction }
func (*Method) GetBuiltinArgTypes ¶ added in v0.4.0
func (m *Method) GetBuiltinArgTypes() []ObjectType
func (*Method) GetBuiltinName ¶ added in v0.4.0
func (*Method) Type ¶
func (m *Method) Type() ObjectType
type MethodFunction ¶
type Object ¶
type Object interface { Type() ObjectType Inspect() string }
type ObjectType ¶
type ObjectType string
const ( AnyObj ObjectType = "Any" AnyVarargs ObjectType = "Any Varargs" AnyOptional ObjectType = "Any optional" NullObj ObjectType = "Null" TypeObj ObjectType = "Type" SetObj ObjectType = "Set" MapObj ObjectType = "Map" HexObj ObjectType = "Hex File" ElfObj ObjectType = "Elf File" BytesObj ObjectType = "Bytes File" ErrorObj ObjectType = "Error" ArrayObj ObjectType = "Array" StringObj ObjectType = "String" MethodObj ObjectType = "Method" IntegerObj ObjectType = "Int" BooleanObj ObjectType = "Bool" BuiltinObj ObjectType = "Builtin Function" FunctionObj ObjectType = "Function" RuntimeErrorObj ObjectType = "Runtime Error" ReturnValueObj ObjectType = "Return value" )
func OrType ¶ added in v0.4.0
func OrType(baseTypes ...ObjectType) ObjectType
type ReturnValue ¶
type ReturnValue struct {
Value Object
}
func (*ReturnValue) Inspect ¶
func (rv *ReturnValue) Inspect() string
func (*ReturnValue) Type ¶
func (rv *ReturnValue) Type() ObjectType
type RuntimeError ¶ added in v0.5.0
type RuntimeError struct { Kind RuntimeErrorType Message string }
func (*RuntimeError) Inspect ¶ added in v0.5.0
func (ee *RuntimeError) Inspect() string
func (*RuntimeError) Type ¶ added in v0.5.0
func (ee *RuntimeError) Type() ObjectType
type RuntimeErrorType ¶ added in v0.5.0
type RuntimeErrorType string
Click to show internal directories.
Click to hide internal directories.