summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2016-07-19 19:28:01 +0200
committerAndreas Rumpf <rumpf_a@web.de>2016-07-19 19:28:01 +0200
commit9605435f2eea1e0be62170238023894d1eed29af (patch)
tree9560faa223e986f7acfa71cdd4654854c66b6c63 /compiler
parentdc4b2c920c9659bcd5691cd1e88140df3dc06330 (diff)
downloadNim-9605435f2eea1e0be62170238023894d1eed29af.tar.gz
get rid of deprecated toLower/toUpper
Diffstat (limited to 'compiler')
-rw-r--r--compiler/ccgtypes.nim5
-rw-r--r--compiler/ccgutils.nim2
-rw-r--r--compiler/nimfix/pretty.nim8
-rw-r--r--compiler/options.nim6
-rw-r--r--compiler/sem.nim2
-rw-r--r--compiler/semfold.nim4
-rw-r--r--compiler/semstmts.nim2
-rw-r--r--compiler/semtypes.nim2
8 files changed, 16 insertions, 15 deletions
diff --git a/compiler/ccgtypes.nim b/compiler/ccgtypes.nim
index 34a16c859..3d1c2affc 100644
--- a/compiler/ccgtypes.nim
+++ b/compiler/ccgtypes.nim
@@ -25,8 +25,9 @@ proc isKeyword(w: PIdent): bool =
 proc mangleField(name: PIdent): string =
   result = mangle(name.s)
   if isKeyword(name):
-    result[0] = result[0].toUpper # Mangling makes everything lowercase,
-                                  # but some identifiers are C keywords
+    result[0] = result[0].toUpperAscii
+    # Mangling makes everything lowercase,
+    # but some identifiers are C keywords
 
 proc hashOwner(s: PSym): FilenameHash =
   var m = s
diff --git a/compiler/ccgutils.nim b/compiler/ccgutils.nim
index 27b432c2c..ecd98a2bf 100644
--- a/compiler/ccgutils.nim
+++ b/compiler/ccgutils.nim
@@ -188,7 +188,7 @@ proc mangle*(name: string): string =
     let c = name[i]
     case c
     of 'A'..'Z':
-      add(result, c.toLower)
+      add(result, c.toLowerAscii)
     of '_':
       discard
     of 'a'..'z', '0'..'9':
diff --git a/compiler/nimfix/pretty.nim b/compiler/nimfix/pretty.nim
index 1123afb9e..8ba922927 100644
--- a/compiler/nimfix/pretty.nim
+++ b/compiler/nimfix/pretty.nim
@@ -66,7 +66,7 @@ proc beautifyName(s: string, k: TSymKind): string =
              ]:
       result.add s[i]
     else:
-      result.add toUpper(s[i])
+      result.add toUpperAscii(s[i])
   of skConst, skEnumField:
     # for 'const' we keep how it's spelt; either upper case or lower case:
     result.add s[0]
@@ -74,7 +74,7 @@ proc beautifyName(s: string, k: TSymKind): string =
     # as a special rule, don't transform 'L' to 'l'
     if s.len == 1 and s[0] == 'L': result.add 'L'
     elif '_' in s: result.add(s[i])
-    else: result.add toLower(s[0])
+    else: result.add toLowerAscii(s[0])
   inc i
   while i < s.len:
     if s[i] == '_':
@@ -85,9 +85,9 @@ proc beautifyName(s: string, k: TSymKind): string =
         result.add s[i]
       else:
         inc i
-        result.add toUpper(s[i])
+        result.add toUpperAscii(s[i])
     elif allUpper:
-      result.add toLower(s[i])
+      result.add toLowerAscii(s[i])
     else:
       result.add s[i]
     inc i
diff --git a/compiler/options.nim b/compiler/options.nim
index 03ae83587..dbd8ca2b9 100644
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -220,7 +220,7 @@ proc setDefaultLibpath*() =
       libpath = parentNimLibPath
 
 proc canonicalizePath*(path: string): string =
