Documentation ¶
Index ¶
- Variables
- func Debug(fn func())
- func Import(mod string, table map[string]interface{})
- func SetAutoCall(t reflect.Type)
- func SetDumpCode(dumpCode string)
- func SetFindEntry(fn func(file string, libs []string) (string, error))
- func SetOnPop(fn func(v interface{}))
- func SetReadFile(fn func(file string) ([]byte, error))
- type Options
- type Qlang
- func (p *Qlang) Cl(codeText []byte, fname string) (end int, err error)
- func (p *Qlang) Eval(expr string) (err error)
- func (p *Qlang) Exec(codeText []byte, fname string) (err error)
- func (p *Qlang) InjectMethods(pcls interface{}, code []byte) (err error)
- func (p *Qlang) SafeCl(codeText []byte, fname string) (end int, err error)
- func (p *Qlang) SafeEval(expr string) (err error)
- func (p *Qlang) SafeExec(code []byte, fname string) (err error)
- func (p *Qlang) SetLibs(libs string)
Constants ¶
This section is empty.
Variables ¶
View Source
var Exports = map[string]interface{}{ "new": New, }
Exports is the export table of this module.
View Source
var ( // InsertSemis is interpreter options that means to insert semis smartly. InsertSemis = (*Options)(interpreter.InsertSemis) )
Functions ¶
func SetDumpCode ¶
func SetDumpCode(dumpCode string)
SetDumpCode sets dump code mode:
"1" - dump code with rem instruction. "2" - dump code without rem instruction. else - don't dump code.
func SetFindEntry ¶
SetFindEntry sets the `FindEntry` function.
func SetReadFile ¶
SetReadFile sets the `ReadFile` function.
Types ¶
type Qlang ¶
type Qlang struct { *exec.Context // contains filtered or unexported fields }
A Qlang represents the qlang compiler and executor.
func (*Qlang) InjectMethods ¶ added in v0.2.4
InjectMethods injects some methods into a class. `pcls` can be a `*exec.Class` object or a `string` typed class name.
func (*Qlang) SafeCl ¶
SafeCl compiles a source code, without panic (will convert panic into an error).
func (*Qlang) SafeEval ¶
SafeEval compiles and executes a source code, without panic (will convert panic into an error).
Click to show internal directories.
Click to hide internal directories.