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)
|
eat(p, tkColon)
|
||||||
else: break
|
else: break
|
||||||
skipComment(p, b)
|
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)
|
addSon(result, b)
|
||||||
if b.kind == nkElse: break
|
if b.kind == nkElse: break
|
||||||
|
|
||||||
|
|
|
||||||
1
todo.txt
1
todo.txt
|
|
@ -23,7 +23,6 @@ version 0.9.0
|
||||||
|
|
||||||
Bugs
|
Bugs
|
||||||
----
|
----
|
||||||
- the parser allows empty object case branches
|
|
||||||
- bug: generic assign still buggy
|
- bug: generic assign still buggy
|
||||||
- Optimization: If we use a temporary for the result anyway the code gen
|
- Optimization: If we use a temporary for the result anyway the code gen
|
||||||
should make use of this fact to generate better code...
|
should make use of this fact to generate better code...
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue