Plan 9 from Bell Labs’s /usr/web/sources/contrib/fernan/nhc98/src/libraries/HaXml/bugs/patch-norback

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


--- ../HaXml-1.02/tools/DtdToTypeDefPP.hs	Wed May 30 14:21:31 2001
+++ tools/DtdToTypeDefPP.hs	Fri Jul 13 15:22:52 2001
@@ -298,7 +298,8 @@
              mkFrAux aux frattr cs $$
              text "fromElem rest = (Nothing, rest)"
            $$
-             vcat (map (mkToMult n topat toattr) cs)
+             if aux then vcat (map (mkToAux mixattrs) cs)
+             else vcat (map (mkToMult n topat toattr) cs)
            )
     $$
     mkInstanceAttrs Extended n fs
@@ -491,13 +492,13 @@
                   (Defined m) -> text "Just" <+> v
         in parens (hcat (intersperse comma (zipWith sp sts vs++[rest])))
 
---mkToAux :: Bool -> (Name,[StructType]) -> Doc
---mkToAux mixattrs (n,sts) =
---    let vs = nameSupply sts
---        attrs = if mixattrs then text "as" else empty
---    in
---    text "toElem" <+> parens (mkCpat n attrs vs) <+> text "=" <+>
---    mkToElem sts vs
+mkToAux :: Bool -> (Name,[StructType]) -> Doc
+mkToAux mixattrs (n,sts) =
+    let vs = nameSupply sts
+        attrs = if mixattrs then text "as" else empty
+    in
+    text "toElem" <+> parens (mkCpat n attrs vs) <+> text "=" <+>
+    mkToElem sts vs
 
 mkToMult :: Name -> Doc -> Doc -> (Name,[StructType]) -> Doc
 mkToMult tag attrpat attrexp (n,sts) =

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to webmaster@9p.io.