Copyright | 2011-2014 Magnus Therning |
---|---|
License | BSD3 |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Internal functions used in Reader
.
Synopsis
- data IniReaderError
- type IniParseResult = Either IniReaderError
- data IniFile
- buildConfig :: [IniFile] -> IniParseResult Config
- eatWhiteSpace :: Parser String
- secParser :: Parser IniFile
- optLineParser :: Parser IniFile
- optContParser :: Parser IniFile
- noiseParser :: Parser IniFile
- iniParser :: Parser [IniFile]
Documentation
data IniReaderError Source #
Instances
Show IniReaderError Source # | |
Defined in Data.Ini.Reader.Internals showsPrec :: Int -> IniReaderError -> ShowS # show :: IniReaderError -> String # showList :: [IniReaderError] -> ShowS # | |
Eq IniReaderError Source # | |
Defined in Data.Ini.Reader.Internals (==) :: IniReaderError -> IniReaderError -> Bool # (/=) :: IniReaderError -> IniReaderError -> Bool # |
type IniParseResult = Either IniReaderError Source #
The type used to represent a line of a config file.
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
.)