runtimelns

package
v1.1.12 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LnsItemKindUnknown = 0
	LnsItemKindStem    = 1
	LnsItemKindInt     = 2
	LnsItemKindReal    = 3
	LnsItemKindStr     = 4
)

Variables

View Source
var DependLuaOnLns_runLuaOnLnsFunc func(luaCode string) (LnsAny, string) = nil
View Source
var LnsNone interface{} = nil
View Source
var Lns_package_path string

Functions

func Depend_canUseAsync

func Depend_canUseAsync() bool

func Depend_canUseChannel

func Depend_canUseChannel() bool

func Depend_existFile

func Depend_existFile(path string) bool

func Depend_getLuaVersion

func Depend_getLuaVersion() string

func Depend_getStackTrace

func Depend_getStackTrace() string

func Depend_setup

func Depend_setup(callback Depend_UpdateVer)

func LnsPreload

func LnsPreload(vm *C.lua_State) C.int

lua の package.preload に登録される関数。 lua の第一引数にロードするモジュール名が渡される。 戻り値として、ロード後の値を push する。

func Lns_DependLuaOnLns_init

func Lns_DependLuaOnLns_init()

func Lns_Depend_init

func Lns_Depend_init()

func Lns_InitMod

func Lns_InitMod()

* 各モジュールを初期化する際に実行する関数。

import エラーを回避するため、 敢てランタイムの関数のどれか一つを呼んでいる。

実際の初期化関数は、 Lns_InitModOnce() で行なう。

func Lns_InitModOnce

func Lns_InitModOnce()

* 各モジュールを初期化する際に実行する関数。

func Lns_IsNil

func Lns_IsNil(val LnsAny) bool

func Lns_NilAccCall0

func Lns_NilAccCall0(self *LnsEnv, call func()) bool

func Lns_NilAccCall1

func Lns_NilAccCall1(self *LnsEnv, call func() LnsAny) bool

func Lns_NilAccCall2

func Lns_NilAccCall2(self *LnsEnv, call func() (LnsAny, LnsAny)) bool

func Lns_NilAccCall3

func Lns_NilAccCall3(self *LnsEnv, call func() (LnsAny, LnsAny, LnsAny)) bool

func Lns_NilAccFinCall2

func Lns_NilAccFinCall2(ret LnsAny) (LnsAny, LnsAny)

func Lns_NilAccFinCall3

func Lns_NilAccFinCall3(ret LnsAny) (LnsAny, LnsAny, LnsAny)

func Lns_Str_init

func Lns_Str_init()

func Lns_ToBoolSub

func Lns_ToBoolSub(obj LnsAny, nilable bool, paramList []Lns_ToObjParam) (bool, LnsAny, LnsAny)

func Lns_ToIntSub

func Lns_ToIntSub(
	obj LnsAny, nilable bool, paramList []Lns_ToObjParam) (bool, LnsAny, LnsAny)

func Lns_ToListSub

func Lns_ToListSub(
	obj LnsAny, nilable bool, paramList []Lns_ToObjParam) (bool, LnsAny, LnsAny)

func Lns_ToLnsMapSub

func Lns_ToLnsMapSub(
	obj LnsAny, nilable bool, paramList []Lns_ToObjParam) (bool, LnsAny, LnsAny)

func Lns_ToRealSub

func Lns_ToRealSub(obj LnsAny, nilable bool, paramList []Lns_ToObjParam) (bool, LnsAny, LnsAny)

func Lns_ToSetSub

func Lns_ToSetSub(
	obj LnsAny, nilable bool, paramList []Lns_ToObjParam) (bool, LnsAny, LnsAny)

func Lns_ToStemSub

func Lns_ToStemSub(
	obj LnsAny, nilable bool, paramList []Lns_ToObjParam) (bool, LnsAny, LnsAny)

func Lns_ToStrSub

func Lns_ToStrSub(obj LnsAny, nilable bool, paramList []Lns_ToObjParam) (bool, LnsAny, LnsAny)

func Lns_ToString

