package goabnf

const (
	defaultValidate = true
	defaultRedefine = false
)

func process( ...ABNFOption) *abnfOptions {
	 := &abnfOptions{
		validate:     defaultValidate,
		redefineCore: defaultRedefine,
	}
	for ,  := range  {
		.apply()
	}
	return 
}

// ABNFOption defines the interface for parsing ABNF functional options.
type ABNFOption interface {
	apply(*abnfOptions)
}

type abnfOptions struct {
	validate     bool
	redefineCore bool
}

// Defines if proceed to semantic validation.
type validateOption bool

var _ ABNFOption = (*validateOption)(nil)

func ( validateOption) ( *abnfOptions) {
	.validate = bool()
}

// WithValidation returns a functional option to proceed to
// validation or not.
// Default is true.
func ( bool) ABNFOption {
	return validateOption()
}

// Defines if an ABNF grammar could redefine a core rule.
type redefineCoreOption bool

var _ ABNFOption = (*redefineCoreOption)(nil)

func ( redefineCoreOption) ( *abnfOptions) {
	.redefineCore = bool()
}

// WithRedefineCoreRules returns a functional option to
// enable redefining a core rule.
// Default is false.
//
// WARNING: use with caution, as we left to the user the responsibility
// to ensure the redefinition keeps the ABNF grammar coherent (i.e.
// there is an isomorphism between the core rule and the redefinition,
// not especially the same textual representation).
func ( bool) ABNFOption {
	return redefineCoreOption()
}