# E4102

Outside of a loop.

This error occurs when using `break` or `continue` statements outside of a loop
construct. These control flow statements can only be used within loops.

- `break` is used to exit a loop early
- `continue` is used to skip to the next iteration of a loop

Using these statements outside of a loop body is invalid since there is no loop
to break from or continue to the next iteration.

## Erroneous example

```{literalinclude} /sources/error_codes/4102_error/top.mbt
:language: moonbit
```

## Suggestion

To fix this error, ensure that `break` and `continue` are used within a loop
construct.

```{literalinclude} /sources/error_codes/4102_fixed/top.mbt
:language: moonbit
```
