File tree Expand file tree Collapse file tree 8 files changed +352
-97
lines changed
Expand file tree Collapse file tree 8 files changed +352
-97
lines changed File renamed without changes.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11package argparse
22
3- //go:generate go run internal/include_all_lua.go
4-
53import (
6- "encoding/base64"
7-
84 lua "github.com/yuin/gopher-lua"
95)
106
7+ //go:generate go run github.com/logrusorgru/textFileToGoConst@latest -in argparse.lua -o lua_const.go -c lua_argparse
8+
119// Preload adds inspect to the given Lua state's package.preload table. After it
1210// has been preloaded, it can be loaded using require:
1311//
14- // local inspect = require("inspect")
12+ // local inspect = require("inspect")
1513func Preload (L * lua.LState ) {
1614 L .PreloadModule ("argparse" , Loader )
1715}
1816
1917// Loader is the module loader function.
2018func Loader (L * lua.LState ) int {
21- code , err := base64 .StdEncoding .DecodeString (lua_argparse )
22- if err != nil {
23- panic (err .Error ())
24- }
25- if err := L .DoString (string (code )); err != nil {
19+ if err := L .DoString (lua_argparse ); err != nil {
2620 L .RaiseError ("load library 'argparse' error: %s" , err .Error ())
2721 }
2822 return 1
Load Diff Large diffs are not rendered by default.
File renamed without changes.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 11package inspect
22
3- //go:generate go run internal/include_all_lua.go
3+ //go:generate go run github.com/logrusorgru/textFileToGoConst@latest -in inspect.lua -o lua_const.go -c lua_inspect
44
55import (
6- "encoding/base64"
7-
86 lua "github.com/yuin/gopher-lua"
97)
108
119// Preload adds inspect to the given Lua state's package.preload table. After it
1210// has been preloaded, it can be loaded using require:
1311//
14- // local inspect = require("inspect")
12+ // local inspect = require("inspect")
1513func Preload (L * lua.LState ) {
1614 L .PreloadModule ("inspect" , Loader )
1715}
1816
1917// Loader is the module loader function.
2018func Loader (L * lua.LState ) int {
21- code , err := base64 .StdEncoding .DecodeString (lua_inspect )
22- if err != nil {
23- panic (err .Error ())
24- }
25- if err := L .DoString (string (code )); err != nil {
19+ if err := L .DoString (lua_inspect ); err != nil {
2620 L .RaiseError ("load library 'inspect' error: %s" , err .Error ())
2721 }
2822 return 1
Load Diff Large diffs are not rendered by default.
You can’t perform that action at this time.
0 commit comments