# AstGen: disallow leading zeroes in int literals and int types · gitcafe/zig

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

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

Visibility: public

Requested revision: 4055e6055b5c0727f5e85a30760c9bccf525f4de

Requested commit: 4055e6055b5c0727f5e85a30760c9bccf525f4de

Commit: 4055e6055b5c0727f5e85a30760c9bccf525f4de

Tree: 3295ef3babc22815422ced1f692bc98c9a43972d

Author: zooster

Committer: GitHub

## Message

```
AstGen: disallow leading zeroes in int literals and int types

This makes `0123` and `u0123` etc. illegal.

I'm now confident that this is a good change because
I actually caught two C header translation mistakes in `haiku.zig` with this.
Clearly, `0123` being octal in C (TIL) can cause confusion, and we make this easier to read by
requiring `0o` as the prefix and now also disallowing leading zeroes in integers.

For consistency and because it looks weird, we disallow it for integer types too (e.g. `u0123`).

Fixes #11963
Fixes #12417
```

## Parents

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

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