bugfix: empty object case branches produce an error
This commit is contained in:
parent
898e5c3d2c
commit
d608e4d115
2 changed files with 5 additions and 2 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue