git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: minor cleanup (map terminator)
commit35ee24bc8bfe4881b1f5bba50a001dfe0ba863ff authorAndy Arvanitis <andyarvanitis@gmail.com> dateWed 21 Dec 2016, 19:06 (10 years ago) parent204a493
1 file changed+3−2
src/Language/PureScript/Pretty/Cpp.hs+3−2
src/Language/PureScript/Pretty/Cpp.hs+3−2
@@ -109,13 +109,14 @@ literals = mkPattern' match
109109 match (CppMapLiteral _ ps) = mconcat <$> sequence
110110 [ return $ runType (mapType $ length ps + 1) <> "{{\n"
111111 , withIndent $ do
112+ let ps' = ps ++ [(CppVar "nullptr", CppVar "nullptr")]
112113 cpps <-
113− forM ps $ \(key, value) -> do
114+ forM ps' $ \(key, value) -> do
114115 value' <- prettyPrintCpp' value
115116 key' <- prettyPrintCpp' key
116117 return $ "{ " <> key' <> ", " <> value' <> " }"
117118 indentString <- currentIndent
118− return $ T.intercalate ", \n" $ map (indentString <>) (cpps ++ ["{ nullptr, nullptr }"])
119+ return $ T.intercalate ", \n" $ map (indentString <>) cpps
119120 , return "\n"
120121 , currentIndent
121122 , return "}}"