# parser: add helpful error for C style container declarations · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/5d22204d2dbf686d8b827eca15253914ef9543ab)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 5d22204d2dbf686d8b827eca15253914ef9543ab

Requested commit: 5d22204d2dbf686d8b827eca15253914ef9543ab

Commit: 5d22204d2dbf686d8b827eca15253914ef9543ab

Tree: 9c5e331329593fc8bc896261416513c0d5acddbb

Author: Veikka Tuominen

Committer: Veikka Tuominen

## Message

````
parser: add helpful error for C style container declarations

```zig
// a.zig
struct Foo {
    a: u32,
};
```

before:
```
a.zig:1:1: error: expected test, comptime, var decl, or container field, found 'struct'
struct Foo {
^
```
after:
```
a.zig:1:8: error: 'struct Foo' is invalid
struct Foo {
       ^
a.zig:1:8: note: to declare a container do 'const Foo = struct'
struct Foo {
       ^
```

````

## Parents

- [7d2e14267985df0226a5deee96d0c17c94bf6eb2](https://git.cafe/gitcafe/zig/commit/7d2e14267985df0226a5deee96d0c17c94bf6eb2?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/5d22204d2dbf686d8b827eca15253914ef9543ab?format=markdown)