-  when not FileSystemCaseSensitive: result = path.expandFilename.toLower
+  when not FileSystemCaseSensitive: result = path.expandFilename.toLowerAscii
   else: result = path.expandFilename
 
 proc shortenDir*(dir: string): string =
@@ -340,11 +340,11 @@ proc findFile*(f: string): string {.procvar.} =
   else:
     result = f.rawFindFile
     if result.len == 0:
-      result = f.toLower.rawFindFile
+      result = f.toLowerAscii.rawFindFile
       if result.len == 0:
         result = f.rawFindFile2
         if result.len == 0:
-          result = f.toLower.rawFindFile2
+          result = f.toLowerAscii.rawFindFile2
   patchModule()
 
 proc findModule*(modulename, currentModule: string): string =
diff --git a/compiler/sem.nim b/compiler/sem.nim
index 717e3b7eb..7db4ae47e 100644
--- a/compiler/sem.nim
+++ b/compiler/sem.nim
@@ -164,7 +164,7 @@ proc newSymS(kind: TSymKind, n: PNode, c: PContext): PSym =
   result = newSym(kind, considerQuotedIdent(n), getCurrOwner(), n.info)
 
 proc newSymG*(kind: TSymKind, n: PNode, c: PContext): PSym =
-  proc `$`(kind: TSymKind): string = substr(system.`$`(kind), 2).toLower
+  proc `$`(kind: TSymKind): string = substr(system.`$`(kind), 2).toLowerAscii
 
   # like newSymS, but considers gensym'ed symbols
   if n.kind == nkSym:
diff --git a/compiler/semfold.nim b/compiler/semfold.nim
index 8e57ed0e2..e9ee50d74 100644
--- a/compiler/semfold.nim
+++ b/compiler/semfold.nim
@@ -635,8 +635,8 @@ proc getConstExpr(m: PSym, n: PNode): PNode =
       of mCompileDate: result = newStrNodeT(times.getDateStr(), n)
       of mCompileTime: result = newStrNodeT(times.getClockStr(), n)
       of mCpuEndian: result = newIntNodeT(ord(CPU[targetCPU].endian), n)
-      of mHostOS: result = newStrNodeT(toLower(platform.OS[targetOS].name), n)
-      of mHostCPU: result = newStrNodeT(platform.CPU[targetCPU].name.toLower, n)
+      of mHostOS: result = newStrNodeT(toLowerAscii(platform.OS[targetOS].name), n)
+      of mHostCPU: result = newStrNodeT(platform.CPU[targetCPU].name.toLowerAscii, n)
       of mAppType: result = getAppType(n)
       of mNaN: result = newFloatNodeT(NaN, n)
       of mInf: result = newFloatNodeT(Inf, n)
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 40462a1da..4c9191d12 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -454,7 +454,7 @@ proc semVarOrLet(c: PContext, n: PNode, symkind: TSymKind): PNode =
         typ = skipIntLit(def.typ)
         if hasEmpty(typ):
           localError(def.info, errCannotInferTypeOfTheLiteral,
-                     ($typ.kind).substr(2).toLower)
+                     ($typ.kind).substr(2).toLowerAscii)
     else:
       def = ast.emptyNode
       if symkind == skLet: localError(a.info, errLetNeedsInit)
diff --git a/compiler/semtypes.nim b/compiler/semtypes.nim
index bef104914..26ce28852 100644
--- a/compiler/semtypes.nim
+++ b/compiler/semtypes.nim
@@ -1038,7 +1038,7 @@ proc semGenericParamInInvocation(c: PContext, n: PNode): PType =
 proc semGeneric(c: PContext, n: PNode, s: PSym, prev: PType): PType =
   if s.typ == nil:
     localError(n.info, "cannot instantiate the '$1' $2" %
-                       [s.name.s, ($s.kind).substr(2).toLower])
+                       [s.name.s, ($s.kind).substr(2).toLowerAscii])
     return newOrPrevType(tyError, prev, c)
 
   var t = s.typ