}}}
(context *funcContext, stmt *ast.RepeatStmt)
| 994 | } // }}} |
| 995 | |
| 996 | func compileRepeatStmt(context *funcContext, stmt *ast.RepeatStmt) { // {{{ |
| 997 | initlabel := context.NewLabel() |
| 998 | thenlabel := context.NewLabel() |
| 999 | elselabel := context.NewLabel() |
| 1000 | |
| 1001 | context.SetLabelPc(initlabel, context.Code.LastPC()) |
| 1002 | context.SetLabelPc(elselabel, context.Code.LastPC()) |
| 1003 | context.EnterBlock(thenlabel, stmt) |
| 1004 | compileChunk(context, stmt.Stmts, true) |
| 1005 | compileBranchCondition(context, context.RegTop(), stmt.Condition, thenlabel, elselabel, false) |
| 1006 | |
| 1007 | context.SetLabelPc(thenlabel, context.Code.LastPC()) |
| 1008 | n := context.LeaveBlock() |
| 1009 | |
| 1010 | if n > -1 { |
| 1011 | label := context.NewLabel() |
| 1012 | context.Code.AddASbx(OP_JMP, 0, label, eline(stmt)) |
| 1013 | context.SetLabelPc(elselabel, context.Code.LastPC()) |
| 1014 | context.Code.AddABC(OP_CLOSE, n, 0, 0, eline(stmt)) |
| 1015 | context.Code.AddASbx(OP_JMP, 0, initlabel, eline(stmt)) |
| 1016 | context.SetLabelPc(label, context.Code.LastPC()) |
| 1017 | } |
| 1018 | |
| 1019 | } // }}} |
| 1020 | |
| 1021 | func compileBreakStmt(context *funcContext, stmt *ast.BreakStmt) { // {{{ |
| 1022 | for block := context.Block; block != nil; block = block.Parent { |
no test coverage detected
searching dependent graphs…