Documentation
¶
Index ¶
- Variables
- func AddBuiltin(name string, f func(args ...Object) Object)
- func EqualObjectSet(a, b []Object) bool
- func EqualObjects(a, b []Object) bool
- func IsError(v interface{}) bool
- type Bitstring
- type BitstringTemplate
- type Bool
- type Builtin
- type Env
- type Error
- type Float
- type Function
- type Int
- type List
- type ListType
- type Map
- type Object
- type ObjectType
- type Record
- type ReturnValue
- type Scope
- type String
- type Unit
- type Verdict
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrSyntax = errors.New("invalid syntax") Undefined = &singelton{typ: UNDEFINED} Break = &singelton{typ: BREAK} Continue = &singelton{typ: CONTINUE} Any = &singelton{typ: ANY} AnyOrNone = &singelton{typ: ANY_OR_NONE} )
Functions ¶
func AddBuiltin ¶ added in v0.16.2
func EqualObjectSet ¶ added in v0.16.2
EqualObjectSet compares two Object slices for equality ignoring the order of the elements.
Current implementation is O(n^2).
func EqualObjects ¶ added in v0.9.6
EqualObjects compares two Object slices for equality.
Types ¶
type Bitstring ¶ added in v0.9.5
func NewBitstring ¶ added in v0.9.5
func (*Bitstring) Type ¶ added in v0.9.5
func (b *Bitstring) Type() ObjectType
type BitstringTemplate ¶ added in v0.16.2
type BitstringTemplate struct {
Value []rune
}
func NewBitstringTemplate ¶ added in v0.16.2
func NewBitstringTemplate(s string) (*BitstringTemplate, error)
func (*BitstringTemplate) Equal ¶ added in v0.16.2
func (b *BitstringTemplate) Equal(obj Object) bool
func (*BitstringTemplate) Get ¶ added in v0.16.2
func (b *BitstringTemplate) Get(index int) Object
func (*BitstringTemplate) Inspect ¶ added in v0.16.2
func (b *BitstringTemplate) Inspect() string
func (*BitstringTemplate) Len ¶ added in v0.16.2
func (b *BitstringTemplate) Len() int
func (*BitstringTemplate) Type ¶ added in v0.16.2
func (b *BitstringTemplate) Type() ObjectType
type Builtin ¶ added in v0.9.5
func (*Builtin) Type ¶ added in v0.9.5
func (b *Builtin) Type() ObjectType
type Function ¶
type Function struct {
Params *ast.FormalPars
Body *ast.BlockStmt
Env Scope
}
func (*Function) Type ¶
func (f *Function) Type() ObjectType
type List ¶ added in v0.9.5
func NewComplement ¶ added in v0.16.2
func NewPermutation ¶ added in v0.16.2
func NewRecordOf ¶ added in v0.16.2
func NewSuperset ¶ added in v0.16.2
func (*List) Type ¶ added in v0.9.5
func (l *List) Type() ObjectType
type Map ¶ added in v0.9.6
type Map struct {
// contains filtered or unexported fields
}
Map is a map of objects.
func (*Map) Type ¶ added in v0.9.6
func (m *Map) Type() ObjectType
type ObjectType ¶
type ObjectType string
const ( UNKNOWN ObjectType = "unknown object" UNDEFINED ObjectType = "undefined value" ERROR ObjectType = "runtime error" BREAK ObjectType = "break event" CONTINUE ObjectType = "continue event" RETURN_VALUE ObjectType = "return value" INTEGER ObjectType = "integer" FLOAT ObjectType = "float" BOOL ObjectType = "boolean" STRING ObjectType = "string" BITSTRING ObjectType = "bitstring" FUNCTION ObjectType = "function" LIST ObjectType = "list" RECORD ObjectType = "record" MAP ObjectType = "map" BUILTIN_OBJ ObjectType = "builtin function" VERDICT ObjectType = "verdict" ANY ObjectType = "?" ANY_OR_NONE ObjectType = "*" )
type Record ¶ added in v0.9.6
TODO(5nord) For simplicity we reuse the Map implementation. We should implement proper record semantics later.
func (*Record) Type ¶ added in v0.9.6
func (r *Record) Type() ObjectType
type ReturnValue ¶
type ReturnValue struct {
Value Object
}
func (*ReturnValue) Equal ¶ added in v0.9.6
func (r *ReturnValue) Equal(obj Object) bool
func (*ReturnValue) Inspect ¶
func (r *ReturnValue) Inspect() string
func (*ReturnValue) Type ¶
func (r *ReturnValue) Type() ObjectType
type String ¶
type String struct {
Value []rune
}
func (*String) Type ¶
func (s *String) Type() ObjectType
Click to show internal directories.
Click to hide internal directories.