summary refs log tree commit diff stats
path: root/compiler/pbraces.nim
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2017-09-30 18:16:09 +0200
committerAraq <rumpf_a@web.de>2017-09-30 18:32:44 +0200
commit3ccc9c467d84dc8c3412acbea20fc10b5335eaa8 (patch)
treea397e4c0e3b6de4a89a7f71bf7168c166f53c235 /compiler/pbraces.nim
parent5cf789ac3fffeb895af3c43c0348c537af00c12e (diff)
downloadNim-3ccc9c467d84dc8c3412acbea20fc10b5335eaa8.tar.gz
'with' and 'without' are not keywords anymore
Diffstat (limited to 'compiler/pbraces.nim')
-rw-r--r--compiler/pbraces.nim11
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