doc2 likes future.nim now
This commit is contained in:
parent
042ffed6c4
commit
a868575436
2 changed files with 4 additions and 6 deletions
|
|
@ -69,7 +69,7 @@ proc renderType(n: PNode): string =
|
||||||
for i in 1 .. <len(n): result.add(renderType(n[i]) & ',')
|
for i in 1 .. <len(n): result.add(renderType(n[i]) & ',')
|
||||||
result[<len(result)] = ']'
|
result[<len(result)] = ']'
|
||||||
else: result = ""
|
else: result = ""
|
||||||
assert (not result.isNil)
|
assert(not result.isNil)
|
||||||
|
|
||||||
|
|
||||||
proc renderParamTypes(found: var seq[string], n: PNode) =
|
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
|
let typePos = len(n) - 2
|
||||||
assert typePos > 0
|
assert typePos > 0
|
||||||
var typeStr = renderType(n[typePos])
|
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.
|
# Try with the last node, maybe its a default value.
|
||||||
assert n[typePos+1].kind != nkEmpty
|
|
||||||
let typ = n[typePos+1].typ
|
let typ = n[typePos+1].typ
|
||||||
if not typ.isNil: typeStr = typeToString(typ, preferExported)
|
if not typ.isNil: typeStr = typeToString(typ, preferExported)
|
||||||
if typeStr.len < 1:
|
if typeStr.len < 1: return
|
||||||
return
|
|
||||||
for i in 0 .. <typePos:
|
for i in 0 .. <typePos:
|
||||||
assert n[i].kind == nkIdent
|
assert n[i].kind == nkIdent
|
||||||
found.add(typeStr)
|
found.add(typeStr)
|
||||||
|
|
|
||||||
|
|
@ -115,4 +115,4 @@ macro `->`*(p, b: expr): expr {.immediate.} =
|
||||||
## proc pass2(f: proc (x, y: float): float): float =
|
## proc pass2(f: proc (x, y: float): float): float =
|
||||||
## f(2, 2)
|
## f(2, 2)
|
||||||
|
|
||||||
createProcType(p, b)
|
result = createProcType(p, b)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue