doc2 likes future.nim now

This commit is contained in:
Araq
2014-04-21 02:45:57 +02:00
parent 042ffed6c4
commit a868575436
2 changed files with 4 additions and 6 deletions

View File

@@ -69,7 +69,7 @@ proc renderType(n: PNode): string =
for i in 1 .. <len(n): result.add(renderType(n[i]) & ',')
result[<len(result)] = ']'
else: result = ""
assert (not result.isNil)
assert(not result.isNil)
proc renderParamTypes(found: var seq[string], n: PNode) =
@@ -86,13 +86,11 @@ proc renderParamTypes(found: var seq[string], n: PNode) =
let typePos = len(n) - 2
assert typePos > 0
var typeStr = renderType(n[typePos])
if typeStr.len < 1:
if typeStr.len < 1 and n[typePos+1].kind != nkEmpty:
# Try with the last node, maybe its a default value.
assert n[typePos+1].kind != nkEmpty
let typ = n[typePos+1].typ
if not typ.isNil: typeStr = typeToString(typ, preferExported)
if typeStr.len < 1:
return
if typeStr.len < 1: return
for i in 0 .. <typePos:
assert n[i].kind == nkIdent
found.add(typeStr)

View File

@@ -115,4 +115,4 @@ macro `->`*(p, b: expr): expr {.immediate.} =
## proc pass2(f: proc (x, y: float): float): float =
## f(2, 2)
createProcType(p, b)
result = createProcType(p, b)