Param name and type combos now work in type sig. sugar.
This commit is contained in:
parent
57cc8237f7
commit
dad99376a5
2 changed files with 13 additions and 6 deletions
|
|
@ -26,8 +26,15 @@ proc createProcType(p, b: PNimrodNode): PNimrodNode {.compileTime.} =
|
|||
for i in 0 .. <p.len:
|
||||
let ident = p[i]
|
||||
var identDefs = newNimNode(nnkIdentDefs)
|
||||
identDefs.add newIdentNode("i" & $i)
|
||||
identDefs.add(ident)
|
||||
case ident.kind
|
||||
of nnkExprColonExpr:
|
||||
identDefs.add ident[0]
|
||||
identDefs.add ident[1]
|
||||
of nnkIdent:
|
||||
identDefs.add newIdentNode("i" & $i)
|
||||
identDefs.add(ident)
|
||||
else:
|
||||
error("Incorrect type list in proc type declaration.")
|
||||
identDefs.add newEmptyNode()
|
||||
formalParams.add identDefs
|
||||
of nnkIdent:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue