hsini-0.5.2.2: ini configuration files
Copyright2011-2014 Magnus Therning
LicenseBSD3
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Ini.Reader.Internals

Description

Internal functions used in Reader.

Synopsis

Documentation

data IniReaderError Source #

Constructors

IniParserError String 
IniSyntaxError String 
IniOtherError String 

Instances

Instances details
Show IniReaderError Source # 
Instance details

Defined in Data.Ini.Reader.Internals

Methods

showsPrec :: Int -> IniReaderError -> ShowS

show :: IniReaderError -> String

showList :: [IniReaderError] -> ShowS

Eq IniReaderError Source # 
Instance details

Defined in Data.Ini.Reader.Internals

data IniFile Source #

The type used to represent a line of a config file.

Constructors

SectionL String 
OptionL String String 
OptionContL String 
CommentL 

Instances

Instances details
Show IniFile Source # 
Instance details

Defined in Data.Ini.Reader.Internals

Methods

showsPrec :: Int -> IniFile -> ShowS

show :: IniFile -> String

showList :: [IniFile] -> ShowS

Eq IniFile Source # 
Instance details

Defined in Data.Ini.Reader.Internals

Methods

(==) :: IniFile -> IniFile -> Bool

(/=) :: IniFile -> IniFile -> Bool

buildConfig :: [IniFile] -> IniParseResult Config Source #

Build a configuration from a list of IniFile items.

eatWhiteSpace :: Parser String Source #

Consumer of whitespace " t".

secParser :: Parser IniFile Source #

Parser for the start-of-section line. It expects the line to start with a [ then find the section name, and finally a ]. The section name may be surrounded by any number of white space characters (see eatWhiteSpace).

optLineParser :: Parser IniFile Source #

Parser for a single line of an option. The line must start with an option name, then a = must be found, and finally the rest of the line is taken as the option value. The equal sign may be surrounded by any number of white space characters (see eatWhiteSpace).

optContParser :: Parser IniFile Source #

Parser for an option-value continuation line. The line must start with either a space or a tab character (" t"). Everything else on the line, until the newline character, is taken as the continuation of an option value.

noiseParser :: Parser IniFile Source #

Parser for "noise" in the configuration file, such as comments and empty lines. (Note that lines containing only space characters will be successfully parsed by optContParser.)