Files
llgo/c/lua/_demo/error/error.go

22 lines
433 B
Go
Raw Normal View History

2024-06-27 18:19:45 +08:00
package main
import (
_ "unsafe"
"github.com/goplus/llgo/c"
"github.com/goplus/llgo/c/lua"
)
func main() {
2024-09-16 23:12:33 +08:00
L := lua.Newstate__1()
2024-06-27 18:19:45 +08:00
defer L.Close()
2024-07-13 22:57:01 +08:00
L.Openlibs()
if res := L.Loadstring(c.Str("function doubleNumber(x) ! return x * 2 end")); res != lua.OK {
c.Printf(c.Str("error: %s\n"), L.Tostring(-1))
2024-06-27 18:19:45 +08:00
}
}
/* Expected output:
error: [string "function doubleNumber(x) ! return x * 2 end"]:1: unexpected symbol near '!'
*/