Documentation
¶
Overview ¶
Package object contains the various implementations of the object.Object interface List of the supported object
- Array
- Boolean
- Builtin (function)
- Environment (for variable definition and such)
- Error (for parser handling)
- Function (user defined, not builtins)
- Hash
- Integer
- Null
- Repo (a go-git git repository)
- Return
- String
- Tag (a go-git tag object)
Index ¶
Constants ¶
const ( IntegerObj = "INTEGER" BooleanObj = "BOOLEAN" NullObj = "NULL" ReturnValueObj = "RETURN_VALUE" ErrorObj = "ERROR" FunctionObj = "FUNCTION" StringObj = "STRING" BuiltinObj = "BUILTIN" ArrayObj = "ARRAY" HashObj = "HASH" RepoObj = "REPO" TagObj = "TAG" )
Definition of constants for "Type"
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Array ¶
type Array struct {
Elements []Object
}
Array represent a standard collection of object
type Boolean ¶
type Boolean struct {
Value bool
}
Boolean is a wrapper on a native bool type
type Builtin ¶
type Builtin struct { Fn BuiltinFunction RequireEnv bool EnvName string }
Builtin represent a builtin construct of the interpreter
type BuiltinFunction ¶
BuiltinFunction represent a function builtin to the interpreter (meaning not user-defined)
type Environment ¶
type Environment struct {
// contains filtered or unexported fields
}
Environment is the construct that holds the variables (and associated values) declared by the user It also has a reference to its outer environement (if any); allowing for some scoping
func NewEnclosedEnvironment ¶
func NewEnclosedEnvironment(outer *Environment) *Environment
NewEnclosedEnvironment creates new instance that's enclosed in an existing one.
func NewEnvironment ¶
func NewEnvironment() *Environment
NewEnvironment creates new instance with no outer environement (top-level)
func NewEnvironmentWithParams ¶
func NewEnvironmentWithParams(tickets string) *Environment
NewEnvironmentWithParams creates a new instance with some predefined values
type Error ¶
type Error struct {
Message string
}
Error is an object that encloses an error message and allows error management within the interpreter
type Function ¶
type Function struct { Parameters []*ast.Identifier Body *ast.BlockStatement Env *Environment }
Function is an executable block
type Hash ¶
Hash is a simple map, mapping HashKey to HashPair
type Hashable ¶
type Hashable interface {
HashKey() HashKey
}
Hashable is an interface to be implemented by object that can by hashed
type Integer ¶
type Integer struct {
Value int64
}
Integer is a wrapper on a native int64 type
type Object ¶
Object is the interface to be implement for any and all object that will be stored in the AST
type Repo ¶
Repo is a wrapper for the interpreter of scl.GlifRepo object which itself wraps the *git.Repository
type ReturnValue ¶
type ReturnValue struct {
Value Object
}
ReturnValue is a wrapper for whatever value is passed by a return call
func (*ReturnValue) Inspect ¶
func (rv *ReturnValue) Inspect() string
Inspect the inner value of the Object (any object implementing the interface Object)
func (*ReturnValue) Type ¶
func (rv *ReturnValue) Type() Type
Type returns ReturnValueObj (RETURN_VALUE)
type String ¶
type String struct {
Value string
}
String is a wraper on a native string type