summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2014-08-31 02:46:13 +0200
committerAraq <rumpf_a@web.de>2014-08-31 02:46:13 +0200
commit8925d0e10335c8ae7671b7fb19f25a6f0a1802d3 (patch)
tree7baeefdabf7c3bdcceaa572a4127b6cdd8fc538f
parent31db3aeadefb73831b4fa27b1a1118acd5aa6134 (diff)
downloadNim-8925d0e10335c8ae7671b7fb19f25a6f0a1802d3.tar.gz
minor improvement for nim pretty
-rw-r--r--compiler/msgs.nim7
-rw-r--r--compiler/pretty.nim4
-rw-r--r--lib/system.nim1
-rw-r--r--todo.txt6
4 files changed, 13 insertions, 5 deletions
diff --git a/compiler/msgs.nim b/compiler/msgs.nim
index 58e12bfed..622c64359 100644
--- a/compiler/msgs.nim
+++ b/compiler/msgs.nim
@@ -124,7 +124,7 @@ type
     hintLineTooLong, hintXDeclaredButNotUsed, hintConvToBaseNotNeeded,
     hintConvFromXtoItselfNotNeeded, hintExprAlwaysX, hintQuitCalled,
     hintProcessing, hintCodeBegin, hintCodeEnd, hintConf, hintPath,
-    hintConditionAlwaysTrue, hintPattern,
+    hintConditionAlwaysTrue, hintName, hintPattern,
     hintUser
 
 const 
@@ -405,6 +405,7 @@ const
     hintConf: "used config file \'$1\' [Conf]", 
     hintPath: "added path: '$1' [Path]",
     hintConditionAlwaysTrue: "condition is always true: '$1' [CondTrue]",
+    hintName: "name should be: '$1' [Name]",
     hintPattern: "$1 [Pattern]",
     hintUser: "$1 [User]"]
 
@@ -420,10 +421,10 @@ const
     "ProveInit", "ProveField", "ProveIndex", "GcUnsafe", "GcUnsafe2", "Uninit",
     "GcMem", "User"]
 
-  HintsToStr*: array[0..15, string] = ["Success", "SuccessX", "LineTooLong", 
+  HintsToStr*: array[0..16, string] = ["Success", "SuccessX", "LineTooLong", 
     "XDeclaredButNotUsed", "ConvToBaseNotNeeded", "ConvFromXtoItselfNotNeeded", 
     "ExprAlwaysX", "QuitCalled", "Processing", "CodeBegin", "CodeEnd", "Conf", 
-    "Path", "CondTrue", "Pattern",
+    "Path", "CondTrue", "Name", "Pattern",
     "User"]
 
 const 
diff --git a/compiler/pretty.nim b/compiler/pretty.nim
index 356399c1c..321c19502 100644
--- a/compiler/pretty.nim
+++ b/compiler/pretty.nim
@@ -90,10 +90,10 @@ proc beautifyName(s: string, k: TSymKind): string =
       result.add s[i]
     inc i
 
-proc checkStyle*(info: TLineInfo, s: string, k: TSymKind) =
+proc checkStyle(info: TLineInfo, s: string, k: TSymKind) =
   let beau = beautifyName(s, k)
   if s != beau:
-    message(info, errGenerated, "name should be: " & beau)
+    message(info, hintName, beau)
 
 proc checkDef*(n: PNode; s: PSym) =
   # operators stay as they are:
diff --git a/lib/system.nim b/lib/system.nim
index 2ad5e6af9..0c483f4a9 100644
--- a/lib/system.nim
+++ b/lib/system.nim
@@ -192,6 +192,7 @@ proc high*[T](x: T): T {.magic: "High", noSideEffect.}
   ## returns the highest possible index of an array, a sequence, a string or
   ## the highest possible value of an ordinal value `x`. As a special
   ## semantic rule, `x` may also be a type identifier.
+  ## ``high(int)`` is Nim's way of writing `INT_MAX`:idx: or `MAX_INT`:idx:.
 
 proc low*[T](x: T): T {.magic: "Low", noSideEffect.}
   ## returns the lowest possible index of an array, a sequence, a string or
diff --git a/todo.txt b/todo.txt
index fef88efc2..319704925 100644
--- a/todo.txt
+++ b/todo.txt
@@ -1,3 +1,9 @@
+version 0.10
+============
+
+- Test nim pretty on various babel packages
+
+
 version 0.9.6
 =============