Skip to content

Commit

Permalink
Get rid of tags for #31
Browse files Browse the repository at this point in the history
  • Loading branch information
snoyberg committed Oct 7, 2013
1 parent 2d71dd2 commit 0d1136e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Data/Yaml.hs
Expand Up @@ -129,7 +129,8 @@ objToEvents' (String s) rest =
where
event
-- Make sure that special strings are encoded as strings properly.
| s `HashSet.member` specialStrings = EventScalar (encodeUtf8 s) StrTag SingleQuoted Nothing
-- See: https://github.com/snoyberg/yaml/issues/31
| s `HashSet.member` specialStrings = EventScalar (encodeUtf8 s) NoTag SingleQuoted Nothing
| otherwise = EventScalar (encodeUtf8 s) StrTag PlainNoTag Nothing
objToEvents' Null rest = EventScalar "null" NullTag PlainNoTag Nothing : rest
objToEvents' (Bool True) rest = EventScalar "true" BoolTag PlainNoTag Nothing : rest
Expand Down
2 changes: 1 addition & 1 deletion test/main.hs
Expand Up @@ -121,7 +121,7 @@ main = hspec $ do
forM_ special $ \w -> it w $
let v = object ["word" .= w]
in D.decode (D.encode v) `shouldBe` Just v

it "no tags" $ D.encode (object ["word" .= ("true" :: String)]) `shouldBe` "word: 'true'\n"


specialStrings :: [T.Text]
Expand Down

0 comments on commit 0d1136e

Please sign in to comment.