summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2013-10-01 08:44:09 +0200
committerAraq <rumpf_a@web.de>2013-10-01 08:44:09 +0200
commit1a792d46d0bdcdf16fa928a45aca65afbde7921d (patch)
tree9c4ce85abb43c0142d3fb3456dd8a6f34cf7ef6d /compiler
parent7a2fad1e35d7f0c53cfb779240804a794a161e07 (diff)
downloadNim-1a792d46d0bdcdf16fa928a45aca65afbde7921d.tar.gz
first version of the debug GC; doesn't work yet
Diffstat (limited to 'compiler')
-rw-r--r--compiler/pretty.nim12
1 files changed, 11 insertions, 1 deletions
diff --git a/compiler/pretty.nim b/compiler/pretty.nim
index 4545e1c55..5036a16a3 100644
--- a/compiler/pretty.nim
+++ b/compiler/pretty.nim
@@ -55,6 +55,10 @@ proc overwriteFiles*() =
     except EIO:
       rawMessage(errCannotOpenFile, newFile)
 
+proc `=~`(s: string, a: openArray[string]): bool =
+  for x in a:
+    if s.startsWith(x): return true
+
 proc beautifyName(s: string, k: TSymKind): string =
   result = newStringOfCap(s.len)
   var i = 0
@@ -64,7 +68,13 @@ proc beautifyName(s: string, k: TSymKind): string =
     when removeTP:
       if s[0] == 'T' and s[1] in {'A'..'Z'}:
         i = 1
-    result.add toUpper(s[i])
+    if s =~ ["int", "uint", "cint", "cuint", "clong", "cstring", "string",
+             "char", "byte", "bool", "openArray", "seq", "array", "void",
+             "pointer", "float", "csize", "cdouble", "cchar", "cschar",
+             "cshort", "cu"]:
+      result.add s[i]
+    else:
+      result.add toUpper(s[i])
   of skConst, skEnumField:
     # for 'const' we keep how it's spelt; either upper case or lower case:
     result.add s[0]