@@ -21,6 +21,7 @@ module Data.Yaml.Builder
21import Data.Conduit
21import Data.Conduit
22import Data.ByteString (ByteString)
22import Data.ByteString (ByteString)
23import Text.Libyaml
23import Text.Libyaml
24+import Data.Yaml.Internal
24import Data.Text (Text)
25import Data.Text (Text)
25import Data.Scientific (Scientific)
26import Data.Scientific (Scientific)
26import Data.Aeson.Types (Value(..))
27import Data.Aeson.Types (Value(..))
@@ -85,23 +86,6 @@ string s =
85 -- See: https://github.com/snoyberg/yaml/issues/31
86 -- See: https://github.com/snoyberg/yaml/issues/31
86 | s `HashSet.member` specialStrings || isNumeric s = EventScalar (encodeUtf8 s) NoTag SingleQuoted Nothing
87 | s `HashSet.member` specialStrings || isNumeric s = EventScalar (encodeUtf8 s) NoTag SingleQuoted Nothing
87 | otherwise = EventScalar (encodeUtf8 s) StrTag PlainNoTag Nothing
88 | otherwise = EventScalar (encodeUtf8 s) StrTag PlainNoTag Nothing
89− -- | Strings which must be escaped so as not to be treated as non-string scalars.
90− specialStrings :: HashSet.HashSet Text
91− specialStrings = HashSet.fromList $ T.words
92− "y Y yes Yes YES n N no No NO true True TRUE false False FALSE on On ON off Off OFF null Null NULL ~"
94− isNumeric :: Text -> Bool
98− isNumeric' c = ('0' <= c && c <= '9')
106-- Use aeson's implementation which gets rid of annoying decimal points
90-- Use aeson's implementation which gets rid of annoying decimal points
107scientific :: Scientific -> YamlBuilder
91scientific :: Scientific -> YamlBuilder