'with' and 'without' are not keywords anymore

This commit is contained in:
Araq 2017-09-30 18:16:09 +02:00
commit 3ccc9c467d
7 changed files with 26 additions and 15 deletions

View file

@ -1038,9 +1038,15 @@ proc parseTypeDescKAux(p: var TParser, kind: TNodeKind,
optInd(p, result)
if not isOperator(p.tok) and isExprStart(p):
addSon(result, primary(p, mode))
if kind == nkDistinctTy and p.tok.tokType in {tkWith, tkWithout}:
let nodeKind = if p.tok.tokType == tkWith: nkWith
else: nkWithout
if kind == nkDistinctTy and p.tok.tokType == tkSymbol:
# XXX document this feature!
var nodeKind: TNodeKind
if p.tok.ident.s == "with":
nodeKind = nkWith
elif p.tok.ident.s == "without":
nodeKind = nkWithout
else:
return result
getTok(p)
let list = newNodeP(nodeKind, p)
result.addSon list