xslate.go
func (tx *Xslate) Configure(args ConfigureArgs) error {
	// The compiler currently does not have any configurable options, but
	// one may want to replace the entire compiler struct
	defaults := map[string]func(*Xslate, Args) error{
		"Compiler": DefaultCompiler,
		"Parser":   DefaultParser,
		"Loader":   DefaultLoader,
		"VM":       DefaultVM,
	}

	for _, key := range []string{"Parser", "Compiler", "Loader", "VM"} {
		configKey := "Configure" + key
		configuror, ok := args.Get(configKey)
		if !ok {
			configuror = defaults[key]
		}

		args, ok := args.Get(key)
		if !ok {
			args = Args{}
		}

		err := tx.configureGeneric(configuror, args.(Args))
		if err != nil {
			return err
		}
	}

	// Configure Functions
	if funcs, ok := args.Get("Functions"); ok {
		tx.VM.SetFunctions(vm.Vars(funcs.(Args)))
	}

	if Debug {
		tx.DumpAST(true)
		tx.DumpByteCode(true)
	}

	return nil
}
func (tx *Xslate) Configure(args ConfigureArgs) error {
	// The compiler currently does not have any configurable options, but
	// one may want to replace the entire compiler struct
	defaults := map[string]func(*Xslate, Args) error{
		"Compiler": DefaultCompiler,
		"Parser":   DefaultParser,
		"Loader":   DefaultLoader,
		"VM":       DefaultVM,
	}

	for _, key := range []string{"Parser", "Compiler", "Loader", "VM"} {
		configKey := "Configure" + key
		configuror, ok := args.Get(configKey)
		if !ok {
			configuror = defaults[key]
		}

		args, ok := args.Get(key)
		if !ok {
			args = Args{}
		}

		err := tx.configureGeneric(configuror, args.(Args))
		if err != nil {
			return err
		}
	}

	// Configure Functions
	if funcs, ok := args.Get("Functions"); ok {
		tx.VM.SetFunctions(vm.Vars(funcs.(Args)))
	}

	if Debug {
		tx.DumpAST(true)
		tx.DumpByteCode(true)
	}

	return nil
}
// Configure is called automatically from `New()` to configure the xslate
// instance from arguments