Documentation ¶
Overview ¶
Package lua is the main API package of this application.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Nil = nilType(0) False = boolType(0) True = boolType(1) )
Functions ¶
This section is empty.
Types ¶
type Engine ¶
type Engine struct {
// contains filtered or unexported fields
}
func (Engine) Eval ¶
Eval evaluates the bytes in the given reader. If an error occurs while parsing, or something strange happens internally, then an error will be returned. However, when Lua's error function is called, the error will be of type Error.
The parsed source will be evaluated as chunk, and all values that the chunk may return are returned as Values.
Example ¶
// this can be every file from os.Open or (afero.Fs).Open, which all implement the // io.Reader interface var sourceFile io.Reader = strings.NewReader(`print("Hello, World!")`) e := NewEngine( WithStdout(os.Stdout), ) _, err := e.Eval(sourceFile) if err != nil { panic(err) }
Output: Hello, World!
type Error ¶
type Error struct { Message string Stack []StackFrame }
type Option ¶
type Option func(*Engine)
func WithScannerType ¶
func WithScannerType(typ ScannerType) Option
func WithStderr ¶
func WithStdout ¶
func WithWorkingDirectory ¶
type StackFrame ¶
type StackFrame struct {
Name string
}
Directories ¶
Path | Synopsis |
---|---|
cmd
|
|
internal
|
|
tools/analysis/ctxfunc
Package ctxfunc implements an analyzer that checks if a context argument is always the first parameter to a function, and that it is named 'ctx'.
|
Package ctxfunc implements an analyzer that checks if a context argument is always the first parameter to a function, and that it is named 'ctx'. |
tools/analysis/nopanic
Package nopanic implements an analyzer that checks if somewhere in the source, there is a panic.
|
Package nopanic implements an analyzer that checks if somewhere in the source, there is a panic. |
Click to show internal directories.
Click to hide internal directories.