func Lns_ToString(val LnsAny) string

func Lns_initPreload

func Lns_initPreload(vm *C.lua_State)

func Lns_io_open

func Lns_io_open(path string, mode LnsAny) (LnsAny, LnsAny)

func Lns_isCondTrue

func Lns_isCondTrue(stem LnsAny) bool

func Lns_op_not

func Lns_op_not(stem LnsAny) bool

func Lns_print

func Lns_print(multi []LnsAny)

func Lns_runLuaScript

func Lns_runLuaScript(script string)

func Lns_type

func Lns_type(val LnsAny) string

func Str_endsWith

func Str_endsWith(txt, ptn string) bool

func Str_isValidStrBuilder

func Str_isValidStrBuilder() bool

func Str_startsWith

func Str_startsWith(txt, ptn string) bool

Types

type Depend_UpdateVer

type Depend_UpdateVer func(ver LnsInt)

type LnsAlgeVal

type LnsAlgeVal interface {
	GetTxt() string
}

type LnsAny

type LnsAny = interface{}

func DependLuaOnLns_runLuaOnLns

func DependLuaOnLns_runLuaOnLns(luaCode string) (LnsAny, string)

func Depend_getFileLastModifiedTime

func Depend_getFileLastModifiedTime(path string) LnsAny

* path の最終更新日時を取得する。

@param path ファイルパス @return 1970/1/1 0:0:0 からの秒数。 取得失敗した場合は nil。

func Depend_profile

func Depend_profile(validTest bool, work LnsForm, path string) LnsAny

func Depend_searchpath

func Depend_searchpath(mod string, pathPattern string) LnsAny

func Lns_2DDD

func Lns_2DDD(multi ...LnsAny) []LnsAny

func Lns_FromStemGetAt

func Lns_FromStemGetAt(obj LnsAny, index LnsAny, nilAccess bool) LnsAny

func Lns_ToCollection

func Lns_ToCollection(val LnsAny) LnsAny

func Lns_car

func Lns_car(multi ...LnsAny) LnsAny

* 多値返却の先頭を返す

func Lns_cast2LnsInt

func Lns_cast2LnsInt(val LnsAny) LnsAny

func Lns_cast2LnsReal

func Lns_cast2LnsReal(val LnsAny) LnsAny

func Lns_cast2bool

func Lns_cast2bool(val LnsAny) LnsAny

func Lns_cast2string

func Lns_cast2string(val LnsAny) LnsAny

func Lns_getFromMulti

func Lns_getFromMulti(multi []LnsAny, index LnsInt) LnsAny

func Lns_require

func Lns_require(val string) LnsAny

func Lns_tonumber

func Lns_tonumber(val string, base LnsAny) LnsAny

func Lns_unwrap

func Lns_unwrap(val LnsAny) LnsAny

func Lns_unwrapDefault

func Lns_unwrapDefault(val, def LnsAny) LnsAny

func Str_Builder2Stem

func Str_Builder2Stem(obj LnsAny) LnsAny

func Str_BuilderDownCastF

func Str_BuilderDownCastF(multi ...LnsAny) LnsAny

type LnsComp

type LnsComp func(val1, val2 LnsAny) bool

type LnsEnv

type LnsEnv struct {
	LuaVM *Lns_luaVM
	// contains filtered or unexported fields
}

func Lns_GetEnv

func Lns_GetEnv() *LnsEnv

func (*LnsEnv) IncStack

func (self *LnsEnv) IncStack() bool

*

  • スタックを一段上げる

func (*LnsEnv) NilAccFin

func (self *LnsEnv) NilAccFin(ret bool) LnsAny

func (*LnsEnv) NilAccPop

func (self *LnsEnv) NilAccPop() LnsAny

func (*LnsEnv) NilAccPush

func (self *LnsEnv) NilAccPush(obj interface{}) bool

func (*LnsEnv) PopVal

func (self *LnsEnv) PopVal(dummy bool) LnsAny

*

  • スタックから値を pop する。 *
  • @return pop した値。

func (*LnsEnv) SetStackVal

