cleanup of in/out covariance handling

This commit is contained in:
Andreas Rumpf 2017-05-17 20:54:53 +02:00
commit 7a95c961a7
6 changed files with 32 additions and 37 deletions

View file

@ -1521,9 +1521,9 @@ proc parseGenericParam(p: var TParser): PNode =
while true:
case p.tok.tokType
of tkIn, tkOut:
let kind = if p.tok.tokType == tkIn: nkInTy
else: nkOutTy
a = newNodeP(kind, p)
let x = p.lex.cache.getIdent(if p.tok.tokType == tkIn: "in" else: "out")
a = newNodeP(nkPrefix, p)
a.addSon newIdentNodeP(x, p)
getTok(p)
expectIdent(p)
a.addSon(parseSymbol(p))