Documentation ¶
Overview ¶
commands.go All the basic commands supported by throff. They are all cross platform, and usually are in caps
They all need more error checking
Index ¶
- Variables
- func BootStrapString() string
- func DetectJapanese(text string) bool
- func PopData(e *Engine) (*Thingy, *Engine)
- func SlurpFile(fname string) string
- func String2Big(in string, precision uint) *big.Float
- type Engine
- func (e *Engine) CallArgs(s string, args ...string) (string, *Engine)
- func (e *Engine) CallArgs1(s string, args ...interface{}) (string, *Engine)
- func (e *Engine) CallArray(s string, args []string) ([]string, *Engine)
- func (e *Engine) CurrentEndBrace() string
- func (e *Engine) DataStackTop() *Thingy
- func (e *Engine) LoadTokens(s Stack)
- func (e *Engine) Run() *Engine
- func (e *Engine) RunFile(s string) *Engine
- func (e *Engine) RunString(s string, source string) *Engine
- type Stack
- type StepFunc
- type Thingy
- func Environment(e *Engine) *Thingy
- func NewArray(a Stack) *Thingy
- func NewBool(a int) *Thingy
- func NewBytes(bytes []byte, env *Thingy) *Thingy
- func NewCode(aName string, arity, arityIn, arityOut int, aFunc StepFunc) *Thingy
- func NewContinuation(e *Engine) *Thingy
- func NewHash() *Thingy
- func NewString(aString string, env *Thingy) *Thingy
- func NewToken(aString string, env *Thingy) *Thingy
- func NewWrapper(s interface{}) *Thingy
- func StringsToArray(stringBits []string) *Thingy
Constants ¶
This section is empty.
Variables ¶
var BraceMode = "throff"
var PrintWarnings = false
var USE_FUNCTION_CACHE = false
Functions ¶
func BootStrapString ¶
func BootStrapString() string
func DetectJapanese ¶
Types ¶
type Engine ¶
type Engine struct { LastFunction *Thingy // contains filtered or unexported fields }
func MakeEngine ¶
func MakeEngine() *Engine
Creates a new engine and populates it with the core functions
func (*Engine) CurrentEndBrace ¶
func (*Engine) DataStackTop ¶
func (*Engine) LoadTokens ¶
type Thingy ¶
type Thingy struct {
// contains filtered or unexported fields
}
The fundamental unit of data. In this engine, arrays, hashes, strings and numbers are all "Thingy"s
func NewContinuation ¶
Stores a reference to the engine at the point where it was called. When activated, execution continues at that point
func NewToken ¶
Tokens cause a namespace lookup on their string value Whatever gets returned is pushed onto the code stack Then on the next step, that Thing gets activated, usually moving itself to the data stack, or running some code This can cause infinite loops if the token resolves to itself So we should probably detect that and move it to the data stack, since that is probably what the user wanted?
func NewWrapper ¶
func NewWrapper(s interface{}) *Thingy
Holds any go structure, like a filehandle, network socket or database handle