support for external types with covariant generic params
This commit is contained in:
parent
2a34552596
commit
5e368f3639
8 changed files with 62 additions and 3 deletions
|
|
@ -1523,6 +1523,13 @@ proc parseGenericParam(p: var TParser): PNode =
|
|||
# progress guaranteed
|
||||
while true:
|
||||
case p.tok.tokType
|
||||
of tkIn, tkOut:
|
||||
let kind = if p.tok.tokType == tkIn: nkInTy
|
||||
else: nkOutTy
|
||||
a = newNodeP(kind, p)
|
||||
getTok(p)
|
||||
expectIdent(p)
|
||||
a.addSon(parseSymbol(p))
|
||||
of tkSymbol, tkAccent:
|
||||
a = parseSymbol(p)
|
||||
if a.kind == nkEmpty: return
|
||||
|
|
@ -1551,7 +1558,7 @@ proc parseGenericParamList(p: var TParser): PNode =
|
|||
getTok(p)
|
||||
optInd(p, result)
|
||||
# progress guaranteed
|
||||
while p.tok.tokType in {tkSymbol, tkAccent}:
|
||||
while p.tok.tokType in {tkSymbol, tkAccent, tkIn, tkOut}:
|
||||
var a = parseGenericParam(p)
|
||||
addSon(result, a)
|
||||
if p.tok.tokType notin {tkComma, tkSemiColon}: break
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue