package ini

import (
	
	
)
Visitor is an interface used by walkers that will traverse an array of ASTs.
type Visitor interface {
	VisitExpr(AST) error
	VisitStatement(AST) error
}
DefaultVisitor is used to visit statements and expressions and ensure that they are both of the correct format. In addition, upon visiting this will build sections and populate the Sections field which can be used to retrieve profile configuration.
NewDefaultVisitor return a DefaultVisitor
VisitExpr visits expressions...
func ( *DefaultVisitor) ( AST) error {
	 := .Sections.container[.scope]
	if .values == nil {
		.values = values{}
	}

	switch .Kind {
	case ASTKindExprStatement:
		 := .GetRoot()
		switch .Kind {
		case ASTKindEqualExpr:
			 := .GetChildren()
			if len() <= 1 {
				return NewParseError("unexpected token type")
			}

			 := [1]

			if .Root.Type() != TokenLit {
				return NewParseError("unexpected token type")
			}

			 := EqualExprKey()
			,  := newValue(.Root.ValueType, .Root.base, .Root.Raw())
			if  != nil {
				return 
			}

			.values[] = 
		default:
			return NewParseError(fmt.Sprintf("unsupported expression %v", ))
		}
	default:
		return NewParseError(fmt.Sprintf("unsupported expression %v", ))
	}

	.Sections.container[.scope] = 
	return nil
}
VisitStatement visits statements...
func ( *DefaultVisitor) ( AST) error {
	switch .Kind {
	case ASTKindCompletedSectionStatement:
		 := .GetRoot()
		if .Kind != ASTKindSectionStatement {
			return NewParseError(fmt.Sprintf("unsupported child statement: %T", ))
		}

		 := string(.Root.Raw())
		.Sections.container[] = Section{}
		.scope = 
	default:
		return NewParseError(fmt.Sprintf("unsupported statement: %s", .Kind))
	}

	return nil
}
Sections is a map of Section structures that represent a configuration.
type Sections struct {
	container map[string]Section
}
GetSection will return section p. If section p does not exist, false will be returned in the second parameter.
func ( Sections) ( string) (Section, bool) {
	,  := .container[]
	return , 
}
values represents a map of union values.
type values map[string]Value
List will return a list of all sections that were successfully parsed.
func ( Sections) () []string {
	 := make([]string, len(.container))
	 := 0
	for  := range .container {
		[] = 
		++
	}

	sort.Strings()
	return 
}
Section contains a name and values. This represent a sectioned entry in a configuration file.
type Section struct {
	Name   string
	values values
}
Has will return whether or not an entry exists in a given section
func ( Section) ( string) bool {
	,  := .values[]
	return 
}
ValueType will returned what type the union is set to. If k was not found, the NoneType will be returned.
func ( Section) ( string) (ValueType, bool) {
	,  := .values[]
	return .Type, 
}
Bool returns a bool value at k
func ( Section) ( string) bool {
	return .values[].BoolValue()
}
Int returns an integer value at k
func ( Section) ( string) int64 {
	return .values[].IntValue()
}
Float64 returns a float value at k
func ( Section) ( string) float64 {
	return .values[].FloatValue()
}
String returns the string value at k
func ( Section) ( string) string {
	,  := .values[]
	if ! {
		return ""
	}
	return .values[].StringValue()