on master help sign in
Generate simpler names with showCG
aa8ab8fEdwin Brady
src/Core/TT.hs+1−1
@@ -244,7 +244,7 @@ showCG (MN _ "underscore") = "_"
244showCG (MN i s) = "{" ++ s ++ show i ++ "}"
244showCG (MN i s) = "{" ++ s ++ show i ++ "}"
245showCG (SN s) = showCG' s
245showCG (SN s) = showCG' s
246 where showCG' (WhereN i p c) = show p ++ ":" ++ show c ++ ":" ++ show i
246 where showCG' (WhereN i p c) = show p ++ ":" ++ show c ++ ":" ++ show i
247− showCG' (InstanceN cl inst) = '@':show cl ++ '$':show inst
247+ showCG' (InstanceN cl inst) = '@':show cl ++ '$':showSep ":" inst
248 showCG' (MethodN m) = '!':show m
248 showCG' (MethodN m) = '!':show m
249 showCG' (ParentN p c) = show p ++ "#" ++ show c
249 showCG' (ParentN p c) = show p ++ "#" ++ show c
250 showCG' (CaseN c) = show c ++ "_case"
250 showCG' (CaseN c) = show c ++ "_case"
src/IRTS/Java/Mangling.hs+3
@@ -83,6 +83,9 @@ mangleWithPrefix prefix (UN name) =
83 | x == ']' = "_RSBrace" ++ cleanNonLetter xs
83 | x == ']' = "_RSBrace" ++ cleanNonLetter xs
84 | x == '(' = "_LBrace" ++ cleanNonLetter xs
84 | x == '(' = "_LBrace" ++ cleanNonLetter xs
85 | x == ')' = "_RBrace" ++ cleanNonLetter xs
85 | x == ')' = "_RBrace" ++ cleanNonLetter xs
86+ | x == ':' = "_Colon" ++ cleanNonLetter xs
87+ | x == ' ' = "_Space" ++ cleanNonLetter xs
88+ | x == ',' = "_Comma" ++ cleanNonLetter xs
86 | x == '_' = "__" ++ cleanNonLetter xs
89 | x == '_' = "__" ++ cleanNonLetter xs
87 | not (isAlphaNum x) = "_" ++ (show $ ord x) ++ xs
90 | not (isAlphaNum x) = "_" ++ (show $ ord x) ++ xs
88 | otherwise = x:cleanNonLetter xs
91 | otherwise = x:cleanNonLetter xs