'with' and 'without' are not keywords anymore
This commit is contained in:
parent
5cf789ac3f
commit
3ccc9c467d
7 changed files with 26 additions and 15 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue