Documentation ¶
Index ¶
Constants ¶
View Source
const ( INTEGER_OBJ = "INTEGER" FLOAT_OBJ = "FLOAT" DECIMAL_OBJ = "DECIMAL" BOOLEAN_OBJ = "BOOLEAN" RETURN_OBJ = "RETURN" ERROR_OBJ = "ERROR" NULL_OBJ = "NULL" FUNCTION_OBJ = "FUNCTION" STRING_OBJ = "STRING" BUILTIN_OBJ = "BUILTIN" ARRAY_OBJ = "ARRAY" HASH_OBJ = "HASH" BREAK_OBJ = "BREAK" SKIP_OBJ = "SKIP" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Elements []Object
}
func (*Array) Type ¶
func (array *Array) Type() ObjectType
type Boolean ¶
type Boolean struct {
Value bool
}
func (*Boolean) Type ¶
func (boolean *Boolean) Type() ObjectType
type Break ¶ added in v0.0.3
type Break struct{}
func (*Break) Type ¶ added in v0.0.3
func (b *Break) Type() ObjectType
type Decimal ¶ added in v0.0.6
func (*Decimal) Type ¶ added in v0.0.6
func (decimal *Decimal) Type() ObjectType
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func NewEnvironment ¶
func NewEnvironment() *Environment
func NewLocalEnvironment ¶
func NewLocalEnvironment(outer *Environment) *Environment
func (*Environment) GetMainEnv ¶ added in v0.0.3
func (e *Environment) GetMainEnv() *Environment
func (*Environment) GetOuterEnv ¶ added in v0.0.3
func (e *Environment) GetOuterEnv() *Environment
func (*Environment) GetTargetEnv ¶ added in v0.0.6
func (e *Environment) GetTargetEnv(name string) *Environment
GetTargetEnv returns the environment that contains the variable with the given name If the variable is not found, it returns nil This is used to check if a variable is declared in the current scope or not
type Error ¶
type Error struct {
Msg string
}
func (*Error) Type ¶
func (err *Error) Type() ObjectType
type Float ¶ added in v0.0.5
type Float struct {
Value float64
}
func (*Float) Type ¶ added in v0.0.5
func (float *Float) Type() ObjectType
type Function ¶
type Function struct { Parameters []*ast.Identifier Body *ast.BlockStatement // The environment in which the function was defined, This allow a closure Env *Environment }
func (*Function) Type ¶
func (function *Function) Type() ObjectType
type HashKey ¶
type HashKey struct { Type ObjectType Value uint64 }
type Integer ¶
type Integer struct {
Value int64
}
func (*Integer) Type ¶
func (integer *Integer) Type() ObjectType
type Object ¶
type Object interface { Type() ObjectType Inspect() string }
type ObjectType ¶
type ObjectType string
type Return ¶
type Return struct {
Value Object
}
func (*Return) Type ¶
func (returnObj *Return) Type() ObjectType
Click to show internal directories.
Click to hide internal directories.