func (self *LnsEnv) SetStackVal(val LnsAny) bool

*

  • 値 pVal をスタックの top にセットし、値 pVal の条件判定結果を返す *
  • スタックに lns_ddd_t は詰めない。
  • 呼び出し側で lns_ddd_t の先頭要素を指定すること。 *
  • @param pVal スタックに詰む値
  • @return pVal の条件判定結果。 lns_isCondTrue()。

type LnsForm

type LnsForm func([]LnsAny) []LnsAny

type LnsInt

type LnsInt = int

func Lns_forceCastInt

func Lns_forceCastInt(val LnsAny) LnsInt

type LnsList

type LnsList struct {
	Items []LnsAny
	// contains filtered or unexported fields
}

func NewLnsList

func NewLnsList(list []LnsAny) *LnsList

func Str_getLineList

func Str_getLineList(txt string) *LnsList

func (*LnsList) GetAt

func (lnsList *LnsList) GetAt(index int) LnsAny

func (*LnsList) Insert

func (lnsList *LnsList) Insert(val LnsAny)

func (*LnsList) Len

func (self *LnsList) Len() int

func (*LnsList) Less

func (self *LnsList) Less(idx1, idx2 int) bool

func (*LnsList) Remove

func (lnsList *LnsList) Remove(index LnsAny) LnsAny

func (*LnsList) Set

func (lnsList *LnsList) Set(index int, val LnsAny)

func (*LnsList) Sort

func (self *LnsList) Sort(kind int, comp LnsAny)

func (*LnsList) Swap

func (self *LnsList) Swap(idx1, idx2 int)

func (*LnsList) ToCollection

func (self *LnsList) ToCollection() LnsAny

func (*LnsList) ToLuaCode

func (LnsList *LnsList) ToLuaCode(conv *StemToLuaConv)

func (*LnsList) Unpack

func (lnsList *LnsList) Unpack() []LnsAny

type LnsMap

type LnsMap struct {
	Items map[LnsAny]LnsAny
}

func NewLnsMap

func NewLnsMap(arg map[LnsAny]LnsAny) *LnsMap

func (*LnsMap) Correct

func (self *LnsMap) Correct() *LnsMap

func (*LnsMap) CreateKeyListInt

func (self *LnsMap) CreateKeyListInt() *LnsList

func (*LnsMap) CreateKeyListReal

func (self *LnsMap) CreateKeyListReal() *LnsList

func (*LnsMap) CreateKeyListStem

func (self *LnsMap) CreateKeyListStem() *LnsList

func (*LnsMap) CreateKeyListStr

func (self *LnsMap) CreateKeyListStr() *LnsList

func (*LnsMap) Set

func (self *LnsMap) Set(key, val LnsAny)

func (*LnsMap) ToCollection

func (self *LnsMap) ToCollection() LnsAny

func (*LnsMap) ToLuaCode

func (LnsMap *LnsMap) ToLuaCode(conv *StemToLuaConv)

type LnsReader

type LnsReader struct {
	// contains filtered or unexported fields
}

func NewLnsReader

func NewLnsReader(reader io.Reader) *LnsReader

func (*LnsReader) Read

func (self *LnsReader) Read(arg LnsAny) LnsAny

func (*LnsReader) Sync

func (self *LnsReader) Sync()

type LnsReal

type LnsReal = float64

func Lns_forceCastReal

func Lns_forceCastReal(val LnsAny) LnsReal

type LnsSet

type LnsSet struct {
	Items map[LnsAny]bool
}

func NewLnsSet

func NewLnsSet(list []LnsAny) *LnsSet

func (*LnsSet) Add

func (self *LnsSet) Add(val LnsAny)

func (*LnsSet) And

func (self *LnsSet) And(set *LnsSet) *LnsSet

func (*LnsSet) Clone

func (self *LnsSet) Clone() *LnsSet

func (*LnsSet) CreateKeyListInt

func (self *LnsSet) CreateKeyListInt() *LnsList

func (*LnsSet) CreateKeyListReal

