parent
28da04c1f7
commit
6f6e6fe4eb
2 changed files with 14 additions and 1 deletions
|
|
@ -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, "(")
|
||||
|
|
|
|||
13
tests/macros/tgenericparams.nim
Normal file
13
tests/macros/tgenericparams.nim
Normal 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()
|
||||
Loading…
Add table
Add a link
Reference in a new issue