on master help sign in
Generate simpler names with showCG
commitaa8ab8f87016d03ca2eba6a758da5107370aa300 authorEdwin Brady <ecb10@st-andrews.ac.uk> dateWed 11 Sep 2013, 11:09 (13 years ago) parent3d80dae
2 files changed+4−1
src/Core/TT.hs+1−1 src/IRTS/Java/Mangling.hs+3
src/Core/TT.hs+1−1
@@ -244,7 +244,7 @@ showCG (MN _ "underscore") = "_"
244244showCG (MN i s) = "{" ++ s ++ show i ++ "}"
245245showCG (SN s) = showCG' s
246246 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
248248 showCG' (MethodN m) = '!':show m
249249 showCG' (ParentN p c) = show p ++ "#" ++ show c
250250 showCG' (CaseN c) = show c ++ "_case"
src/IRTS/Java/Mangling.hs+3
@@ -83,6 +83,9 @@ mangleWithPrefix prefix (UN name) =
8383 | x == ']' = "_RSBrace" ++ cleanNonLetter xs
8484 | x == '(' = "_LBrace" ++ cleanNonLetter xs
8585 | x == ')' = "_RBrace" ++ cleanNonLetter xs
86+ | x == ':' = "_Colon" ++ cleanNonLetter xs
87+ | x == ' ' = "_Space" ++ cleanNonLetter xs
88+ | x == ',' = "_Comma" ++ cleanNonLetter xs
8689 | x == '_' = "__" ++ cleanNonLetter xs
8790 | not (isAlphaNum x) = "_" ++ (show $ ord x) ++ xs
8891 | otherwise = x:cleanNonLetter xs