func (self *LnsSet) CreateKeyListReal() *LnsList

func (*LnsSet) CreateKeyListStem

func (self *LnsSet) CreateKeyListStem() *LnsList

func (*LnsSet) CreateKeyListStr

func (self *LnsSet) CreateKeyListStr() *LnsList

func (*LnsSet) Del

func (self *LnsSet) Del(val LnsAny)

func (*LnsSet) Has

func (self *LnsSet) Has(val LnsAny) bool

func (*LnsSet) Len

func (self *LnsSet) Len() LnsInt

func (*LnsSet) Or

func (self *LnsSet) Or(set *LnsSet) *LnsSet

func (*LnsSet) Sub

func (self *LnsSet) Sub(set *LnsSet) *LnsSet

func (*LnsSet) ToCollection

func (self *LnsSet) ToCollection() LnsAny

type LnsThread

type LnsThread struct {
	LnsEnv *LnsEnv
	FP     LnsThreadMtd
}

func (*LnsThread) InitLnsThread

func (self *LnsThread) InitLnsThread()

type LnsThreadMtd

type LnsThreadMtd interface {
	Loop()
}

type Lns_FileObj_t

type Lns_FileObj_t struct {
	FP Lns_luaStream
	// contains filtered or unexported fields
}

func (*Lns_FileObj_t) Close

func (self *Lns_FileObj_t) Close()

func (*Lns_FileObj_t) Flush

func (self *Lns_FileObj_t) Flush()

func (*Lns_FileObj_t) Read

func (self *Lns_FileObj_t) Read(arg LnsAny) LnsAny

func (*Lns_FileObj_t) Seek

func (self *Lns_FileObj_t) Seek(kind string, pos LnsInt) (LnsAny, LnsAny)

func (*Lns_FileObj_t) Write

func (self *Lns_FileObj_t) Write(arg string) (LnsAny, LnsAny)

type Lns_ToCollectionIF

type Lns_ToCollectionIF interface {
	ToCollection() LnsAny
}

type Lns_ToMap

type Lns_ToMap interface {
	ToMap() *LnsMap
}

type Lns_ToObj

type Lns_ToObj func(obj LnsAny, nilable bool, paramList []Lns_ToObjParam) (bool, LnsAny, LnsAny)

type Lns_ToObjParam

type Lns_ToObjParam struct {
	Func    func(obj LnsAny, nilable bool, paramList []Lns_ToObjParam) (bool, LnsAny, LnsAny)
	Nilable bool
	Child   []Lns_ToObjParam
}

type Lns__pipe

type Lns__pipe struct {
	FP Lns_pipeMtd
	// contains filtered or unexported fields
}

func NewLnspipe

func NewLnspipe(count int) *Lns__pipe

func (*Lns__pipe) Get

func (self *Lns__pipe) Get() LnsAny

func (*Lns__pipe) Put

func (self *Lns__pipe) Put(val LnsAny)

type Lns_iStream

type Lns_iStream interface {
	Read(arg LnsAny) LnsAny
	Close()
}

type Lns_luaStream

type Lns_luaStream interface {
	Read(arg LnsAny) LnsAny
	Write(arg string) (LnsAny, LnsAny)
	Flush()
	Close()
	Seek(kind string, pos LnsInt) (LnsAny, LnsAny)
}

type Lns_luaVM

type Lns_luaVM struct {
	// contains filtered or unexported fields
}

func Lns_getVM

func Lns_getVM() *Lns_luaVM

func (*Lns_luaVM) CallStatic

func (luaVM *Lns_luaVM) CallStatic(
	packName string, funcname string, args []LnsAny) []LnsAny

* Lua の関数を実行する。

@param packName Lua のパッケージ名。 string.format() を実行する場合 "string"。 @param funcname 実行する関数名。string.format() を実行する場合、 "format"。 @return []LnsAny 実行結果。

func (*Lns_luaVM) ExpandLuavalMap

func (luaVM *Lns_luaVM) ExpandLuavalMap(stem LnsAny) LnsAny

