Documentation ¶
Index ¶
- type ArrayVal
- type BooleanVal
- type Environment
- func (e *Environment) AssignVar(varName string, value RuntimeValue) (RuntimeValue, error)
- func (e *Environment) DeclareVar(varName string, value RuntimeValue, constant bool) (RuntimeValue, error)
- func (e *Environment) LookupVar(varName string) (RuntimeValue, error)
- func (e *Environment) Resolve(varName string) (Environment, error)
- type FunctionCall
- type FunctionVal
- type NaNVal
- type NullVal
- type NumberVal
- type ObjectVal
- type RuntimeValue
- type StringVal
- type ValueType
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ArrayVal ¶
type ArrayVal struct { Type ValueType Elements []RuntimeValue }
func (ArrayVal) GetElements ¶
type BooleanVal ¶
func (BooleanVal) GetType ¶
func (b BooleanVal) GetType() ValueType
func (BooleanVal) GetValue ¶
func (b BooleanVal) GetValue() any
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
func New ¶
func New(parentENV *Environment) Environment
func (*Environment) AssignVar ¶
func (e *Environment) AssignVar(varName string, value RuntimeValue) (RuntimeValue, error)
func (*Environment) DeclareVar ¶
func (e *Environment) DeclareVar(varName string, value RuntimeValue, constant bool) (RuntimeValue, error)
func (*Environment) LookupVar ¶
func (e *Environment) LookupVar(varName string) (RuntimeValue, error)
func (*Environment) Resolve ¶
func (e *Environment) Resolve(varName string) (Environment, error)
Returns the environment that contains the variable
type FunctionCall ¶
type FunctionCall = func(args []RuntimeValue, env Environment) RuntimeValue
type FunctionVal ¶
type FunctionVal struct { Type ValueType Name *string Params []ast.Identifier DeclarationEnv *Environment Body []ast.Stmt }
func (FunctionVal) GetType ¶
func (f FunctionVal) GetType() ValueType
func (FunctionVal) GetValue ¶
func (f FunctionVal) GetValue() any
type ObjectVal ¶
type ObjectVal struct { Type ValueType Properties map[string]RuntimeValue }
type RuntimeValue ¶
Click to show internal directories.
Click to hide internal directories.