summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorAraq <rumpf_a@web.de>2011-06-19 16:13:31 +0200
committerAraq <rumpf_a@web.de>2011-06-19 16:13:31 +0200
commitd608e4d11589c7edcace93b731984b67cb26e2d1 (patch)
tree5c4155eef8da31abe1c4dfdb5e7c8c227af89cce /compiler
parent898e5c3d2c060b7f7b320a7ee7c602c872a06c1f (diff)
downloadNim-d608e4d11589c7edcace93b731984b67cb26e2d1.tar.gz
bugfix: empty object case branches produce an error
Diffstat (limited to 'compiler')
-rwxr-xr-xcompiler/parser.nim6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/parser.nim b/compiler/parser.nim
index 4b7ba97ad..677aa57ba 100755
--- a/compiler/parser.nim
+++ b/compiler/parser.nim
@@ -1177,7 +1177,11 @@ proc parseObjectCase(p: var TParser): PNode =
       eat(p, tkColon)
     else: break 
     skipComment(p, b)
-    addSon(b, parseObjectPart(p))
+    var fields = parseObjectPart(p)
+    if fields.kind == nkEmpty:
+      parMessage(p, errIdentifierExpected, p.tok)
+      fields = newNodeP(nkNilLit, p) # don't break further semantic checking
+    addSon(b, fields)
     addSon(result, b)
     if b.kind == nkElse: break