Documentation
¶
Index ¶
- func MK_ARRAY(value []shared.RuntimeValue) shared.RuntimeValue
- func MK_BOOL(value bool) shared.RuntimeValue
- func MK_CLASS(name string, body []ast.Stmt, constructor *ast.ClassMethod, ...) shared.RuntimeValue
- func MK_CLASS_INSTANCE(class *ClassValue, publics map[string]bool, data *environment.Environment) shared.RuntimeValue
- func MK_NATIVE_FN(fn NativeFunction) shared.RuntimeValue
- func MK_NIL() shared.RuntimeValue
- func MK_NUMBER(value float64) shared.RuntimeValue
- func MK_OBJECT(value map[string]*shared.RuntimeValue) shared.RuntimeValue
- func MK_STRING(value string) shared.RuntimeValue
- type ClassInstanceValue
- type ClassValue
- type FunctionValue
- type NativeFunction
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MK_ARRAY ¶
func MK_ARRAY(value []shared.RuntimeValue) shared.RuntimeValue
func MK_BOOL ¶
func MK_BOOL(value bool) shared.RuntimeValue
func MK_CLASS ¶
func MK_CLASS(name string, body []ast.Stmt, constructor *ast.ClassMethod, declarationEnv *environment.Environment) shared.RuntimeValue
func MK_CLASS_INSTANCE ¶
func MK_CLASS_INSTANCE(class *ClassValue, publics map[string]bool, data *environment.Environment) shared.RuntimeValue
func MK_NATIVE_FN ¶
func MK_NATIVE_FN(fn NativeFunction) shared.RuntimeValue
func MK_NIL ¶
func MK_NIL() shared.RuntimeValue
func MK_NUMBER ¶
func MK_NUMBER(value float64) shared.RuntimeValue
func MK_OBJECT ¶
func MK_OBJECT(value map[string]*shared.RuntimeValue) shared.RuntimeValue
func MK_STRING ¶
func MK_STRING(value string) shared.RuntimeValue
Types ¶
type ClassInstanceValue ¶
type ClassInstanceValue struct {
Type shared.ValueType
Class ClassValue
Publics map[string]bool
Data *environment.Environment
}
type ClassValue ¶
type ClassValue struct {
Type shared.ValueType
Value any
Name string
Body []ast.Stmt
DeclarationEnv *environment.Environment
Constructor *ast.ClassMethod
}
type FunctionValue ¶
type FunctionValue struct {
Type shared.ValueType
Value any
Name string
Params []string
DeclarationEnv *environment.Environment
Body []ast.Stmt
}
type NativeFunction ¶
type NativeFunction func(args []shared.RuntimeValue, env *environment.Environment) (*shared.RuntimeValue, *errors.RuntimeError)
Click to show internal directories.
Click to hide internal directories.