func (*Lns_luaVM) GetEmptyMap

func (luaVM *Lns_luaVM) GetEmptyMap() *Lns_luaValue

func (*Lns_luaVM) GetPackagePath

func (luaVM *Lns_luaVM) GetPackagePath() string

func (*Lns_luaVM) IO_popen

func (luaVM *Lns_luaVM) IO_popen(path string) LnsAny

===============

func (*Lns_luaVM) Load

func (luaVM *Lns_luaVM) Load(txt string, opt LnsAny) (LnsAny, LnsAny)

func (*Lns_luaVM) Loadfile

func (luaVM *Lns_luaVM) Loadfile(path string) (LnsAny, LnsAny)

func (*Lns_luaVM) Math_random

func (luaVM *Lns_luaVM) Math_random(mVal LnsAny, nVal LnsAny) LnsReal

func (*Lns_luaVM) Math_randomseed

func (luaVM *Lns_luaVM) Math_randomseed(seed LnsInt)

func (*Lns_luaVM) NewStemToLuaConv

func (luaVM *Lns_luaVM) NewStemToLuaConv() *StemToLuaConv

func (*Lns_luaVM) OS_clock

func (luaVM *Lns_luaVM) OS_clock() LnsReal

func (*Lns_luaVM) OS_date

func (luaVM *Lns_luaVM) OS_date(format LnsAny, time LnsAny) LnsAny

func (*Lns_luaVM) OS_difftime

func (luaVM *Lns_luaVM) OS_difftime(tm1 LnsAny, tm2 LnsAny) LnsInt

func (*Lns_luaVM) OS_exit

func (luaVM *Lns_luaVM) OS_exit(code LnsAny)

func (*Lns_luaVM) OS_remove

func (luaVM *Lns_luaVM) OS_remove(path string) (LnsAny, LnsAny)

func (*Lns_luaVM) OS_rename

func (luaVM *Lns_luaVM) OS_rename(src string, dst string) (LnsAny, LnsAny)

func (*Lns_luaVM) OS_time

func (luaVM *Lns_luaVM) OS_time(tbl LnsAny) LnsAny

func (*Lns_luaVM) Package_searchpath

func (luaVM *Lns_luaVM) Package_searchpath(name string, path string) LnsAny

func (*Lns_luaVM) RunCode

func (luaVM *Lns_luaVM) RunCode(code string) (bool, []LnsAny, LnsAny)

func (*Lns_luaVM) RunLoadedfunc

func (luaVM *Lns_luaVM) RunLoadedfunc(loaded *Lns_luaValue, args []LnsAny) []LnsAny

func (*Lns_luaVM) SortMapKeyList

func (luaVM *Lns_luaVM) SortMapKeyList(mapObj *Lns_luaValue) *Lns_luaValue

func (*Lns_luaVM) String_byte

func (luaVM *Lns_luaVM) String_byte(
	txt string, from LnsAny, to LnsAny) []LnsAny

func (*Lns_luaVM) String_dump

func (luaVM *Lns_luaVM) String_dump(form *Lns_luaValue, flag LnsAny) string

func (*Lns_luaVM) String_find

func (luaVM *Lns_luaVM) String_find(
	txt string, src string, index LnsAny, plain LnsAny) []LnsAny

func (*Lns_luaVM) String_format

func (luaVM *Lns_luaVM) String_format(format string, ddd []LnsAny) string

func (*Lns_luaVM) String_gmatch

func (luaVM *Lns_luaVM) String_gmatch(txt string, pat string) (LnsAny, LnsAny, LnsAny)

func (*Lns_luaVM) String_gsub

func (luaVM *Lns_luaVM) String_gsub(
	txt string, src string, dst string) (string, LnsInt)

func (*Lns_luaVM) String_lower

func (luaVM *Lns_luaVM) String_lower(txt string) string

func (*Lns_luaVM) String_rep

func (luaVM *Lns_luaVM) String_rep(txt string, num LnsInt) string

func (*Lns_luaVM) String_reverse

