on master help sign in
Version bump (0.0.1) and compiles without warnings
commitdd7204b797505930d6b500ebd2dd97a082299aa1 authorMichael Snoyman <michael@snoyman.com> dateSun 10 Jan 2010, 19:31 (17 years ago) parent0953e29
2 files changed+9−5
Data/Object/Yaml/Lib.hs+8−4 data-object-yaml.cabal+1−1
Data/Object/Yaml/Lib.hs+8−4
@@ -4,8 +4,6 @@
44{-# LANGUAGE FlexibleContexts #-}
55{-# LANGUAGE MultiParamTypeClasses #-}
66
7−{-# INCLUDE <yaml.h> #-}
8−{-# INCLUDE <helper.h> #-}
97module Data.Object.Yaml.Lib
108 ( withEmitter
119 , emitEvents
@@ -29,7 +27,8 @@ import Data.Convertible.Text
2927import Control.Applicative
3028
3129import Data.Object.Yaml.Internal
32−import Control.Exception (throwIO)
30+import Control.Exception (throwIO, Exception)
31+import Data.Typeable (Typeable)
3332
3433data ParserStruct
3534type Parser = Ptr ParserStruct
@@ -327,7 +326,7 @@ foreign import ccall unsafe "yaml_mapping_end_event_initialize"
327326
328327toEventRaw :: Event -> (EventRaw -> IO a) -> IO a
329328toEventRaw e f = withEventRaw $ \er -> do
330− case e of
329+ ret <- case e of
331330 EventStreamStart ->
332331 c_yaml_stream_start_event_initialize
333332 er
@@ -380,8 +379,13 @@ toEventRaw e f = withEventRaw $ \er -> do
380379 c_yaml_mapping_end_event_initialize er
381380 EventAlias -> error "toEventRaw: EventAlias not supported"
382381 EventNone -> error "toEventRaw: EventNone not supported"
382+ unless (ret == 1) $ failure $ ToEventRawException ret
383383 f er
384384
385+newtype ToEventRawException = ToEventRawException CInt
386+ deriving (Show, Typeable)
387+instance Exception ToEventRawException
388+
385389encode :: MonadFailure YamlException m
386390 => [Event]
387391 -> IO (m B.ByteString)
data-object-yaml.cabal+1−1
@@ -1,5 +1,5 @@
11name: data-object-yaml
2−version: 0.0.0
2+version: 0.0.1
33license: BSD3
44license-file: LICENSE
55author: Michael Snoyman <michael@snoyman.com>