This commit is contained in:
BigEpsilon
2017-08-30 14:44:11 +02:00
committed by Andreas Rumpf
parent 28da04c1f7
commit 6f6e6fe4eb
2 changed files with 14 additions and 1 deletions

View File

@@ -1327,7 +1327,7 @@ proc gsub(g: var TSrcGen, n: PNode, c: TContext) =
if n.hasExplicitParams:
put(g, tkBracketLe, "[")
gcomma(g, n)
gsemicolon(g, n)
put(g, tkBracketRi, "]")
of nkFormalParams:
put(g, tkParLe, "(")

View File

@@ -0,0 +1,13 @@
discard """
output: '''proc foo[T, N: static[int]]()
proc foo[T; N: static[int]]()'''
"""
import macros
macro test():string =
let expr0 = "proc foo[T, N: static[int]]()"
let expr1 = "proc foo[T; N: static[int]]()"
$toStrLit(parseExpr(expr0)) & "\n" & $toStrLit(parseExpr(expr1))
echo test()