Documentation ¶
Index ¶
Constants ¶
View Source
const ( NUMBER_OBJ = "NUMBER" NIL_OBJ = "NIL_OBJ" BOOLEAN_OBJ = "BOOLEAN" STRING_OBJ = "STRING" ERROR_OBJ = "ERROR" RETURN_VALUE_OBJ = "RETURN_VALUE" FUNCTION_OBJ = "FUNCTION" BUILTIN_OBJ = "BUILTIN" ARRAY_OBJ = "ARRAY" )
Variables ¶
View Source
var ( ERR_ARGUMENT = "wrong number of arguments. expected=%d, got=%d" ERR_INDEX = "index error: '%d' out of range" ERR_PREFIXOP = "unsupported operator for prefix expression:'%s' and type: %s" ERR_INFIXOP = "unsupported operator for infix expression: %s '%s' %s" ERR_UNKNOWNIDENT = "unknown identifier: '%s' is not defined" ERR_DIVIDEBYZERO = "divide by zero" ERR_NOTFUNCTION = "not a function: %s" ERR_NOINDEXABLE = "index error: type %s is not indexable" )
Functions ¶
Types ¶
type Array ¶
type Array struct {
Members []Object
}
func (*Array) Type ¶
func (a *Array) Type() ObjectType
type Boolean ¶
type Boolean struct {
Bool bool
}
func NewBooleanObj ¶
func (*Boolean) Type ¶
func (b *Boolean) Type() ObjectType
type Builtin ¶
type Builtin struct {
Fn BuiltinFunc
}
func (*Builtin) Type ¶
func (b *Builtin) Type() ObjectType
type Error ¶
type Error struct {
Message string
}
func (*Error) Type ¶
func (e *Error) Type() ObjectType
type Function ¶
type Function struct { Literal *ast.FunctionLiteral Scope *Scope }
func (*Function) Type ¶
func (f *Function) Type() ObjectType
type Number ¶
type Number struct {
Value float64
}
func (*Number) Type ¶
func (n *Number) Type() ObjectType
type Object ¶
type Object interface { Type() ObjectType Inspect() 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 Scope ¶
func (*Scope) DebugPrint ¶
Click to show internal directories.
Click to hide internal directories.