Documentation ¶
Index ¶
Constants ¶
const ( BOOL = "BOOL" INTEGER = "INTEGER" FUNCTION = "FUNCTION" STRUCT = "STRUCT" RETURN = "RETURN" STRING = "STRING" BUILTIN = "BULITIN" // builtin functions from the host language LIST = "LIST" HASHMAP = "HASHMAP" )
Types
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuiltinFunction ¶
func (*BuiltinFunction) FormattedString ¶
func (bf *BuiltinFunction) FormattedString() string
func (*BuiltinFunction) RawType ¶
func (bf *BuiltinFunction) RawType() string
func (*BuiltinFunction) String ¶
func (bf *BuiltinFunction) String() string
func (*BuiltinFunction) Type ¶
func (bf *BuiltinFunction) Type() string
type Callable ¶
type Callable interface {
Call() Object
}
All the call-able objects will implement this interface i.e. functions
type Function ¶
type Function struct {
FunctionStatement ast.FunctionStatement
}
Function type, it is an Object as well as a Callable
func (*Function) Call ¶
func (f *Function) Call()
The call functions should return an object in the case of something like var x = function(...)
func (*Function) FormattedString ¶
type HashKey ¶
TODO : Type can either be an `object` or a `string` But for now I think string will work just fine? Objects will implement RawType() which can then be used to supply this value.
type HashMap ¶
Hashmap container type Note : Hashmaps maps object.Object to object.Object
func (*HashMap) FormattedString ¶
type Hashable ¶
type Hashable interface {
Hash() HashKey
}
All hashable objects will implement this interface i.e. anything that can be used as a hashmap key
type List ¶
type List struct {
Value []Object
}
Container types - Lists/Hashmaps List container type
func (*List) FormattedString ¶
type Object ¶
type Object interface { RawType() string Type() string String() string // This is for something like the String type; where it adds '"' with it // Otherwise, this will return the same as String() for most types. FormattedString() string }
All types implement this interface
type Return ¶
type Return struct {
Value Object
}
Return type, this is only for the interpreter and is not for use normally.