func (luaVM *Lns_luaVM) String_reverse(txt string) string

func (*Lns_luaVM) String_sub

func (luaVM *Lns_luaVM) String_sub(txt string, from LnsInt, to LnsAny) string

func (*Lns_luaVM) String_upper

func (luaVM *Lns_luaVM) String_upper(txt string) string

type Lns_luaValue

type Lns_luaValue struct {
	// contains filtered or unexported fields
}

func Depend_getLoadedMod

func Depend_getLoadedMod() *Lns_luaValue

func (*Lns_luaValue) Call

func (luaValue *Lns_luaValue) Call(argList []LnsAny) []LnsAny

func (*Lns_luaValue) CallMethod

func (obj *Lns_luaValue) CallMethod(funcname string, args []LnsAny) []LnsAny

func (*Lns_luaValue) Get1stFromMap

func (luaValue *Lns_luaValue) Get1stFromMap() (LnsAny, LnsAny)

func (*Lns_luaValue) GetAt

func (obj *Lns_luaValue) GetAt(index LnsAny) LnsAny

func (*Lns_luaValue) Len

func (obj *Lns_luaValue) Len() LnsInt

func (*Lns_luaValue) NextFromMap

func (luaValue *Lns_luaValue) NextFromMap(prev LnsAny) (LnsAny, LnsAny)

type Lns_luaValueCore

type Lns_luaValueCore struct {
	// contains filtered or unexported fields
}

type Lns_luaValueCoreList

type Lns_luaValueCoreList struct {
	// contains filtered or unexported fields
}

type Lns_oStream

type Lns_oStream interface {
	Write(arg string) (LnsAny, LnsAny)
	Flush()
	Close()
}

type Lns_pipeMtd

type Lns_pipeMtd interface {
	Put(val LnsAny)
	Get() LnsAny
}

type Lns_stdin_t

type Lns_stdin_t struct {
	FP Lns_iStream
	// contains filtered or unexported fields
}
var Lns_io_stdin *Lns_stdin_t

func (*Lns_stdin_t) Close

func (self *Lns_stdin_t) Close()

func (*Lns_stdin_t) Read

func (self *Lns_stdin_t) Read(arg LnsAny) LnsAny

type Lns_stdout_t

type Lns_stdout_t struct {
	FP Lns_oStream
}
var Lns_io_stderr *Lns_stdout_t
var Lns_io_stdout *Lns_stdout_t

func (*Lns_stdout_t) Close

func (self *Lns_stdout_t) Close()

func (*Lns_stdout_t) Flush

func (self *Lns_stdout_t) Flush()

func (*Lns_stdout_t) Write

func (self *Lns_stdout_t) Write(arg string) (LnsAny, LnsAny)

type RegexpCache

type RegexpCache struct {
	// contains filtered or unexported fields
}

type StemToLuaConv

type StemToLuaConv struct {
	// contains filtered or unexported fields
}

type Str_Builder

type Str_Builder struct {
	FP Str_BuilderMtd
	// contains filtered or unexported fields
}

func NewStr_Builder

func NewStr_Builder() *Str_Builder

func (*Str_Builder) Add

func (self *Str_Builder) Add(val string)

106: decl @lune.@base.@Util.memStream.write

func (*Str_Builder) Clear

func (self *Str_Builder) Clear()

func (*Str_Builder) Get_txt

func (self *Str_Builder) Get_txt() string

func (*Str_Builder) InitStr_Builder

func (self *Str_Builder) InitStr_Builder()

func (*Str_Builder) Len

func (self *Str_Builder) Len() LnsInt

func (*Str_Builder) ToStr_Builder

func (obj *Str_Builder) ToStr_Builder() *Str_Builder

type Str_BuilderDownCast

type Str_BuilderDownCast interface {
	Str_ToBuilder() *Str_Builder
}

type Str_BuilderMtd

type Str_BuilderMtd interface {
	Get_txt() string
	Add(arg1 string)
	Len() LnsInt
	Clear()
}

==== Builder

Jump to

Keyboard shortcuts

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