git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
C++: fix issues with brace initializers (shown with -Wall)
commit97de133936c887fd49e23d2e8b40c3a38e3881f8 authorAndy Arvanitis <andyarvanitis@gmail.com> dateMon 19 Dec 2016, 21:39 (10 years ago) parent4dddf7e
1 file changed+5−11
src/Language/PureScript/Pretty/Cpp.hs+5−11
src/Language/PureScript/Pretty/Cpp.hs+5−11
@@ -85,24 +85,18 @@ literals = mkPattern' match
8585 match (CppCharLiteral c) = return $ "'" <> T.singleton c <> "'"
8686 match (CppBooleanLiteral True) = return "true"
8787 match (CppBooleanLiteral False) = return "false"
88− match (CppArrayLiteral [x@CppArrayLiteral {}]) = -- Works around what appears to be a recent clang bug
89− mconcat <$> sequence
90− [ return $ runType arrayType
91− , return "{ { "
92− , prettyPrintCpp' x
93− , return " } }"
94− ]
88+ match (CppArrayLiteral []) = return $ runType arrayType <> "{}"
9589 match (CppArrayLiteral xs) = mconcat <$> sequence
9690 [ return $ runType arrayType
97− , return "{ "
91+ , return "{{ "
9892 , fmap (T.intercalate ", ") $ forM xs prettyPrintCpp'
99− , return " }"
93+ , return " }}"
10094 ]
10195 match (CppDataLiteral xs) = mconcat <$> sequence
10296 [ return $ runType (dataType $ length xs)
103− , return "{ "
97+ , return "{{ "
10498 , fmap (T.intercalate ", ") $ forM xs prettyPrintCpp'
105− , return " }"
99+ , return " }}"
106100 ]
107101 match (CppEnum name ty es) = mconcat <$> sequence
108102 [ return "enum"