lsl

package
v0.0.0-...-8d81e62 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 14, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type InputReader

type InputReader func() string

InputReader ... function for reading input

type LuaLoader

type LuaLoader struct {
	State  *lua.LState
	Input  io.Reader
	Output io.Writer
	Log    *LuaLog
	EnvMap map[string]lua.LValue
	// contains filtered or unexported fields
}

LuaLoader ... Simple loader system

func NewLuaLoader

func NewLuaLoader(in io.Reader, out io.Writer) *LuaLoader

NewLuaLoader ... creates a new LuaLoader

func (*LuaLoader) BuildEnv

func (ll *LuaLoader) BuildEnv()

BuildEnv ... Initializes the environment needed

func (*LuaLoader) Close

func (ll *LuaLoader) Close()

Close ... End execution and exit

func (*LuaLoader) Code

func (ll *LuaLoader) Code(code string) error

Code ... Execute code path

func (*LuaLoader) DoFile

func (ll *LuaLoader) DoFile(path string) error

DoFile ... Setups up DSL file

func (*LuaLoader) File

func (ll *LuaLoader) File(path string) error

File ... Runs a DSL file

func (*LuaLoader) Function

func (ll *LuaLoader) Function(file io.Reader, name string, params ...lua.LValue) error

Function ... Execute code path

func (*LuaLoader) LoadAllStdLibs

func (ll *LuaLoader) LoadAllStdLibs()

LoadAllStdLibs ... Wrapper around exposing all the OpenLibs()

func (*LuaLoader) LoadStdLibs

func (ll *LuaLoader) LoadStdLibs(exp []string) error

LoadStdLibs ... Provide a list of libraries that are part of the standard library

func (*LuaLoader) SetGlobalVar

func (ll *LuaLoader) SetGlobalVar(n string, v lua.LValue)

SetGlobalVar ... Push into environment

func (*LuaLoader) Test

func (ll *LuaLoader) Test(file io.Reader) error

Test ... Execute test file in dsl mode

func (*LuaLoader) TestFile

func (ll *LuaLoader) TestFile(path string) error

TestFile ... Just pass the path to the file to run the tests on

type LuaLog

type LuaLog struct {
	Output io.Writer
}

LuaLog ... Log capture system

func (*LuaLog) Log

func (ll *LuaLog) Log(v interface{})

Log ... Just output some text

func (*LuaLog) Print

func (ll *LuaLog) Print(v interface{})

Print ... Print out without log

type OutputWriter

type OutputWriter func(txt string)

OutputWriter ... function for writing

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL