mirror of
https://github.com/MontFerret/ferret.git
synced 2024-12-16 11:37:36 +02:00
30 lines
465 B
Go
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())
|
|
}
|
|
}
|