package ini

import (
	
)
getStringValue will return a quoted string and the amount of bytes read an error will be returned if the string is not properly formatted
func ( []rune) (int, error) {
	if [0] != '"' {
		return 0, NewParseError("strings must start with '\"'")
	}

	 := false
	 := 1

	for ;  < len() && !; ++ {
		if  := isEscaped([:], []); [] == '"' && ! {
			 = true
			break
c, err := getEscapedByte(b[i]) if err != nil { return 0, err }
b[i-1] = c b = append(b[:i], b[i+1:]...) i--

			continue
		}
	}

	if ! {
		return 0, NewParseError("missing '\"' in string value")
	}

	return  + 1, nil
}
getBoolValue will return a boolean and the amount of bytes read an error will be returned if the boolean is not of a correct value
func ( []rune) (int, error) {
	if len() < 4 {
		return 0, NewParseError("invalid boolean value")
	}

	 := 0
	for ,  := range literalValues {
		if len() > len() {
			continue
		}

		if isLitValue(, ) {
			 = len()
		}
	}

	if  == 0 {
		return 0, NewParseError("invalid boolean value")
	}

	return , nil
}
getNumericalValue will return a numerical string, the amount of bytes read, and the base of the number an error will be returned if the number is not of a correct value
func ( []rune) (int, int, error) {
	if !isDigit([0]) {
		return 0, 0, NewParseError("invalid digit value")
	}

	 := 0
	 := numberHelper{}

:
	for  := 0;  < len(); ++ {
		++

		if !isDigit([]) {
			switch [] {
			case '-':
				if .IsNegative() ||  != 1 {
					return 0, 0, NewParseError("parse error '-'")
				}

				 := getNegativeNumber([:])
				 += ( - 1)
				.Determine([])
				continue
			case '.':
				if  := .Determine([]);  != nil {
					return 0, 0, 
				}
			case 'e', 'E':
				if  := .Determine([]);  != nil {
					return 0, 0, 
				}

				 = 0
			case 'b':
				if .numberFormat == hex {
					break
				}
				fallthrough
			case 'o', 'x':
				if  == 0 && [] != '0' {
					return 0, 0, NewParseError("incorrect base format, expected leading '0'")
				}

				if  != 1 {
					return 0, 0, NewParseError(fmt.Sprintf("incorrect base format found %s at %d index", string([]), ))
				}

				if  := .Determine([]);  != nil {
					return 0, 0, 
				}
			default:
				if isWhitespace([]) {
					break 
				}

				if isNewline([:]) {
					break 
				}

				if !(.numberFormat == hex && isHexByte([])) {
					if +2 < len() && !isNewline([:+2]) {
						return 0, 0, NewParseError("invalid numerical character")
					} else if !isNewline([]rune{[]}) {
						return 0, 0, NewParseError("invalid numerical character")
					}

					break 
				}
			}
		}
	}

	return .Base(), , nil
}
isDigit will return whether or not something is an integer
func ( rune) bool {
	return  >= '0' &&  <= '9'
}

func ( []rune) bool {
	return contains(, 'e') || contains(, 'E')
}

func ( rune) bool {
	switch  {
	case '0', '1':
		return true
	default:
		return false
	}
}

func ( rune) bool {
	switch  {
	case '0', '1', '2', '3', '4', '5', '6', '7':
		return true
	default:
		return false
	}
}

func ( rune) bool {
	if isDigit() {
		return true
	}
	return ( >= 'A' &&  <= 'F') ||
		( >= 'a' &&  <= 'f')
}

func ( []rune) (int, error) {
	 := 0

	for  < len() {
		if isNewline([:]) {
			break
		}

		if isOp([:]) {
			break
		}

		, ,  := isValid([:])
		if  != nil {
			return 0, 
		}

		if ! {
			break
		}

		 += 
	}

	return , nil
}
getNegativeNumber will return a negative number from a byte slice. This will iterate through all characters until a non-digit has been found.
func ( []rune) int {
	if [0] != '-' {
		return 0
	}

	 := 1
	for ;  < len(); ++ {
		if !isDigit([]) {
			return 
		}
	}

	return 
}
isEscaped will return whether or not the character is an escaped character.
func ( []rune,  rune) bool {
	if len() == 0 {
		return false
	}

	switch  {
	case '\'': // single quote
	case '"': // quote
	case 'n': // newline
	case 't': // tab
	case '\\': // backslash
	default:
		return false
	}

	return [len()-1] == '\\'
}

func ( rune) (rune, error) {
	switch  {
	case '\'': // single quote
		return '\'', nil
	case '"': // quote
		return '"', nil
	case 'n': // newline
		return '\n', nil
	case 't': // table
		return '\t', nil
	case '\\': // backslash
		return '\\', nil
	default:
		return , NewParseError(fmt.Sprintf("invalid escaped character %c", ))
	}
}

func ( []rune) []rune {
	for  := 0;  < len(); ++ {
		if isEscaped([:], []) {
			,  := getEscapedByte([])
			if  != nil {
				return 
			}

			[-1] = 
			 = append([:], [+1:]...)
			--
		}
	}

	return