@@ -76,7 +76,8 @@ literals = mkPattern' match
7676 , withIndent $ do
7777 cpps <- forM ps $ \(key, value) -> do
7878 val <- prettyPrintCpp' value
79− return $ "{ KEY" ++ parens(show key) ++ ", " ++ val ++ " }"
79+ k <- prettyPrintCpp' (CppStringLiteral key)
80+ return $ "{ " ++ k ++ ", " ++ val ++ " }"
8081 indentString <- currentIndent
8182 return $ intercalate ", \n" $ map (indentString ++) cpps
8283 , return "\n"
@@ -257,7 +258,7 @@ string s = '"' : concatMap encodeChar (decodeSurrogates s) ++ "\""
257258 where
258259 decodeSurrogates :: String -> String
259260 decodeSurrogates [c] = [c]
260− decodeSurrogates s = catMaybes $ zipWith decodePair s (tail s ++ ['\0'])
261+ decodeSurrogates s' = catMaybes $ zipWith decodePair s' (tail s' ++ ['\0'])
261262 where
262263 decodePair :: Char -> Char -> Maybe Char
263264 decodePair a b
@@ -295,8 +296,8 @@ accessor = mkPattern match
295296indexer :: Pattern PrinterState Cpp (String, Cpp)
296297indexer = mkPattern' match
297298 where
298− match (CppIndexer index@(CppNumericLiteral {}) val) = (,) <$> prettyPrintCpp' index <*> pure val
299− match (CppIndexer (CppStringLiteral index) val) = return ("KEY" ++ parens (show index), val)
299+ match (CppIndexer (CppNumericLiteral (Left index)) val) = return (show index ++ "UL", val)
300+ match (CppIndexer index val) = (,) <$> prettyPrintCpp' index <*> pure val
300301 match _ = mzero
301302
302303lam :: Pattern PrinterState Cpp ((String, [(String, Maybe CppType)], Maybe CppType), Cpp)