Documentation
¶
Index ¶
- type AutoRegisterer
- type Callable
- type Codex
- type DefinitionError
- type DefinitionNotCallableError
- type DefinitionNotFoundError
- type DefinitionReadWriter
- type DefinitionReader
- type DefinitionWriter
- type IncompatiblePairError
- type InvalidDefinitionKey
- type KeyNode
- type Named
- type Node
- type NodeError
- type NodeType
- type Scope
- type SerializableNode
- type Shaped
- type StringError
- type Typed
- type Value
- type Valued
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutoRegisterer ¶ added in v0.1.7
type Callable ¶
type Callable interface {
Node
Call(ctx context.Context, funcName string, argValues ...Value) Value
}
Callable defines a node that can be called. It represents a function as a node.
type DefinitionError ¶
type DefinitionError interface {
Key() string
}
type DefinitionNotCallableError ¶
type DefinitionNotCallableError struct {
DefinitionKey string
}
func (DefinitionNotCallableError) Error ¶
func (e DefinitionNotCallableError) Error() string
func (DefinitionNotCallableError) Key ¶
func (e DefinitionNotCallableError) Key() string
type DefinitionNotFoundError ¶
type DefinitionNotFoundError struct {
DefinitionKey string
}
func (DefinitionNotFoundError) Error ¶
func (e DefinitionNotFoundError) Error() string
func (DefinitionNotFoundError) Key ¶
func (e DefinitionNotFoundError) Key() string
type DefinitionReadWriter ¶
type DefinitionReadWriter interface {
DefinitionReader
DefinitionWriter
}
type DefinitionReader ¶
type DefinitionWriter ¶
type IncompatiblePairError ¶
func (IncompatiblePairError) Error ¶
func (e IncompatiblePairError) Error() string
type InvalidDefinitionKey ¶
type InvalidDefinitionKey struct {
DefinitionKey string
}
func (InvalidDefinitionKey) Error ¶
func (e InvalidDefinitionKey) Error() string
func (InvalidDefinitionKey) Key ¶
func (e InvalidDefinitionKey) Key() string
type Node ¶
Node is the building block of any expression. It can be used to represent values, evaluations or operations. Nodes can be evaluated under a scope.
type NodeError ¶
func NewNodeError ¶
type NodeType ¶
type NodeType uint8
const ( NodeTypeInvalid NodeType = iota // NodeTypeExpression represents an expression() node type. Example: if() NodeTypeExpression // NodeTypeReference represents a variable reference. Example: friend.name. NodeTypeReference // NodeTypeLiteral represents a direct value. Example: "string", 5. NodeTypeLiteral )
type Scope ¶
Scope defines a block capable of evaluating expressions. It should be able to act as a context, as well as resolve definitions.
type SerializableNode ¶ added in v0.1.7
type SerializableNode interface {
Node
Named
Typed
Shaped
AutoRegisterer
}
type Shaped ¶
type Shaped interface {
Shape() []KeyNode
}
Shaped defines a node capable of returning it's shape. The shape is a slice of named or unamed parameters required for constructing the node. This abstraction is used for constructing nodes from named parameters.
type StringError ¶
type StringError string
const ( ErrAllNodesMustMatch StringError = "all nodes must be of the same type" ErrAllNodesMustBeSet StringError = "all nodes must be set" ErrMustHaveArguments StringError = "must have at least one argument" )
func (StringError) Error ¶
func (e StringError) Error() string
type Typed ¶
type Typed interface {
Type() NodeType
}
Typed defines a node capable of returning it's NodeType. This interface is used for encoding and syntax purposes.