-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodule.go
29 lines (26 loc) · 899 Bytes
/
module.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
package sun
import (
"go.starlark.net/starlark"
"go.starlark.net/starlarkstruct"
)
// Module builtins is a Starlark module of Python-like builtins functions.
var Module = &starlarkstruct.Module{
Name: "builtins",
Members: starlark.StringDict{
"map": starlark.NewBuiltin("map", map_),
"next": starlark.NewBuiltin("next", next),
"filter": starlark.NewBuiltin("filter", filter),
"callable": starlark.NewBuiltin("callable", callable),
"hex": starlark.NewBuiltin("hex", hex),
"oct": starlark.NewBuiltin("oct", oct),
"bin": starlark.NewBuiltin("bin", bin),
},
}
// Module itertools is a Starlark module of Python's itertools module.
var ItertoolsModule = &starlarkstruct.Module{
Name: "itertools",
Members: starlark.StringDict{
"count": starlark.NewBuiltin("itertools.count", count_),
"islice": starlark.NewBuiltin("itertools.islice", islice),
},
}