mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-19 22:10:33 +00:00
committed by
Andreas Rumpf
parent
28da04c1f7
commit
6f6e6fe4eb
@@ -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()
|
||||
Reference in New Issue
Block a user