Documentation ¶
Overview ¶
Package interpreter provides an implementation of an IFQL interpreter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Arguments ¶
type Arguments interface { Get(name string) (Value, bool) GetRequired(name string) (Value, error) GetString(name string) (string, bool, error) GetInt(name string) (int64, bool, error) GetFloat(name string) (float64, bool, error) GetBool(name string) (bool, bool, error) GetFunction(name string) (Function, bool, error) GetArray(name string, t semantic.Kind) (Array, bool, error) GetObject(name string) (Object, bool, error) GetRequiredString(name string) (string, error) GetRequiredInt(name string) (int64, error) GetRequiredFloat(name string) (float64, error) GetRequiredBool(name string) (bool, error) GetRequiredFunction(name string) (Function, error) GetRequiredArray(name string, t semantic.Kind) (Array, error) GetRequiredObject(name string) (Object, error) // contains filtered or unexported methods }
Arguments provides access to the keyword arguments passed to a function. semantic.The Get{Type} methods return three values: the typed value of the arg, whether the argument was specified and any errors about the argument type. semantic.The GetRequired{Type} methods return only two values, the typed value of the arg and any errors, a missing argument is considered an error in this case.
type Array ¶
type Array struct { Elements []Value // contains filtered or unexported fields }
Array represents an sequence of elements All elements must be the same type
type Domain ¶
type Domain interface{}
Domain represents any specific domain being used during evaluation.
type Function ¶
type Function interface { Call(args Arguments, d Domain) (Value, error) // Resolve rewrites the function resolving any identifiers not listed in the function params. Resolve() (*semantic.FunctionExpression, error) }
Function represents a callable type
type Object ¶ added in v0.0.5
Object represents an association of keys to values. Object values may be of any type.
type Scope ¶
type Scope struct {
// contains filtered or unexported fields
}
type Value ¶
type Value interface { // Type reports the type of value Type() semantic.Type // Value returns the actual value represented. Value() interface{} // Property returns a new value which is a property of this value. Property(name string) (Value, error) }
Value represents any value that can be the result of evaluating any expression.