diff options
author | Araq <rumpf_a@web.de> | 2017-09-30 18:16:09 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2017-09-30 18:32:44 +0200 |
commit | 3ccc9c467d84dc8c3412acbea20fc10b5335eaa8 (patch) | |
tree | a397e4c0e3b6de4a89a7f71bf7168c166f53c235 /compiler/pbraces.nim | |
parent | 5cf789ac3fffeb895af3c43c0348c537af00c12e (diff) | |
download | Nim-3ccc9c467d84dc8c3412acbea20fc10b5335eaa8.tar.gz |
'with' and 'without' are not keywords anymore
Diffstat (limited to 'compiler/pbraces.nim')
-rw-r--r-- | compiler/pbraces.nim | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/compiler/pbraces.nim b/compiler/pbraces.nim index fa4ccc139..eba6f0b62 100644 --- a/compiler/pbraces.nim +++ b/compiler/pbraces.nim @@ -906,9 +906,14 @@ 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: + 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 |