Documentation ¶
Overview ¶
Package object implements the objects system for the language.
Index ¶
- Constants
- type Array
- type Boolean
- type Builtin
- type BuiltinFunction
- type CubePrimitive
- type CylinderPrimitive
- type Environment
- type Error
- type Float
- type Function
- type GroupBlockPrimitive
- type Hash
- type HashKey
- type HashPair
- type Hashable
- type Integer
- type MultmatrixBlockPrimitive
- type NamedArgument
- type Null
- type Object
- type PolygonPrimitive
- type ReturnValue
- type SpherePrimitive
- type SquarePrimitive
- type String
- type T
- type UnionBlockPrimitive
Constants ¶
const ( BooleanT = "BOOLEAN" IntegerT = "INTEGER" FloatT = "FLOAT" NullT = "NULL" ReturnValueT = "RETURN_VALUE" ErrorT = "ERROR" FunctionT = "FUNCTION" StringT = "STRING" BuiltinT = "BUILTIN" ArrayT = "ARRAY" HashT = "HASH" // CSG CubePrimitiveT = "CUBE" CylinderPrimitiveT = "CYLINDER" GroupBlockPrimitiveT = "GROUP" MultmatrixBlockPrimitiveT = "MULTMATRIX" NamedArgumentT = "NAMED_ARGUMENT" PolygonPrimitiveT = "POLYGON" SpherePrimitiveT = "SPHERE" SquarePrimitiveT = "SQUARE" UnionBlockPrimitiveT = "UNION" )
Object types.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Elements []Object
}
Array represents an object of that type.
type Boolean ¶
type Boolean struct {
Value bool
}
Boolean represents an object of that type.
type Builtin ¶
type Builtin struct {
Fn BuiltinFunction
}
Builtin represents an object of that type.
type BuiltinFunction ¶
BuiltinFunction represents a builtin function.
type CubePrimitive ¶
type CubePrimitive struct {
Arguments []Object
}
CubePrimitive represents an object of that type.
func (*CubePrimitive) Inspect ¶
func (c *CubePrimitive) Inspect() string
Inspect returns a representation of the object value.
type CylinderPrimitive ¶
type CylinderPrimitive struct {
Arguments []Object
}
CylinderPrimitive represents an object of that type.
func (*CylinderPrimitive) Inspect ¶
func (c *CylinderPrimitive) Inspect() string
Inspect returns a representation of the object value.
func (*CylinderPrimitive) Type ¶
func (c *CylinderPrimitive) Type() T
Type returns the type of the object.
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment represents a programming language environment.
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
NewEnclosedEnvironment returns an enclosed environment.
type Error ¶
type Error struct {
Message string
}
Error represents an object of that type.
type Float ¶
type Float struct {
Value float64
}
Float represents an object of that type.
type Function ¶
type Function struct { Parameters []*ast.Identifier Body *ast.BlockStatement Env *Environment }
Function represents an object of that type.
type GroupBlockPrimitive ¶
type GroupBlockPrimitive struct {
Body Object
}
GroupBlockPrimitive represents an object of that type.
func (*GroupBlockPrimitive) Inspect ¶
func (g *GroupBlockPrimitive) Inspect() string
Inspect returns a representation of the object value.
func (*GroupBlockPrimitive) Type ¶
func (g *GroupBlockPrimitive) Type() T
Type returns the type of the object.
type Hash ¶
Hash represents a hash map.
type Hashable ¶
type Hashable interface {
HashKey() HashKey
}
Hashable represents objects that can be used as keys in hash maps.
type Integer ¶
type Integer struct {
Value int64
}
Integer represents an object of that type.
type MultmatrixBlockPrimitive ¶
MultmatrixBlockPrimitive represents an object of that type.
func (*MultmatrixBlockPrimitive) Inspect ¶
func (m *MultmatrixBlockPrimitive) Inspect() string
Inspect returns a representation of the object value.
func (*MultmatrixBlockPrimitive) Type ¶
func (m *MultmatrixBlockPrimitive) Type() T
Type returns the type of the object.
type NamedArgument ¶
NamedArgument represents an object of that type.
func (*NamedArgument) Inspect ¶
func (n *NamedArgument) Inspect() string
Inspect returns a representation of the object value.
type Null ¶
type Null struct{}
Null represents an object of that type.
type PolygonPrimitive ¶
type PolygonPrimitive struct {
Arguments []Object
}
PolygonPrimitive represents an object of that type.
func (*PolygonPrimitive) Inspect ¶
func (c *PolygonPrimitive) Inspect() string
Inspect returns a representation of the object value.
func (*PolygonPrimitive) Type ¶
func (c *PolygonPrimitive) Type() T
Type returns the type of the object.
type ReturnValue ¶
type ReturnValue struct {
Value Object
}
ReturnValue represents an object of that type.
func (*ReturnValue) Inspect ¶
func (r *ReturnValue) Inspect() string
Inspect returns a representation of the object value.
type SpherePrimitive ¶
type SpherePrimitive struct {
Arguments []Object
}
SpherePrimitive represents an object of that type.
func (*SpherePrimitive) Inspect ¶
func (c *SpherePrimitive) Inspect() string
Inspect returns a representation of the object value.
func (*SpherePrimitive) Type ¶
func (c *SpherePrimitive) Type() T
Type returns the type of the object.
type SquarePrimitive ¶
type SquarePrimitive struct {
Arguments []Object
}
SquarePrimitive represents an object of that type.
func (*SquarePrimitive) Inspect ¶
func (c *SquarePrimitive) Inspect() string
Inspect returns a representation of the object value.
func (*SquarePrimitive) Type ¶
func (c *SquarePrimitive) Type() T
Type returns the type of the object.
type String ¶
type String struct {
Value string
}
String represents an object of that type.
type UnionBlockPrimitive ¶
type UnionBlockPrimitive struct {
Body Object
}
UnionBlockPrimitive represents an object of that type.
func (*UnionBlockPrimitive) Inspect ¶
func (g *UnionBlockPrimitive) Inspect() string
Inspect returns a representation of the object value.
func (*UnionBlockPrimitive) Type ¶
func (g *UnionBlockPrimitive) Type() T
Type returns the type of the object.