C++: handle two string literals bin ops
commita7a7763a7edca4808f7e49eefe8b92f5813fe90f
authorAndy Arvanitis <andyarvanitis@gmail.com>
dateFri 12 Aug 2016, 21:16 (10 years ago)
parent9f7c0db
src/Language/PureScript/Pretty/Cpp.hs+2
@@ -435,6 +435,8 @@ binary op str = AssocL match (\v1 v2 -> v1 ++ str ++ v2)
435435 match :: Pattern PrinterState Cpp (Cpp, Cpp)
436436 match = mkPattern match'
437437 where
438+ match' (CppBinary op' v1@(CppStringLiteral _) v2@(CppStringLiteral _))
439+ | op' == op = Just (CppApp (CppVar "std::string") [v1], v2)
438440 match' (CppBinary op' v1 v2) | op' == op = Just (v1, v2)
439441 match' _ = Nothing
440442