From bc3c9f4ab3141a8ab2672df92d02788569328624 Mon Sep 17 00:00:00 2001 From: cgswords Date: Fri, 19 Jul 2024 06:08:26 +0000 Subject: [PATCH] deploy: 05df173c31c9632668cad0eb656c24fa267b4fda --- .../control-flow/labeled-control-flow.html | 87 ++++++++++++++++--- reference/print.html | 87 ++++++++++++++++--- reference/searchindex.js | 2 +- reference/searchindex.json | 2 +- 4 files changed, 154 insertions(+), 24 deletions(-) diff --git a/reference/control-flow/labeled-control-flow.html b/reference/control-flow/labeled-control-flow.html index bb1ad8f1..9e96b145 100644 --- a/reference/control-flow/labeled-control-flow.html +++ b/reference/control-flow/labeled-control-flow.html @@ -185,10 +185,14 @@

The Move Reference

Labeled Control Flow

-

Move supports labeled control flow, allowing you to define and transfer control to specific labels -in a function. For example, we can nest two loops and use break and continue with those labels -to precisely specify control flow. You can prefix any loop or while form with a 'label: form -to allow breaking or continuing directly there.

+

Move supports labeled control flow when writing both loops and blocks of code, allowing you +to break and continue loops and return from blocks (which can be particularly helpful in the +presence of macros).

+

Loops

+

Loops allow you to define and transfer control to specific labels in a function. For example, we can +nest two loops and use break and continue with those labels to precisely specify control flow. +You can prefix any loop or while form with a 'label: form to allow breaking or continuing +directly there.

To demonstrate this behavior, consider a function that takes nested vectors of numbers (i.e., vector<vector<u64>>) to sum against some threshold, which behaves as follows:

Labeled Control Flow

-

Move supports labeled control flow, allowing you to define and transfer control to specific labels -in a function. For example, we can nest two loops and use break and continue with those labels -to precisely specify control flow. You can prefix any loop or while form with a 'label: form -to allow breaking or continuing directly there.

+

Move supports labeled control flow when writing both loops and blocks of code, allowing you +to break and continue loops and return from blocks (which can be particularly helpful in the +presence of macros).

+

Loops

+

Loops allow you to define and transfer control to specific labels in a function. For example, we can +nest two loops and use break and continue with those labels to precisely specify control flow. +You can prefix any loop or while form with a 'label: form to allow breaking or continuing +directly there.

To demonstrate this behavior, consider a function that takes nested vectors of numbers (i.e., vector<vector<u64>>) to sum against some threshold, which behaves as follows: