33 lines
536 B
Go
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
|