'nil' as a statement is deprecated, use an empty 'discard' instead

This commit is contained in:
Araq 2014-01-19 16:54:59 +01:00
commit 73c6efdf66
54 changed files with 170 additions and 170 deletions

View file

@ -73,7 +73,7 @@ proc initGeneralTokenizer*(g: var TGeneralTokenizer, buf: string) =
g.pos = pos
proc deinitGeneralTokenizer*(g: var TGeneralTokenizer) =
nil
discard
proc nimGetKeyword(id: string): TTokenClass =
for k in nimrodKeywords:
@ -102,7 +102,7 @@ proc nimNumberPostfix(g: var TGeneralTokenizer, position: int): int =
if g.buf[pos] in {'0'..'9'}: inc(pos)
if g.buf[pos] in {'0'..'9'}: inc(pos)
else:
nil
discard
result = pos
proc nimNumber(g: var TGeneralTokenizer, position: int): int =

View file

@ -535,7 +535,7 @@ proc match(p: TRstParser, start: int, expr: string): bool =
case p.tok[j].symbol[0]
of 'a'..'z', 'A'..'Z': result = len(p.tok[j].symbol) == 1
of '0'..'9': result = allCharsInSet(p.tok[j].symbol, {'0'..'9'})
else: nil
else: discard
else:
var c = expr[i]
var length = 0
@ -640,7 +640,7 @@ proc parseUrl(p: var TRstParser, father: PRstNode) =
var n = newRstNode(rnStandaloneHyperlink)
while true:
case p.tok[p.idx].kind
of tkWord, tkAdornment, tkOther: nil
of tkWord, tkAdornment, tkOther: discard
of tkPunct:
if p.tok[p.idx+1].kind notin {tkWord, tkAdornment, tkOther, tkPunct}:
break
@ -806,7 +806,7 @@ proc parseInline(p: var TRstParser, father: PRstNode) =
return
add(father, newLeaf(p))
inc(p.idx)
else: nil
else: discard
proc getDirective(p: var TRstParser): string =
if p.tok[p.idx].kind == tkWhite and p.tok[p.idx+1].kind == tkWord:
@ -1339,7 +1339,7 @@ proc parseSection(p: var TRstParser, result: PRstNode) =
of rnDirective: a = parseDotDot(p)
of rnEnumList: a = parseEnumList(p)
of rnLeaf: rstMessage(p, meNewSectionExpected)
of rnParagraph: nil
of rnParagraph: discard
of rnDefList: a = parseDefinitionList(p)
of rnFieldList:
if p.idx > 0: dec(p.idx)
@ -1351,7 +1351,7 @@ proc parseSection(p: var TRstParser, result: PRstNode) =
of rnOptionList: a = parseOptionList(p)
else:
#InternalError("rst.parseSection()")
nil
discard
if a == nil and k != rnDirective:
a = newRstNode(rnParagraph)
parseParagraph(p, a)
@ -1624,7 +1624,7 @@ proc resolveSubs(p: var TRstParser, n: PRstNode): PRstNode =
add(result, n)
add(result, y)
of rnLeaf:
nil
discard
of rnContents:
p.hasToc = true
else:

View file

@ -165,7 +165,7 @@ proc nextSplitPoint*(s: string, start: int): int =
of 'a'..'z':
if result + 1 < len(s) + 0:
if s[result + 1] in {'A'..'Z'}: return
else: nil
else: discard
inc(result)
dec(result) # last valid index