minor improvement for nim pretty

This commit is contained in:
Araq
2014-08-31 02:46:13 +02:00
parent 31db3aeade
commit 8925d0e103
4 changed files with 13 additions and 5 deletions

View File

@@ -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

View File

@@ -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:

View File

@@ -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

View File

@@ -1,3 +1,9 @@
version 0.10
============
- Test nim pretty on various babel packages
version 0.9.6
=============