Documentation ¶
Index ¶
- Constants
- Variables
- func ArityErr(i *Interp, name string, argv []interface{}) error
- func CommandCallProc(i *Interp, argv []interface{}, pd interface{}) (interface{}, error)
- func CommandError(i *Interp, argv []interface{}, pd interface{}) (interface{}, error)
- func CommandIf(i *Interp, argv []interface{}, pd interface{}) (interface{}, error)
- func CommandMath(i *Interp, argv []interface{}, pd interface{}) (interface{}, error)
- func CommandProc(i *Interp, argv []interface{}, pd interface{}) (interface{}, error)
- func CommandRetCodes(i *Interp, argv []interface{}, pd interface{}) (interface{}, error)
- func CommandReturn(i *Interp, argv []interface{}, pd interface{}) (interface{}, error)
- func CommandSet(i *Interp, argv []interface{}, pd interface{}) (interface{}, error)
- func CommandUnset(i *Interp, argv []interface{}, pd interface{}) (interface{}, error)
- func CommandWhile(i *Interp, argv []interface{}, pd interface{}) (interface{}, error)
- type CallFrame
- type Cmd
- type CmdFunc
- type Interp
- func (i *Interp) Command(name string) *Cmd
- func (i *Interp) Eval(t string) (interface{}, error)
- func (i *Interp) RegisterCommand(name string, fn CmdFunc, privdata interface{}) error
- func (i *Interp) RegisterCoreCommands()
- func (i *Interp) SetVar(name string, val interface{})
- func (i *Interp) UnsetVar(name string)
- func (i *Interp) Var(name string) (interface{}, error)
- type Parser
- type Var
Constants ¶
View Source
const ( PT_ESC = iota PT_STR PT_CMD PT_VAR PT_SEP PT_EOL PT_EOF )
Variables ¶
Functions ¶
func CommandCallProc ¶
func CommandError ¶
func CommandMath ¶
func CommandProc ¶
func CommandRetCodes ¶
func CommandReturn ¶
func CommandSet ¶
func CommandUnset ¶
func CommandWhile ¶
Types ¶
type CmdFunc ¶
by default, all args are assumed to be strings, I am changing them to interface{}, so we could pass custom data type objects to the commands, the return type should also be interface{} instead of the default string
type Interp ¶
type Interp struct {
// contains filtered or unexported fields
}
func InitInterp ¶
func InitInterp() *Interp
func (*Interp) Eval ¶
EVAL!
Ideally Eval should take interface{}, which would help us either evaluate a string or an already parsed lexical tokens. For now we are starting with string and we could optimize on this at a later stage when we rewrite our parser module.
func (*Interp) RegisterCommand ¶
func (*Interp) RegisterCoreCommands ¶
func (i *Interp) RegisterCoreCommands()
type Parser ¶
type Parser struct { Type int // contains filtered or unexported fields }
func InitParser ¶
Click to show internal directories.
Click to hide internal directories.