Documentation ¶
Index ¶
Constants ¶
View Source
const ( INTEGER_TYPE = "Int" FLOAT_TYPE = "Float" STRING_TYPE = "String" ATOM_TYPE = "Atom" BOOLEAN_TYPE = "Bool" ARRAY_TYPE = "Array" DICTIONARY_TYPE = "Dictionary" NIL_TYPE = "Nil" FUNCTION_TYPE = "Function" RETURN_TYPE = "Return" BREAK_TYPE = "Break" CONTINUE_TYPE = "Continue" MODULE_TYPE = "Module" PLACEHOLDER_TYPE = "Placeholder" )
Data types.
Variables ¶
View Source
var ( NIL = &NilType{} TRUE = &BooleanType{Value: true} FALSE = &BooleanType{Value: false} )
A NIL, TRUE or FALSE don't have any literal meaning. A TRUE is always the same instance.
Functions ¶
This section is empty.
Types ¶
type BooleanType ¶
type BooleanType struct {
Value bool
}
BooleanType for boolean.
func (*BooleanType) Inspect ¶
func (t *BooleanType) Inspect() string
func (*BooleanType) Type ¶
func (t *BooleanType) Type() string
type ContinueType ¶
type ContinueType struct{}
ContinueType for continue.
func (*ContinueType) Inspect ¶
func (t *ContinueType) Inspect() string
func (*ContinueType) Type ¶
func (t *ContinueType) Type() string
type DictionaryType ¶
DictionaryType for dictionaries.
func (*DictionaryType) Inspect ¶
func (t *DictionaryType) Inspect() string
func (*DictionaryType) Type ¶
func (t *DictionaryType) Type() string
type FunctionType ¶
type FunctionType struct { Parameters []*ast.FunctionParameter Body *ast.BlockStatement ReturnType *ast.Identifier Variadic bool Scope *Scope }
FunctionType for functions.
func (*FunctionType) Inspect ¶
func (t *FunctionType) Inspect() string
func (*FunctionType) Type ¶
func (t *FunctionType) Type() string
type IntegerType ¶
type IntegerType struct {
Value int64
}
IntegerType for integers.
func (*IntegerType) Inspect ¶
func (t *IntegerType) Inspect() string
func (*IntegerType) Type ¶
func (t *IntegerType) Type() string
type Interpreter ¶
type Interpreter struct {
// contains filtered or unexported fields
}
Interpreter represents the interpreter.
type ModuleType ¶
type ModuleType struct { Name *ast.Identifier Body *ast.BlockStatement }
ModuleType for modules.
func (*ModuleType) Inspect ¶
func (t *ModuleType) Inspect() string
func (*ModuleType) Type ¶
func (t *ModuleType) Type() string
type PlaceholderType ¶
type PlaceholderType struct{}
PlaceholderType for continue.
func (*PlaceholderType) Inspect ¶
func (t *PlaceholderType) Inspect() string
func (*PlaceholderType) Type ¶
func (t *PlaceholderType) Type() string
type ReturnType ¶
type ReturnType struct {
Value DataType
}
ReturnType for return.
func (*ReturnType) Inspect ¶
func (t *ReturnType) Inspect() string
func (*ReturnType) Type ¶
func (t *ReturnType) Type() string
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
Scope represents the variable scope.
func NewScopeFrom ¶
NewScopeFrom initializes a scope by inheriting from a parent.
type StringType ¶
type StringType struct {
Value string
}
StringType for strings.
func (*StringType) Inspect ¶
func (t *StringType) Inspect() string
func (*StringType) Type ¶
func (t *StringType) Type() string
Click to show internal directories.
Click to hide internal directories.