@@ -76,7 +76,8 @@ literals = mkPattern' match
76 , withIndent $ do
76 , withIndent $ do
77 cpps <- forM ps $ \(key, value) -> do
77 cpps <- forM ps $ \(key, value) -> do
78 val <- prettyPrintCpp' value
78 val <- prettyPrintCpp' value
79− return $ "{ KEY" ++ parens(show key) ++ ", " ++ val ++ " }"
79+ k <- prettyPrintCpp' (CppStringLiteral key)
80+ return $ "{ " ++ k ++ ", " ++ val ++ " }"
80 indentString <- currentIndent
81 indentString <- currentIndent
81 return $ intercalate ", \n" $ map (indentString ++) cpps
82 return $ intercalate ", \n" $ map (indentString ++) cpps
82 , return "\n"
83 , return "\n"
@@ -257,7 +258,7 @@ string s = '"' : concatMap encodeChar (decodeSurrogates s) ++ "\""
258 decodeSurrogates :: String -> String
259 decodeSurrogates :: String -> String
259 decodeSurrogates [c] = [c]
260 decodeSurrogates [c] = [c]
260− decodeSurrogates s = catMaybes $ zipWith decodePair s (tail s ++ ['\0'])
261+ decodeSurrogates s' = catMaybes $ zipWith decodePair s' (tail s' ++ ['\0'])
262 decodePair :: Char -> Char -> Maybe Char
263 decodePair :: Char -> Char -> Maybe Char
263 decodePair a b
264 decodePair a b
@@ -295,8 +296,8 @@ accessor = mkPattern match
295indexer :: Pattern PrinterState Cpp (String, Cpp)
296indexer :: Pattern PrinterState Cpp (String, Cpp)
296indexer = mkPattern' match
297indexer = mkPattern' match
299+ match (CppIndexer (CppNumericLiteral (Left index)) val) = return (show index ++ "UL", val)
298− match (CppIndexer index@(CppNumericLiteral {}) val) = (,) <$> prettyPrintCpp' index <*> pure val
300+ match (CppIndexer index val) = (,) <$> prettyPrintCpp' index <*> pure val
299− match (CppIndexer (CppStringLiteral index) val) = return ("KEY" ++ parens (show index), val)
300 match _ = mzero
301 match _ = mzero
302lam :: Pattern PrinterState Cpp ((String, [(String, Maybe CppType)], Maybe CppType), Cpp)
303lam :: Pattern PrinterState Cpp ((String, [(String, Maybe CppType)], Maybe CppType), Cpp)