git.iko.soy/rowtype-yoga/purescript-native
on golang help sign in
Merge pull request #151 from puffnfresh/name-mangling

Use pretty name mangling, e.g. '~' becomes "$tilde"

commit9ab0ff290cb53401b6ee33f94bc68cf1967ac388 authorPhil Freeman <paf31@cantab.net> dateFri 31 Jan 2014, 10:15 (13 years ago) parent24679fb65dbca5
1 file changed+18
src/Language/PureScript/Pretty/Common.hs+18
src/Language/PureScript/Pretty/Common.hs+18
@@ -40,6 +40,24 @@ identToJs (Op op) = concatMap identCharToString op
4040identCharToString :: Char -> String
4141identCharToString c | isAlphaNum c = [c]
4242identCharToString '_' = "_"
43+identCharToString '~' = "$tilde"
44+identCharToString '=' = "$eq"
45+identCharToString '<' = "$less"
46+identCharToString '>' = "$greater"
47+identCharToString '!' = "$bang"
48+identCharToString '#' = "$hash"
49+identCharToString '%' = "$percent"
50+identCharToString '^' = "$up"
51+identCharToString '&' = "$amp"
52+identCharToString '|' = "$bar"
53+identCharToString '*' = "$times"
54+identCharToString '/' = "$div"
55+identCharToString '+' = "$plus"
56+identCharToString '-' = "$minus"
57+identCharToString ':' = "$colon"
58+identCharToString '\\' = "$bslash"
59+identCharToString '?' = "$qmark"
60+identCharToString '@' = "$at"
4361identCharToString c = '$' : show (ord c)
4462
4563-- |