# V0009 expected_terminator

URL: /docs/errors/V0009
Markdown: /docs/errors/V0009.md

> Two statements are on one line without ;, or junk follows a complete statement (design §2.4).

An error from the `parse` phase. `sakura explain V0009` prints this explanation offline.

Two statements are on one line without `;`, or junk follows a complete statement (design §2.4).

Wrong:

```sakura
let a = 1 let b = 2
```

Fixed:

```sakura
let a = 1; let b = 2
```

## Wrong program [#wrong-program]

[`compiler/tests/ui/V0009_expected_terminator.sakura`](https://github.com/icantcodefyi/sakuralang/blob/master/compiler/tests/ui/V0009_expected_terminator.sakura), which the compiler's ui suite runs through `sakura check`:

```sakura
fn sum() -> Int {
  let a = 1 let b = 2
  a + b
}
```

`sakura check --json` reports this record (pretty-printed; `$DIR` is the fixture's directory):

```json
{
  "schema_version": "1.0",
  "kind": "diagnostic",
  "id": "d:2dc1af46fa9baad6",
  "code": "V0009",
  "severity": "error",
  "phase": "parse",
  "message": "expected a newline or `;` after the statement",
  "snapshot": "sha256:$SNAPSHOT",
  "symbol_id": "main::V0009_expected_terminator::sum",
  "spans": [
    {
      "uri": "file://$DIR/V0009_expected_terminator.sakura",
      "content_hash": "sha256:3aeebd0c946288e40b85f153c9b9cfe41f60dcb9e6fa7baa7a8355353749a219",
      "start_byte": 64,
      "end_byte": 67,
      "role": "primary"
    }
  ],
  "related_ids": [],
  "expected": null,
  "actual": null,
  "obligation": null,
  "counterexample": null,
  "explanation_uri": "sakura://explain/V0009",
  "fixes": []
}
```

## Fixed program [#fixed-program]

[`compiler/tests/ui/V0009_expected_terminator.fixed.sakura`](https://github.com/icantcodefyi/sakuralang/blob/master/compiler/tests/ui/V0009_expected_terminator.fixed.sakura), which `sakura check` accepts with no diagnostics:

```sakura
fn sum() -> Int {
  let a = 1
  let b = 2
  a + b
}
```
