_readSection (x:xs) dic = let strippedLine = strip x
                          in case strippedLine of
                             "" -> _readSection xs dic
                             '#':rs -> _readSection xs dic
                             '[':rs -> (x:xs, dic) --new section, end parsing of this section.
                             _ -> _readSection xs (_addConfigValue strippedLine dic)

-- | Parse part of a config list. Receives the rest of a config list and an unfinished dictionary and completes it.
-- | Calling itself it adds top level keys or calls _readConfigSection to parse a whole section.
_readSection (x:xs) dic = let strippedLine = strip x
                          in case strippedLine of
                             "" -> _readSection xs dic
                             '#':rs -> _readSection xs dic
                             '[':rs -> (x:xs, dic) --new section, end parsing of this section.
                             _ -> _readSection xs (_addConfigValue strippedLine dic)

-- | Parse part of a config list. Receives the rest of a config list and an unfinished dictionary and completes it.
-- | Calling itself it adds top level keys or calls _readConfigSection to parse a whole section.
_readSection (x:xs) dic = let strippedLine = strip x
                          in case strippedLine of
                             "" -> _readSection xs dic
                             '#':rs -> _readSection xs dic
                             '[':rs -> (x:xs, dic) --new section, end parsing of this section.
                             _ -> _readSection xs (_addConfigValue strippedLine dic)

-- | Parse part of a config list. Receives the rest of a config list and an unfinished dictionary and completes it.
-- | Calling itself it adds top level keys or calls _readConfigSection to parse a whole section.