packages feed

HaXml 1.25.9 → 1.25.10

raw patch · 5 files changed

+30/−15 lines, 5 filesPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

API changes (from Hackage documentation)

- Text.XML.HaXml.Schema.PrimitiveTypes: instance Text.XML.HaXml.Schema.PrimitiveTypes.SimpleType GHC.Integer.Type.Integer
- Text.XML.HaXml.Schema.Schema: instance Text.XML.HaXml.Schema.Schema.SchemaType GHC.Integer.Type.Integer
- Text.XML.HaXml.TypeMapping: instance Text.XML.HaXml.TypeMapping.HTypeable GHC.Integer.Type.Integer
- Text.XML.HaXml.XmlContent.Haskell: instance Text.XML.HaXml.XmlContent.Parser.XmlContent GHC.Integer.Type.Integer
+ Text.XML.HaXml.Schema.PrimitiveTypes: instance Text.XML.HaXml.Schema.PrimitiveTypes.SimpleType GHC.Num.Integer.Integer
+ Text.XML.HaXml.Schema.Schema: instance Text.XML.HaXml.Schema.Schema.SchemaType GHC.Num.Integer.Integer
+ Text.XML.HaXml.TypeMapping: instance Text.XML.HaXml.TypeMapping.HTypeable GHC.Num.Integer.Integer
+ Text.XML.HaXml.XmlContent.Haskell: instance Text.XML.HaXml.XmlContent.Parser.XmlContent GHC.Num.Integer.Integer

Files

Changelog.md view
@@ -1,3 +1,8 @@+## 1.25.10 (2022-09-12)+- allow empty text content (@TeofilC, #10)+- allow building with GHC 9.4 (@andreasabel, #9)+- better pretty printer formatting (@avieth, #8)+ ## 1.25.9 (2022-04-10) - fix 1.25.7 regression in Xtract.Parse (#7 by Isaac van Bakel) - comment typo fixes (#6 by Eric Lindblad)
HaXml.cabal view
@@ -1,6 +1,6 @@ cabal-version:  1.18 name:           HaXml-version:        1.25.9+version:        1.25.10  license:        LGPL-2.1 license-files:  COPYRIGHT, LICENCE-GPL, LICENCE-LGPL@@ -17,8 +17,9 @@ extra-doc-files: Changelog.md README  tested-with:-  GHC ==9.2.1-   || ==9.0.1+  GHC ==9.4.1+   || ==9.2.4+   || ==9.0.2    || ==8.10.7    || ==8.8.4    || ==8.6.5@@ -86,7 +87,7 @@         Text.XML.HaXml.Schema.Schema   hs-source-dirs: src   build-depends:-    base       >= 4.3.1.0  && < 4.17,+    base       >= 4.3.1.0  && < 4.18,     bytestring >= 0.9.1.10 && < 0.12,     containers >= 0.4.0.0  && <0.7,     filepath   >= 1.2.0.0  && <1.5,
src/Text/XML/HaXml/ByteStringPP.hs view
@@ -140,12 +140,17 @@ --  | any isText cs    = text "<" <> text n <+> fsep (map attribute as) <> --                       text ">" <> hcat (map content cs) <> --                       text "</" <> qname n <> text ">"-    | isText (head cs) = text "<" <> qname n <+> fsep (Prelude.map attribute as) <>+    | isText (head cs) = text "<" <> qname n <> attributes as <>                          text ">" <> hcat (Prelude.map content cs) <>                          text "</" <> qname n <> text ">"-    | otherwise        = let (d,c) = carryelem e empty-                         in d <> c+    | otherwise        = vcat [ text "<" <> qname n <> attributes as <> text ">"+                              , nest 2 (vcat (Prelude.map content cs))+                              , text "</" <> qname n <> text ">"+                              ] +attributes [] = empty+attributes as@(_:_) = text " " <> fsep (Prelude.map attribute as)+ isText :: Content t -> Bool isText (CString _ _ _) = True isText (CRef _ _)      = True@@ -158,10 +163,11 @@                          , text "/>") carryelem (Elem n as cs) c {-  | any isText cs    =  ( c <> element e, empty)-    | otherwise -}     =  let (cs0,d0) = carryscan carrycontent cs (text ">")+    | otherwise -}     =  let (cs0,d0) = carryscan carrycontent cs empty                           in                           ( c <>-                            text "<" <> qname n <+> fsep (Prelude.map attribute as) $$+                            text "<" <> qname n <+> fsep (Prelude.map attribute as) <> text ">" $$+                            -- This is wrong. It includes the close tag of the previous one                             nest 2 (vcat cs0) <> --- $$                             d0 <> text "</" <> qname n                           , text ">")
src/Text/XML/HaXml/Pretty.hs view
@@ -103,8 +103,13 @@     | all isText cs    = text "<" <> qname n <+> fsep (map attribute as) <>                          text ">" <> hcat (map content cs) <>                          text "</" <> qname n <> text ">"-    | otherwise        = let (d,c) = carryelem e empty-                         in d <> c+    | otherwise        = vcat [ text "<" <> qname n <> attributes as <> text ">"+                              , nest 2 $ vcat (map content cs)+                              , text "</" <> qname n <> text ">"+                              ]++attributes [] = empty+attributes as@(_:_) = text " " <> fsep (map attribute as)  isText :: Content t -> Bool isText (CString _ _ _) = True
src/Text/XML/HaXml/XmlContent/Parser.hs view
@@ -224,12 +224,10 @@                  CRef (RefEntity s) _ -> text' (('&':s++";"):acc)                  CMisc _ _            -> text' acc                  CElem _ _         -> do { reparse [c] -- put it back!-                                         ; if null acc then fail "empty string"-                                           else return (concat (reverse acc))+                                         ; return (concat (reverse acc))                                          }              }-          `onFail` ( if null acc then fail "empty string"-                     else return (concat (reverse acc)) )+          `onFail` return (concat (reverse acc))   -- | 'choice f p' means if parseContents succeeds, apply f to the result,