Documentation ¶
Index ¶
Constants ¶
const ( // IntegerObj represents integer objects IntegerObj = "INTEGER" // FloatObj represents floating point objects FloatObj = "FLOAT" // BooleanObj represents boolean objects BooleanObj = "BOOLEAN" // SoundObj represents a Reverb sound abstraction object SoundObj = "SOUND" // NullObj represents the concept of null NullObj = "NULL" // ReturnValueObj represents a value returned from a function ReturnValueObj = "RETURN_VALUE" // ErrorObj represents an error return from the interpreter ErrorObj = "ERROR" // FunctionObj represents a user-defined function object FunctionObj = "FUNCTION" // BuiltinObj represents a Reverb function object BuiltinObj = "BUILTIN" // ArrayObj represents an array object ArrayObj = "ARRAY" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Elements []Object
}
Array represents the array data type
type Boolean ¶
type Boolean struct {
Value bool
}
Boolean represents the boolean data type
type Builtin ¶
type Builtin struct {
Fn BuiltinFunction
}
Builtin represents a builtin function object
type BuiltinFunction ¶
BuiltinFunction represent functions that are part of the Reverb standard library
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment represents a virtual environment within Reverb
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
NewEnclosedEnvironment creates an extended environment
func NewEnvironment ¶
func NewEnvironment() *Environment
NewEnvironment creates a new environment instance
type Error ¶
type Error struct {
Message string
}
Error represents an interpreter error
type Float ¶
type Float struct {
Value float64
}
Float represents the floating point data type
type Function ¶
type Function struct { Parameters []*ast.Identifier Body *ast.BlockStatement Env *Environment }
Function represents the function type
type Integer ¶
type Integer struct {
Value int64
}
Integer represents the integer data type
type Null ¶
type Null struct{}
Null represents the null data type
type ReturnValue ¶
type ReturnValue struct {
Value Object
}
ReturnValue represents the return value object
func (*ReturnValue) Inspect ¶
func (rv *ReturnValue) Inspect() string
Inspect returns the string value of the return value object
func (*ReturnValue) Type ¶
func (rv *ReturnValue) Type() Type
Type returns the return value object type