# `syntax.expected_statement`

Expected a statement.

Area 3, [Logic](../topics/logic.md); not declinable; the next step is usually the agent's.

There is no `while` loop; `for` over a list is the only one:

```jadpo
type Count = Int {
    min: 0
}

function first(count: Count) -> Count {
    while (count > 0) {
        return count
    }
    return count
}
```

```text
error: Jadpo has no `while` loop
 --> main.jadpo:6:5
  |
6 |     while (count > 0) {
  |     ^^^^^ not a Jadpo statement
  reason: The only loop is `for item in items`, which always ends after its list; stop early with `return`.
  next: Loop over a list with `for`, or narrow it first with `list.filter` (agent)
  rule: syntax.expected_statement
  help: https://jadpo.dev/docs/errors/syntax.expected_statement

check failed: 1 error, 1 file
```
