packages feed

htoml-megaparsec 1.0.1.8 → 1.0.1.9

raw patch · 4 files changed

+13/−14 lines, 4 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Text.Toml.Types: VArray :: !VArray -> Node
+ Text.Toml.Types: VArray :: VArray -> Node
- Text.Toml.Types: VBoolean :: !Bool -> Node
+ Text.Toml.Types: VBoolean :: Bool -> Node
- Text.Toml.Types: VDatetime :: !UTCTime -> Node
+ Text.Toml.Types: VDatetime :: UTCTime -> Node
- Text.Toml.Types: VFloat :: !Double -> Node
+ Text.Toml.Types: VFloat :: Double -> Node
- Text.Toml.Types: VInteger :: !Int64 -> Node
+ Text.Toml.Types: VInteger :: Int64 -> Node
- Text.Toml.Types: VString :: !Text -> Node
+ Text.Toml.Types: VString :: Text -> Node
- Text.Toml.Types: VTArray :: !VTArray -> Node
+ Text.Toml.Types: VTArray :: VTArray -> Node
- Text.Toml.Types: VTable :: !Table -> Node
+ Text.Toml.Types: VTable :: Table -> Node

Files

htoml-megaparsec.cabal view
@@ -1,5 +1,5 @@ name:                     htoml-megaparsec-version:                  1.0.1.8+version:                  1.0.1.9 synopsis:                 Parser for TOML files description:              TOML is an obvious and minimal format for config files.                           This package provides a TOML parser
src/Text/Toml/Parser.hs view
@@ -60,7 +60,7 @@ table = do     pairs <- many (assignment <* skipBlanks) <|> (skipBlanks >> pure [])     case maybeDupe (map fst pairs) of-      Just k  -> throwParser $ "Cannot redefine key " ++ unpack k+      Just k  -> throwParser $ "Cannot redefine key '" ++ unpack k ++ "'"       Nothing -> return $ M.fromList pairs  -- | Parses an inline table of key-value pairs.@@ -258,7 +258,7 @@               <|> char 'f'  *> return '\f'               <|> char 'u'  *> unicodeHex 4               <|> char 'U'  *> unicodeHex 8-              <?> "escape character"+              <?> "escaped character"   -- | Parser for unicode hexadecimal values of representation length 'n'.@@ -266,7 +266,7 @@ unicodeHex n = do     h <- count n hexDigitChar -- (satisfy isHex)     let v = fst . head . readHex $ h-    return $ if v <= maxChar then toEnum v else '_'+    return $ if v <= maxChar then toEnum v else '�'   where     -- isHex x = or . sequence [isDigit, isAsciiUpper, isAsciiLower]     maxChar = fromEnum (maxBound :: Char)
src/Text/Toml/Types.hs view
@@ -62,14 +62,14 @@ type VArray = Vector Node  -- | A 'Node' may contain any type of value that may be put in a 'VArray'.-data Node = VTable    !Table-          | VTArray   !VTArray-          | VString   !Text-          | VInteger  !Int64-          | VFloat    !Double-          | VBoolean  !Bool-          | VDatetime !UTCTime-          | VArray    !VArray+data Node = VTable    Table+          | VTArray   VTArray+          | VString   Text+          | VInteger  Int64+          | VFloat    Double+          | VBoolean  Bool+          | VDatetime UTCTime+          | VArray    VArray   deriving (Eq, Show, Generic, NFData)  -- | To mark whether or not a 'Table' has been explicitly defined.
test/BurntSushi.hs view
@@ -15,7 +15,6 @@ import           Data.Text.Encoding   (decodeUtf8)  import           Text.Toml-import           Text.Toml.Types   allFiles :: [(FilePath, B.ByteString)]@@ -53,7 +52,7 @@   where     assertIsValid f tomlBS jsonBS =       case parseTomlDoc "test" (decodeUtf8 tomlBS) of-        Left e -> assertFailure $ "Could not parse TOML file: " ++ f ++ ".toml\n" ++ (show e)+        Left e -> assertFailure $ "Could not parse TOML file: " ++ f ++ ".toml\n" ++ show e         Right tomlTry -> case eitherDecode (fromStrict jsonBS) of           Left _ -> assertFailure $ "Could not parse JSON file: " ++ f ++ ".json"           Right jsonCorrect -> assertEqual "" jsonCorrect (toBsJSON tomlTry)