Merge Break and Continue as Jump.

This commit is contained in:
Nigel Tao committed 2017-05-14 11:45:58 +10:00
1 parent 23020e7d60
commit d9fc8a1114
3 files changed
+14 -35

No files matched your search

+2 -6
View File
@@ -403,13 +403,9 @@ func (p *parser) parseStatement1() (*a.Node, error) {
case t.IDAssert, t.IDPre, t.IDPost:
return p.parseAssertNode()
case t.IDBreak:
case t.IDBreak, t.IDContinue:
p.src = p.src[1:]
return a.NewBreak().Node(), nil
case t.IDContinue:
p.src = p.src[1:]
return a.NewContinue().Node(), nil
return a.NewJump(x).Node(), nil
case t.IDWhile:
p.src = p.src[1:]