1
0
mirror of https://github.com/MontFerret/ferret.git synced 2024-12-04 10:35:08 +02:00
ferret/options.go
2021-05-04 15:01:27 -04:00

30 lines
465 B
Go

package ferret
import "github.com/MontFerret/ferret/pkg/compiler"
type (
Options struct {
compiler []compiler.Option
}
Option func(opts *Options)
)
func NewOptions(setters []Option) *Options {
res := &Options{
compiler: make([]compiler.Option, 0, 2),
}
for _, setter := range setters {
setter(res)
}
return res
}
func WithoutStdlib() Option {
return func(opts *Options) {
opts.compiler = append(opts.compiler, compiler.WithoutStdlib())
}
}