allow () in more contexts
This commit is contained in:
parent
18cbd51600
commit
d4230e052d
1 changed files with 10 additions and 0 deletions
|
|
@ -77,7 +77,17 @@ macro `=>`*(p, b: expr): expr {.immediate.} =
|
||||||
identDefs.add(c)
|
identDefs.add(c)
|
||||||
identDefs.add(newEmptyNode())
|
identDefs.add(newEmptyNode())
|
||||||
identDefs.add(newEmptyNode())
|
identDefs.add(newEmptyNode())
|
||||||
|
of nnkInfix:
|
||||||
|
if c[0].kind == nnkIdent and c[0].ident == !"->":
|
||||||
|
var procTy = createProcType(c[1], c[2])
|
||||||
|
params[0] = procTy[0][0]
|
||||||
|
for i in 1 .. <procTy[0].len:
|
||||||
|
params.add(procTy[0][i])
|
||||||
else:
|
else:
|
||||||
|
error("Expected proc type (->) got (" & $c[0].ident & ").")
|
||||||
|
break
|
||||||
|
else:
|
||||||
|
echo treeRepr c
|
||||||
error("Incorrect procedure parameter list.")
|
error("Incorrect procedure parameter list.")
|
||||||
params.add(identDefs)
|
params.add(identDefs)
|
||||||
of nnkIdent:
|
of nnkIdent:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue