@@ -147,21 +147,24 @@ parse = do
147147 requireEvent EventStreamEnd
148148 return res
149149
150−parseScalar :: ByteString -> Anchor
150+parseScalar :: ByteString -> Anchor -> Style
151151 -> C.Sink Event Parse Text
152−parseScalar v a = do
152+parseScalar v a style = do
153153 let res = decodeUtf8With lenientDecode v
154154 case a of
155155 Nothing -> return res
156156 Just an -> do
157− lift $ modify (Map.insert an $ textToValue res)
157+ lift $ modify (Map.insert an $ textToValue style res)
158158 return res
159159
160−textToValue :: Text -> Value -- FIXME check for quoting style?
161−textToValue "true" = Bool True
162−textToValue "false" = Bool False
163−textToValue "null" = Null
164−textToValue t
160+textToValue :: Style -> Text -> Value
161+textToValue SingleQuoted t = String t
162+textToValue DoubleQuoted t = String t
163+textToValue Folded t = String t
164+textToValue _ "true" = Bool True
165+textToValue _ "false" = Bool False
166+textToValue _ "null" = Null
167+textToValue _ t
165168 | Right (x, "") <- signed decimal t = Number $ I x
166169 | Right (x, "") <- double t = Number $ D x
167170 | otherwise = String t
@@ -170,7 +173,7 @@ parseO :: C.Sink Event Parse Value
170173parseO = do
171174 me <- CL.head
172175 case me of
173− Just (EventScalar v _t _s a) -> fmap textToValue $ parseScalar v a
176+ Just (EventScalar v _t style a) -> fmap (textToValue style) $ parseScalar v a style
174177 Just (EventSequenceStart a) -> parseS a id
175178 Just (EventMappingStart a) -> parseM a M.empty
176179 Just (EventAlias an) -> do
@@ -215,7 +218,7 @@ parseM a front = do
215218 _ -> do
216219 CL.drop 1
217220 s <- case me of
218− Just (EventScalar v _ _ a') -> parseScalar v a'
221+ Just (EventScalar v _ style a') -> parseScalar v a' style
219222 _ -> liftIO $ throwIO $ UnexpectedEvent me Nothing
220223 o <- parseO
221224