xgoprev/xmodules/cjson/main.go
2024-06-07 13:29:46 +05:00

33 lines
536 B
Go

package cjson
import "github.com/d5/tengo/v2"
import "io"
import "encoding/json"
//import "github.com/d5/tengo/v2/stdlib"
const (
StrStdin = "<stdin>"
)
var Module = map[string]tengo.Object{
"__check": &tengo.BuiltinFunction{
Name: "__check",
Value: func(
args ...tengo.Object,
) (tengo.Object, error) {
return tengo.FromInterface("Hello, Check!")
},
},
"new_decoder": &tengo.BuiltinFunction{
Name: "new_decoder",
Value: NewDecoder,
},
}
type Encoder struct {
enc *json.Encoder
output io.Writer
}
//func