Documentation ¶
Index ¶
- Constants
- type Array
- type Async
- type Begin
- type Boolean
- type Builtin
- type BuiltinFunction
- type Byte
- type Closure
- type Color
- type CompiledFunction
- type Database
- type Empty
- type Environment
- type Error
- type Eval
- type File
- type Float
- type Function
- type Hash
- type HashKey
- type HashPair
- type Hashable
- type Image
- type Integer
- type Literal
- type Load
- type Message
- type Model
- type Notification
- type Null
- type Object
- type ObjectType
- type Process
- type ReturnValue
- type Route
- type Scope
- type Server
- type Signal
- type Socket
- type String
- type SysEnv
- type SyscallResult
- type Url
- type Warning
Constants ¶
const ( INTEGER_OBJ = "INTEGER" BOOLEAN_OBJ = "BOOLEAN" NULL_OBJ = "NULL" RETURN_VALUE_OBJ = "RETURN_VALUE" ERROR_OBJ = "ERROR" FUNCTION_OBJ = "FUNCTION" STRING_OBJ = "STRING" BUILTIN_OBJ = "BUILTIN" ARRAY_OBJ = "ARRAY" HASH_OBJ = "HASH" EMPTY_OBJ = "EMPTY" LOOP = "LOOP" LIST = "LIST" LIST_OBJ = "LIST" URL_OBJ = "URL" SCOPE_OBJ = "SCOPE" BYTE_OBJ = "BYTE" PROC_OBJ = "PROC" ENV_OBJ = "ENV" NOTIFICATION_OBJ = "NOTIFICATION" SOCKET_OBJ = "SOCKET" LITERAL_OBJ = "LITERAL" DATABASE_OBJ = "DATABASE" MODEL_OBJ = "MODEL" BEGIN_OBJ = "BEGIN" FLOAT_OBJ = "FLOAT" ROUTE_OBJ = "ROUTE" SIGNAL_OBJ = "SIGNAL" ASM_OBJ = "ASM" ASYNC_OBJ = "ASYNC" SERVER_OBJ = "SERVER" EVAL_OBJ = "EVAL" COLOR_OBJ = "COLOR" IMAGE_OBJ = "IMAGE" LOAD_OBJ = "LOAD" COMPILED_FUNCTION_OBJ = "COMPILED_FUNCTION" CLOSURE_OBJ = "CLOSURE_OBJ" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Elements []Object
}
func (*Array) Type ¶
func (ao *Array) Type() ObjectType
type Boolean ¶
type Boolean struct {
Value bool
}
func (*Boolean) Type ¶
func (b *Boolean) Type() ObjectType
type Builtin ¶
type Builtin struct {
Fn BuiltinFunction
}
func (*Builtin) Type ¶
func (b *Builtin) Type() ObjectType
type BuiltinFunction ¶
type Closure ¶
type Closure struct { Fn *CompiledFunction Free []Object }
Closure holds a pointer to its compiled function and a slice of its free objects (variables it has access to that are not in either global or local scope)
func (*Closure) Type ¶
func (c *Closure) Type() ObjectType
Type returns our Closure's ObjectType (ClosureObj)
type Color ¶
type Color struct { Definition Object Color interface{} }
func (*Color) Type ¶
func (c *Color) Type() ObjectType
type CompiledFunction ¶
type CompiledFunction struct { Instructions code.Instructions NumLocals int NumParameters int }
CompiledFunction holds the instructions we get from the compilation of a function literal and is an object.Object, which means we can add it as a constant to our compiler.Bytecode and load it in the VM. It also holds the NumLocals which we pass to the VM to allocate the correct amount of stack space ("hole") to save the local bindings
func (*CompiledFunction) Debug ¶
func (cf *CompiledFunction) Debug() string
func (*CompiledFunction) Inspect ¶
func (cf *CompiledFunction) Inspect() string
Inspect returns the string "CompiledFunction[address]" - Address of 0th element in base 16 notation, with leading 0x
func (*CompiledFunction) Result ¶
func (cf *CompiledFunction) Result() string
func (*CompiledFunction) Type ¶
func (cf *CompiledFunction) Type() ObjectType
Type returns our CompiledFunction's ObjectType (CompiledFunctionObj)
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
func NewEnvironment ¶
func NewEnvironment() *Environment
func (*Environment) GetLastFunctionName ¶
func (e *Environment) GetLastFunctionName() string
func (*Environment) GetLastScope ¶
func (e *Environment) GetLastScope() *Scope
type Error ¶
type Error struct {
Message string
}
func (*Error) Type ¶
func (e *Error) Type() ObjectType
type Eval ¶
type Eval struct {
Content Object
}
func (*Eval) Type ¶
func (e *Eval) Type() ObjectType
type Float ¶
type Float struct {
Value float64
}
func (*Float) Type ¶
func (f *Float) Type() ObjectType
type Function ¶
type Function struct { Parameters []*ast.Identifier Body *ast.BlockStatement Env *Environment }
func (*Function) Type ¶
func (f *Function) Type() ObjectType
type HashKey ¶
type HashKey struct { Type ObjectType Value uint64 }
type Image ¶
type Image struct { Name Object Source interface{} }
func (*Image) Type ¶
func (i *Image) Type() ObjectType
type Integer ¶
type Integer struct {
Value int64
}
func (*Integer) Type ¶
func (i *Integer) Type() ObjectType
type Literal ¶
type Literal struct { Name string Parameters []*ast.Identifier Body *ast.BlockStatement Env *Environment }
func (*Literal) Type ¶
func (l *Literal) Type() ObjectType
type Load ¶
type Load struct { File string Env *Environment SysEnv []Object }
func (*Load) Type ¶
func (l *Load) Type() ObjectType
type Notification ¶
func (*Notification) Debug ¶
func (n *Notification) Debug() string
func (*Notification) Inspect ¶
func (n *Notification) Inspect() string
func (*Notification) Result ¶
func (n *Notification) Result() string
func (*Notification) Type ¶
func (n *Notification) Type() ObjectType
type Object ¶
type Object interface { Type() ObjectType Inspect() string Result() string Debug() string }
type ObjectType ¶
type ObjectType string
type Process ¶
type Process struct { Name string Pid int64 Output string Command string Proc *exec.Cmd Param []Object Error Object }
func (*Process) Type ¶
func (p *Process) Type() ObjectType
type ReturnValue ¶
type ReturnValue struct {
Value Object
}
func (*ReturnValue) Debug ¶
func (rv *ReturnValue) Debug() string
func (*ReturnValue) Inspect ¶
func (rv *ReturnValue) Inspect() string
func (*ReturnValue) Result ¶
func (rv *ReturnValue) Result() string
func (*ReturnValue) Type ¶
func (rv *ReturnValue) Type() ObjectType
type Route ¶
type Route struct {
Config Object
}
func (*Route) Type ¶
func (r *Route) Type() ObjectType
type Scope ¶
type Scope struct { Name string Body *ast.BlockStatement Vars []Object Env *Environment }
func (*Scope) Type ¶
func (f *Scope) Type() ObjectType
type Socket ¶
type Socket struct { Addr string Port string ConType string OnReady string OnResponse string OnRequest string Env *Environment Messages []Message Debugger bool DefaultResponse Object }
func (*Socket) DialMessage ¶
func (s *Socket) DialMessage()
func (*Socket) DialServer ¶
func (s *Socket) DialServer()
func (*Socket) FindResponse ¶
func (*Socket) Type ¶
func (s *Socket) Type() ObjectType
type String ¶
type String struct {
Value string
}
func (*String) Type ¶
func (s *String) Type() ObjectType
type SyscallResult ¶
type SyscallResult struct { Request interface{} Response interface{} Error interface{} }
func (*SyscallResult) Debug ¶
func (s *SyscallResult) Debug() string
func (*SyscallResult) Inspect ¶
func (s *SyscallResult) Inspect() string
func (*SyscallResult) Result ¶
func (s *SyscallResult) Result() string
func (*SyscallResult) Type ¶
func (s *SyscallResult) Type() ObjectType