packages feed

xcb-types 0.14.0 → 0.15.0

raw patch · 4 files changed

+22/−13 lines, 4 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

- Data.XCB.Pretty: bitCaseHeader :: Pretty a => Maybe Name -> Expression a -> Doc
+ Data.XCB.Pretty: bitCaseHeader :: Pretty a => Maybe Name -> [Expression a] -> Doc
- Data.XCB.Types: BitCase :: Maybe Name -> Expression typ -> Maybe Alignment -> [GenStructElem typ] -> GenBitCase typ
+ Data.XCB.Types: BitCase :: Maybe Name -> [Expression typ] -> Maybe Alignment -> [GenStructElem typ] -> GenBitCase typ

Files

Data/XCB/FromXML.hs view
@@ -414,11 +414,11 @@ bitCase :: (MonadFail m, MonadPlus m, Functor m) => Element -> m BitCase bitCase el | el `named` "bitcase" || el `named` "case" = do               let mName = el `attr` "name"-              (exprEl, fieldEls) <- unconsChildren el-              expr <- expression exprEl+              let (exprEls, fieldEls) = takeEnumrefs $ elChildren el+              exprs <- mapM expression exprEls               (alignment, xs) <- extractAlignment $ fieldEls               fields <- mapM structField xs-              return $ BitCase mName expr alignment fields+              return $ BitCase mName exprs alignment fields            | otherwise =               let name = elName el               in error $ "Invalid bitCase: " ++ show name@@ -488,6 +488,12 @@     = case elChildren el of         (x:xs) -> return (x,xs)         _ -> mzero++takeEnumrefs :: [Element] -> ([Element], [Element])+takeEnumrefs [] = ([], [])+takeEnumrefs (x:xs) =+    let (ys, zs) = takeEnumrefs xs+    in if x `named` "enumref" then (x:ys, zs) else (ys, x:zs)  listToM :: MonadPlus m => [a] -> m a listToM [] = mzero
Data/XCB/Pretty.hs view
@@ -158,18 +158,18 @@   instance Pretty a => Pretty (GenBitCase a) where-    toDoc (BitCase name expr alignment fields)+    toDoc (BitCase name exprs alignment fields)         = vcat-           [ bitCaseHeader name expr+           [ bitCaseHeader name exprs            , toDoc alignment            , braces (vcat (map toDoc fields))            ] -bitCaseHeader :: Pretty a => Maybe Name -> Expression a -> Doc-bitCaseHeader Nothing expr =-    text "bitcase" <> parens (toDoc expr)-bitCaseHeader (Just name) expr =-    text "bitcase" <> parens (toDoc expr) <> brackets (text name)+bitCaseHeader :: Pretty a => Maybe Name -> [Expression a] -> Doc+bitCaseHeader Nothing exprs =+    text "bitcase" <> parens (hcat (map toDoc exprs))+bitCaseHeader (Just name) exprs =+    text "bitcase" <> parens (hcat (map toDoc exprs)) <> brackets (text name)  instance Pretty Alignment where     toDoc (Alignment align offset) = text "alignment" <+>
Data/XCB/Types.hs view
@@ -112,7 +112,10 @@  deriving (Show, Functor)  data GenBitCase typ-    = BitCase (Maybe Name) (Expression typ) (Maybe Alignment) [GenStructElem typ]+    -- All requests with the exception of GetKbdByName seem to have exactly 1+    -- expression value, but GetKbdByNameReply has multiple, see xcbproto+    -- commit b3b5e029e7ad ("XKB: Fix GetKbdByName") for details.+    = BitCase (Maybe Name) [Expression typ] (Maybe Alignment) [GenStructElem typ]  deriving (Show, Functor)  type EnumVals typ = typ
xcb-types.cabal view
@@ -1,5 +1,5 @@ Name:         xcb-types-Version:      0.14.0+Version:      0.15.0 Cabal-Version:  >= 1.10 Synopsis:     Parses XML files used by the XCB project Description:   This package provides types which mirror the structures@@ -17,7 +17,7 @@   to learn XSLT, this package should help.   .   This version of xcb-types is intended to fully parse the X Protocol-  description version 1.16.+  description version 1.17.  License:      BSD3 License-file: LICENSE